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!
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
/usr/share/lightdm/
are not intended to be user editable. Instead users should use:/etc/lightdm/
[Seat:*]
instead of[SeatDefaults]
Just run this (once) at terminal:
To undo (restore Guest option), remove the file created:
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:
You will no longer have 'Guest' as login option, on your next login.
To undo (restore Guest option), remove the file created:
For Ubuntu 12.04 LTS (up to 13.10)
Simplest method.
Just run this (once) at terminal:
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):
If you're using the default LightDM, edit
/etc/lightdm/lightdm.conf
so that it looks like this: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
You will see the following:
Add
allow-guest=false
to the end so your final result should look like: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!)
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.
You can do that using Ubuntu Tweak.
To install it, use these commands:
After installing, navigate to Tweaks → Login Settings and switch off the "Guest account".
Just run
Add the following line
Then (this will immediately log you out, quitting any programs running in your graphical session, so save your work first):
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/
justusers.conf
.Investigation
Aha, there you are. What's in there?
Okay, what's in there?
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:
Add a custom configuration file by running:
and paste the following lines:
Then save (Ctrl+O) and close (Ctrl+X).
Now logout and switch to a virtual terminal (Ctrl+Alt+F1), then run:
The 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
For Ubuntu 13.10, add
to the file
/etc/lightdm/lightdm.conf.d/10-ubuntu.conf
.13.04 and later
Execute this command in a terminal
Reboot your machine or restart
lightdm
with the following command(This will log you out immediately, save your data)
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
Change
allow-guest=true
to'false'
in/etc/lightdm/lightdm.conf
You can then either reboot or restart the service in the terminal:
Assuming you are using
lightdm
which is standard in 11.10.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.