Skip to content

Instantly share code, notes, and snippets.

@lambdapioneer
Last active July 8, 2019 10:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdapioneer/64cd3c08c6bd44853e8696cd228c76ab to your computer and use it in GitHub Desktop.
Save lambdapioneer/64cd3c08c6bd44853e8696cd228c76ab to your computer and use it in GitHub Desktop.
Setting up an ephemeral guest account on Ubuntu 19.04

Ephemeral guest account on Ubuntu 19.04

Ephemeral guest account: a non-password guest account that does not persist any data accross sessions. This is helpful for borrowing the computer to someone without any fear that they might mess up anything when e.g. downloading files. Also gives them a privacy guarantee.

I use the following steps to setup an ephemeral guest account on Ubuntu 19.04 replicating the behaviour of previos Ubuntu versions. With 18.04 (?) the switch to GDM meant the removal of the previous guest account feature.

Create guest account w/o password

I suggest to use the normal "add user" functionality in Gnome. However, it won't allow to create an user without password. To remove the password run: sudo passwd -d guest.

You also want to make sure that you've set your own home folder such that it is not accessible for the guest user: chmod 700 /home/${USERNAME}.

Register GDM call-back to clear home folder

Add the following lines in /etc/gdm3/PostSession/Default:

if [ ${USERNAME} = "guest" ];then
  rm -rvf /home/guest
  mkdir /home/guest
  chown guest:guest /home/guest
  chmod 700 /home/guest
fi

# (before the exit 0 obviously)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment