Disable Guest Session Account in Ubuntu 12.x


ubuntuIf you’re an Ubuntu 12.04 LTS or the 12.10/12.x user, you might notice a new ‘Guest Session’ feature on your login screen. While the guest account does not pose a security threat, this could let anyone use your computer. If you prefer not to allow guest users on your computer, this simple guide will help you to. It cannot be disabled via the ‘User Accounts’ tool in ‘System Settings’, but it’s pretty simple following the quick steps below.

LightDM is responsible for the login screen and we shall be modifying the LightDM Configuration file to add a boolean value, and finally restart the LightDM service.

To start with, open up Terminal (CTRL + ALT + T) or press ALT + F2 and type in the following command

gksu gedit /etc/lightdm/lightdm.conf

You will now have to authenticate yourself. Type in your password and proceed. You’ll be displayed the file’s contents on gedit.

And now, in the [SeatsDefault] section, add the following line and save the file.

allow-guest=false

You have now instructed not to allow guest sessions on your ubuntu machine. For the setting to take effect, you will either have to restart your machine, or swiftly restart the LightDM service alone. We’ll take the quick method of restarting LightDM. To do so, type the following in your Terminal and press Enter.

sudo restart lightdm

You have instructed your machine to restart LightDM. From now, you shouldn’t be noticing guest session while you login.

Enabling Guest Session

If you would like to have Guest Session enabled again, open up lightdm.conf again and change the allow-guest value to true, or simply take the line off. Save the file and restart LightDM or your machine. You’ll get back guest session while you log in.