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!
12 Answers
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=falseto/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
- 8,294
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.
- 119,640
- 2,534
You can do that using Ubuntu Tweak.
To install it, use these commands:
sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak
After installing, navigate to Tweaks → Login Settings and switch off the "Guest account".

- 28,986
- 1,245
- 18
- 36
Just run
gksudo gedit /etc/lightdm/lightdm.conf
Add the following line
allow-guest=false
Then (this will immediately log you out, quitting any programs running in your graphical session, so save your work first):
sudo restart lightdm
- 119,640
- 12,456
How to disable this option in the future
I just ran into the same problem on my new trusty/14.04 installation. Also to my surprise I couldn't find the lightdm.conf.d folder inside /etc/lightdm/ just users.conf.
Investigation
$ find / -iname *lightdm* 2>/dev/null | grep -v /mnt | grep -v /media | grep -v /home
[...]
/usr/share/lightdm/lightdm.conf.d
[...]
Aha, there you are. What's in there?
$ ls -1 /usr/share/lightdm/lightdm.conf.d/
50-greeter-wrapper.conf
50-guest-wrapper.conf
50-ubuntu.conf
50-unity-greeter.conf
50-xserver-command.conf
Okay, what's in there?
$ cat /usr/share/lightdm/lightdm.conf.d/*
[SeatDefaults]
greeter-wrapper=/usr/lib/lightdm/lightdm-greeter-session
[SeatDefaults]
guest-wrapper=/usr/lib/lightdm/lightdm-guest-session
[SeatDefaults]
user-session=ubuntu
[SeatDefaults]
greeter-session=unity-greeter
[SeatDefaults]
# Dump core
xserver-command=X -core
Conclusion
We find a bunch of configuration files similar to the INI format following the naming scheme of 50-${some-descriptive-name}.conf and configuring keys for the section [SeatDefaults].
We're not going to edit any of these files as these are meant to be managed by the package manager, but now we how we should add and manage our custom configuration bits to /etc.
Solution
Given the above, that lightdm is the display manager and the configuration files look like the above. The following solution should work:
Create the missing directories:
$ sudo mkdir -p /etc/lightdm/lightdm.conf.dAdd a custom configuration file by running:
$ sudo nano /etc/lightdm/lightdm.conf.d/50-disable-guest-session.confand paste the following lines:
[SeatDefaults] allow-guest=falseThen save (Ctrl+O) and close (Ctrl+X).
Now logout and switch to a virtual terminal (Ctrl+Alt+F1), then run:
$ sudo service lightdm restartThe guest session option should now be gone. If something is not working quite right you now know where the default configuration is stored and that you didn't change it.
Further reading
- 29,597
13.04 and later
Execute this command in a terminal
sudo /usr/lib/lightdm/lightdm-set-defaults -l falseReboot your machine or restart
lightdmwith the following command
(This will log you out immediately, save your data)sudo restart lightdm
Apparently, it works in 13.10 (can't test myself, but there's a comment here).
I'm using 13.04 and all this does it append allow-guest=false to /etc/lightdm/lightdm.conf, but it might be different in 13.10.
Originally by david6 from here: https://askubuntu.com/a/169105/176889
Install ubuntu-tweak, get to the tweak tab, turn off the guest button and reboot. That's it!
One may find the terminal easier, but in case the need to turn on the guest account arises then one would have to visit this page again and see the instructions (or rather undo). That's the advantage of the GUI thing... one remembers it easily.
- 511
Change allow-guest=true to 'false' in /etc/lightdm/lightdm.conf
You can then either reboot or restart the service in the terminal:
sudo restart lightdm
Assuming you are using lightdm which is standard in 11.10.
- 36,890
- 56
- 97
- 151
- 544
Open Terminal
gksudo gedit /etc/lightdm/lightdm.conf
Add the following line
allow-guest=false
Save and exit the file.
- 4,344
I'm in the same case, the file /etc/lightdm/lightdm.conf doesn't exist in UBUNTU 13.10.
I try to create the /etc/lightdm/lightdm.conf file with this line allow-guest=false, and CRASH, the system does not start properly, only console mode...
I try to edit the file /etc/lightdm/lightdm.conf.d/10-ubuntu.conf, and works properly.
Edit the file
sudo vim /etc/lightdm/lightdm.conf.d/10-ubuntu.conf
And enter the lines that you need
# to disable guest login
allow-guest=false
# to enable user login manually
greeter-show-manual-login=true
And the last one, restart your system
sudo reboot
I think that this works fine if you restart only the ligthgdm
sudo service lightdm restart