What are guest accounts and why are they useful
Guest accounts are shared accounts that are used temporarily by different users. The home directory and settings of a guest account are reset automatically when the user logs out (or logs in).
This minimizes the need for maintenance; no matter how much the users mess with the settings, in the end everything would go back to the default settings automatically. For example a user might change the settings of the desktop and make it difficult for the other users to use it. Without guest accounts an administrator would have to fix it back again.
Guest accounts also ensures the safety of the users, because no open accounts or passwords are left behind. For example a user may login to his gmail account and forget to logout (or maybe the internet connection breaks). Then the next user would be able to read his emails because the session is open in the browser, unless the account is wiped clean. Or maybe a user writes a personal document (e.g. a homework) and forgets to delete it when he is done. Then the next user would be able to copy it.
Guest accounts are a good solution for the problems mentioned above.They might be useful in public computers (e.g. in a library), where the computer is used temporarily and the users don't have permanent accounts.
How to create guest accounts
We can create guest accounts like this:
cd /var/ds/linuxmint-1/ ds guest-accounts # generate a list of guest accounts ds guest-accounts generate 3 ds guest-accounts gen 30 > guests.txt tail guests.txt # create guest accounts on linuxmint ds guest-accounts create-lm guests.txt ds exec ls /home/guest-accounts/ # create guest accounts on guacamole ds guest-accounts create-guac guests.txt > guest-urls.txt cat guest-urls.txt
Creating a list of guest accounts
ds guest-accounts gen uses
pwgen to generate random passwords, so we have to install it first (with
apt install pwgen).
However the file
guests.txt can be generated with any other tool, for example with a simple bash command like this:
for i in $(seq 30); do echo guest$i; done > guests-1.txt tail guests-1.txt
In this case the password is missing, so the password will be the same as the username (for example
Creating guest accounts on guacamole
After creating guest accounts on linuxmint (with
ds guest-accounts create-lm), we also have to create the same accounts on guacamole (with
ds guest-accounts create-guac). This is because only guacamole can ensure that no simultaneous logins can be made to a guest account.
The configuration of guacamole is optimized so that a guest account is automatically logged in to linuxmint with the same username and password that it was logged in to guacamole. As a further optimization, one can use the URLs on
guest-urls.txt to automatically login to a guest account.
Customizing the settings of guest accounts
settings.sh there are these lines:
This is the account that is used as a template (skeleton) by the guest accounts. Every time a guest user logs in or logs out, the content of the home directory is erased and replaced by that of the template account. The configs/settings are also reset.
So, in order to customize the appearance and settings of the guest accounts, we just need to login to this template account and customize it. Then open the terminal and save the configuration like this:
Now the changes will be reflected to the guest accounts.