How do I disable the guest session?

Updated: 2016-Aug

For Ubuntu 16.04 LTS (15.10 or later)

Adapted from: LightDM Ubuntu Wiki - Configuration

  • System provided configuration files in /usr/share/lightdm/ are not intended to be user editable. Instead users should use: /etc/lightdm/
  • Newer versions of LightDM (Ubuntu 15.10, or later) use [Seat:*] instead of [SeatDefaults]

Just run this (once) at terminal:

sudo sh -c 'printf "[Seat:*]\nallow-guest=false\n" >/etc/lightdm/lightdm.conf.d/50-no-guest.conf'

To undo (restore Guest option), remove the file created:

sudo rm /etc/lightdm/lightdm.conf.d/50-no-guest.conf

For Ubuntu 14.04 LTS (up to 15.04)

Adapted from: Ubuntu Forums - lightdm config files location in 14.04

Just run this (once) at terminal:

sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" >/usr/share/lightdm/lightdm.conf.d/50-no-guest.conf'

You will no longer have 'Guest' as login option, on your next login.

To undo (restore Guest option), remove the file created:

sudo rm /usr/share/lightdm/lightdm.conf.d/50-no-guest.conf

For Ubuntu 12.04 LTS (up to 13.10)

Simplest method.

Just run this (once) at terminal:

sudo /usr/lib/lightdm/lightdm-set-defaults -l false

You will no longer have 'Guest' as login option, on your next login.

  • This simply appends allow-guest=false to /etc/lightdm/lightdm.conf.

  • Should work from 11.10 onwards (since these use LightDM as well).

To undo (restore Guest option):

sudo /usr/lib/lightdm/lightdm-set-defaults -l true

Only use this method if you are using Ubuntu Desktop. If you are using another flavour such as Xubuntu or Lubuntu please refer to this answer instead.

If you're using the default LightDM, edit /etc/lightdm/lightdm.conf so that it looks like this:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
allow-guest=false

If you're using GDM (which was the default in previous Ubuntu releases), uninstall gdm-guest-session.


For Ubuntu 13.10 to 14.10, the file has moved to /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf

For Ubuntu 14.10 or higher, the file has moved to /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf


Type this in the terminal

gksu gedit /etc/lightdm/lightdm.conf

You will see the following:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu

Add allow-guest=false to the end so your final result should look like:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
allow-guest=false

Save the document and quit the text editor.

Back in the Terminal, restart the display manager. (This will end the graphical login session, immediately quitting all programs running in it, so make sure your work--like any open documents--is saved first!)

sudo restart lightdm

With the graphical login session ended, you're returned to the login screen, where you'll notice that guest acount is disabled.

That's it--the guest account is no longer usable.