How To Disable Guest Account In Ubuntu

How to disable guest account in Ubuntu Linux

Brief: This quick tutorial shows you multiple ways to disable guest account in Ubuntu Linux.

Ubuntu and Linux Mint come with a default guest user account that does not require a password. In this tutorial, we shall see how to disable guest account in Ubuntu 16.04 and 14.04.

What is the guest account in Ubuntu?

Before going further let’s talk about guest user accounts and why or why not you should disable a guest account.

How do you feel when someone asks to use your personal computer? Are you skeptical of what that person might do with your computer, your personal data and settings?

This is where guest user account comes in picture. It gives anyone temporary access to your computer without putting your digital data at risk. A guest user can access internet but cannot change settings. As soon as the guest user logs off, your computer is restored back to the state it was in, largely. Moreover, it does not require any password to login.

Talking of passwords, you should know that it is really easy to hack Ubuntu admin passwords.

But how often does guest accounts come in use? For me, I am the only user of my laptop and the guest session have never been used in my system. Then why should I keep it? I would rather prefer to disable the guest account from Ubuntu and prevent it from showing in login screen.

You may have your own reasons to not use guest sessions. Let’s see how can we disable guest account session in Ubuntu Linux.

How to disable guest account in Ubuntu:

We’ll see two command line trick to disable guest account Ubuntu 14.04 and 16.04.

Solution 1:

Open the terminal (Ctrl+Alt+T) and use the following command to disable the guest session:

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

To re-enable guest session, use the same command but with option true this time.

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

Solution 2:

If you are not comfortable with the commands above then you can configure lightdm to disable the guest session. Use the following commands to open the lightdm configuration in Gedit:

gksudo gedit /etc/lightdm/lightdm.conf

Change the following line to false in the file and save it:

allow-guest=false Disable Guest Session Account in Ubuntu 13.04Restart lightdm to see the effect or restart your computer.

That’s it. You won’t be troubled with guest sessions anymore. I hope this tutorial helps you to disable guest account in Ubuntu Linux. Regularly visit us to learn more tricks and tips on Ubuntu.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world


Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.