SEARCH

How-To Geek

How to Disable Ubuntu’s Guest Session Account

image

Ubuntu and Linux Mint come with a “Guest Session” account, which anyone can log into from the login screen – no password required. If you’d rather restrict access to your computer, you can disable the guest account.

This guest account is locked down and changes to it don’t persist between sessions – everyone that logs in gets a fresh desktop. Still, you may want to disable it to prevent other people from using your computer.

Disabling the Guest Account

Ubuntu doesn’t expose an easy option to disable this feature. If you poke around the User Accounts configuration tool, where you might expect to find such an option, you won’t find one. To disable it, we’ll have to edit lightdm.conf, which controls the LightDM display manager (login screen)’s settings.

Open LightDM’s configuration file in a text editor by pressing Alt+F2, typing the following command, and pressing Enter:

gksu gedit /etc/lightdm/lightdm.conf

image

You’ll be prompted to enter your password. After you do, you’ll see the contents of the file.

image

Add the following line to the end of the file, in the [SeatDefaults] section:

allow-guest=false

Save the file after adding the line.

image

The changes will take effect when you restart your computer. You can also run the following command in a terminal to restart LightDM and have the changes take effect without restarting your system:

Warning: Running this command will restart your graphical desktop environment. All open graphical programs will close and you’ll lose unsaved work in all of them.

sudo restart lightdm

image

After restarting the computer or running the command, the Guest Session will vanish from your login screen.

image

Re-Enabling the Guest Account

To re-enable the guest account in the future, run the gksu gedit /etc/lightdm/lightdm.conf command again and remove the allow-guest=false line from the file. After you do, save it and restart your computer (or run the above sudo restart lightdm command) and the guest account will re-appear.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 07/3/12

Comments (4)

  1. Michael

    Nice, this is good for hardening, thanks.

  2. CR7

    Hi Cris .
    What is the best download manager for ubuntu ?

    thanks …….

  3. John

    Hi,

    Good guide, it helped me a lot. I am new to linux. Thanks for putting this out there for people! +1 for the pictures too

  4. Marc

    THX!!

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!