How to disable the guest account via the GUI? [duplicate]

How do I disable the guest session in Ubuntu 11.10 or higher? I don't want people to be able to use my computer without using a password to log in!


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