Pop Mood Daily
general /

How to disable ubuntu’s guest session account

Last updated January 12, 2018 By Abhishek Prakash 10 Comments

How to disable ubuntu’s guest session account

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:

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

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:

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

allow-guest=false How to disable ubuntu’s guest session accountRestart 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.

Like what you read? Please share it with others.

How to disable ubuntu’s guest session account

A guest session on Ubuntu allows having a temporary user account and access the Ubuntu machine. The desktop of a guest session looks like it does when a regular user logs in. Behind the scenes, Ubuntu controls the access privileges for a guest session.

The official definition of guest session goes as follow: This package adds support for starting a guest session through gdm’s flexiserver, which any already logged in user can launch. It creates a temporary guest account with a temporary home directory and some restricted privileges (such as not being able to read any home directory or do any permanent change to the system).

However, you would like to disable the guest session feature for some reason. This how-to tutorial will tell you how to disable/enable guest sessions on Ubuntu 16.04 LTS.

How to disable ubuntu’s guest session account

Step 1. Open a terminal session (Control+Alt+T) and go to lightdm configuration directory /etc/lightdm/lightdm.conf.d

Step 2. With sudo access, using vi editor open a file with name 50-no-guest.conf as follows:

Step 3: When the new file opens, add below lines and exit after saving the file.

How to disable ubuntu’s guest session account

This will create the new file name 50-no-guest.conf in /etc/lightdm/lightdm.conf.d directory.

How to disable ubuntu’s guest session account

Step 4: Restart the machine, that’s it. You won’t see guest sessions anymore on the Ubuntu.

In case you would like to restore the guest session, just remove the file 50-no-guest.conf from the directory /etc/lightdm/lightdm.conf.d and restart the machine. You will get the guest session back!

Conclusion

​Anyone who uses the guest session to sign in to your Ubuntu machine has no privileges to change the file belonging to other users. However, there was a security issue reported earlier with a lightdm package that allows a guest user to access restricted files of the system. You may feel that having a guest account does not make sense when you know that you are the only person who accesses your Ubuntu machine. In either case, I hope this tutorial helps you to get rid of the guest account.

LinuxAndUbuntu hosting is sponsored by massiveGRID

This website needs your consent to use cookies in order to customize ads and content.

If you give us your consent, data may be shared with Google.

How to remove guest session from the login options on ubuntu.

Edited: 2017-04-10 21:43

How to disable ubuntu’s guest session account

To disable the guest session account on Ubuntu, the first place one would expect to look, is in the account manegment tool – but for some reason the option is missing – fear not! All you need to do, is to edit the /etc/lightdm/lightdm.conf file in you ubuntu installation.

To edit the lightdm.conf file, simply open a new terminal window and enter the below command:

Doing this will pompt you for your password to edit the file. After typing your password, you can edit the file. The content of the file should look like below:

Now, to disable the guest option from the login screen, simply place the following somewhere last in the file.

Thee are two ways to make the changes thake effect, either you need to reboot your computer – which is a small inconviance – espicially if your disk is encrypted, and you need to re-enter your encryption key on each reboot – the other way is to restart lightdm by entering the below command

If you later want to re-enable your guest account, all you need to do is to go through all the above steps, only backwards.

Video

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 12

  • 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:

To undo (restore Guest option), remove the file created:

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:

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):

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:

If you’re using GDM (which was the default in previous Ubuntu releases), uninstall gdm-guest-session.

WebOS Support By HP To Be Shut Down In January

Ubuntu and Linux Mint possess a feature known as “Guest Session” account, which almost anyone and everyone can log in from the login screen itself– no password demanded for. This guest account is temporary, once session is terminated any modification performed in that session lost so if anyone logs into the system again with a new guest session account, the user will be provided a new desktop. Yet if you intend to limit access to your computer, then a best solution is to disable / remove Ubuntu Guest Session Account.

Steps to Disable / Remove Ubuntu Guest Session Account?

Ubuntu doesn’t show you a fast and easy choice to switch off this feature. If you play around with the User Accounts configuration tool, where you might think that such an option would be present, then certainly you are in the wrong track. To disable it, we need to modify lightdm.conf, which commands over the LightDM display manager settings, which is also the login screen commander.

1. Open up LightDM’s configuration file in a text editor by tapping the keys Alt+F2, and type in the following command, and pressing Enter:

$gksu gedit /etc/lightdm/lightdm.conf

2. You will be asked to provide the password, enter the password. You will now able to view/edit the file.

3. Just include the following line to the end of the file, in the [SeatDefaults] section:

Save the file after including the above line.

4. Now, you need to restart the system or you may execute the following command in a terminal to restart LightDM itself and view the modification in place even without restarting your system:

$sudo restart lightdm

After restarting the computer or executing the above command, the Guest Session will disappear from your login screen

How to disable ubuntu’s guest session account

Ubuntu 14.04 LTS is Out! One of the first things to do after upgraded to or installed the Trusty Tahr is disable the Guest Session. Here I’ll show you how.

In Ubuntu 14.04 Trusty, the configuration files for LightDM has been moved to /usr/share/lightdm directory. I could only guess that the previous location “/etc/lightdm” is in preparation for giving the login option of logging in to a Unity 8 preview session running on Mir/Xmir.

Anyhow, you can follow the below steps to remove Guest Session in Ubuntu 14.04:

1. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the command below to edit the config file:

Type in your user password when it asks. You may need to install gksu first from Ubuntu Software Center.

2. When the file opens, add this line in the end of file and save it.

How to disable ubuntu’s guest session account

That’s it. Guest Login will disappeared at next boot.

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • LinkedIn
  • Reddit
  • Pinterest
  • Telegram
  • WhatsApp
  • Email

I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected]

  • Install Grub Customizer in.
  • Save Screen Brightness.

11 responses to Remove Guest Session From Ubuntu 14.04 Login Screen

What’s the benefit doing that?

Why would one do this? For example, you could prevent people from using your computer without logging in as identifieable user.

Very simple reason for doing that, I don’t want anybody else on the computer. You can’t even password protect guest account and I don’t want children on it going to websites they shouldn’t be on.
Sounds good to me. I want to know what there are doing and when they are on the computer, especially after I went to bed.

Ubuntu 14.04 LTS is Out! One of the first things to do after upgraded to or installed the Trusty Tahr is disable the Guest Session.

Why would you want to do that?? It’s one of the best features of Ubuntu, I can allow somebody to just use my computer quickly without fear of them messing with any of my settings or screwing up my computer, it’s perfect!

@fatriff. Just for choice. Some guys do not need Guest, so they want to remove it.

I like it.
Don’t bother yourself about english grammar( grammarian will dislike me saying that), but everything you’ve written is to the point.
Thank you.

Thank you!
I tried before to create the conf file /etc/lightdm/lightdm.conf as for previous ubuntu. As result I had serious problems at start with my graphical controler :-/

@fatriff It can be for security reasons
I used my laptop as professionel device in my company. When I’m out I prefer to be sure that nobody can access to the network from my computer.

Hi, Thanks for sharing! I’m kinda newbi in Ubuntu even more with terminal cmds. How can I get the terminal from the guest windows credentials? It hit key roughly but no window pop up. Thanks again!

Hi Ji m. Thanks for the method you proposed of editing /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf. I found this worked fine.

However, according to the Ubuntu wiki for Light Display Manager

…it states: “System provided configuration is stored in /usr/share/lightdm/lightdm.conf.d/*.conf and is not user editable. System administrators can override this configuration in /etc/lightdm/lightdm.conf.d/*.conf and /etc/lightdm/lightdm.conf.”

Using Ubuntu 14.10 I wasn’t successful with getting a .conf file in /etc/lightdm/lightdm.conf.d/ to work, but placing allow-guest=false in /etc/lightdm/lightdm.conf seems to work OK.
cheers, Ian.

Thanks.. it worked just fine and simple instruction. Bookmarked your site

Hi Ji M,
Thanks for the tip, yet it seems that for my version – 14.04LTS and Nvidia cards – this detail crashed my video drivers. I don’t know whether there is a relationship between the two, yet I’m just posting this for the others to be attentive 🙂 I had to delete the line from recovery mode.
Cheers!

This website needs your consent to use cookies in order to customize ads and content.

If you give us your consent, data may be shared with Google.

How to remove guest session from the login options on ubuntu.

Edited: 2017-04-10 21:43

How to disable ubuntu’s guest session account

To disable the guest session account on Ubuntu, the first place one would expect to look, is in the account manegment tool – but for some reason the option is missing – fear not! All you need to do, is to edit the /etc/lightdm/lightdm.conf file in you ubuntu installation.

To edit the lightdm.conf file, simply open a new terminal window and enter the below command:

Doing this will pompt you for your password to edit the file. After typing your password, you can edit the file. The content of the file should look like below:

Now, to disable the guest option from the login screen, simply place the following somewhere last in the file.

Thee are two ways to make the changes thake effect, either you need to reboot your computer – which is a small inconviance – espicially if your disk is encrypted, and you need to re-enter your encryption key on each reboot – the other way is to restart lightdm by entering the below command

If you later want to re-enable your guest account, all you need to do is to go through all the above steps, only backwards.

Video

I’m uing ubuntu 12.04 desktop. I have 3 users: user1(administrator), user2(standard) and guest. I wanted to disable user1 and enable user2 which auto logs on with no password but after I did that I can’t login to user1 and user2 accounts except the guest session user. I’m striped off every administrative privileges. I don’t know which options are available to me and how do I enable root or user which is an administrator?

How to disable ubuntu’s guest session account

3 Answers 3

Let the account expire to disallowing a user from logging in from any source including ssh:

This is how you can reenable that account:

To disable / lock the password of user account use below command. This will not disallow ssh-access on Ubuntu. This prepends a ! to the password hash so that no password will match it anymore.

This command seems to differ across platforms. On Ubuntu, expiring a password will command the user to make up a new one once he logs in. This is not suitable for disabling an account.

Use this to lock an account:

and this to unlock an account so locked:

(Disabling and locking a user account both mean the same thing.)

To disable / lock the user account use below command:

To put an expire date to an user account so that it automatically gets disabled / locked.

To re-enable a disabled user, issue the passwd command with the -u option.

To enable the root account and change the root password use below steps.

Enter the new password for root account and then exit. if this does not solve the issue let me know.

Please feel free to let me know if you need anything else or any further clarification.

1.82M affected by Ubuntu Forums data breach; passwords stolen

Ubuntu and Linux Mint possess a feature known as “Guest Session” account, which almost anyone and everyone can log in from the login screen itself– no password demanded for. This guest account is temporary, once session is terminated any modification performed in that session lost so if anyone logs into the system again with a new guest session account, the user will be provided a new desktop. Yet if you intend to limit access to your computer, then a best solution is to disable / remove Ubuntu Guest Session Account.

Steps to Disable / Remove Ubuntu Guest Session Account?

Ubuntu doesn’t show you a fast and easy choice to switch off this feature. If you play around with the User Accounts configuration tool, where you might think that such an option would be present, then certainly you are in the wrong track. To disable it, we need to modify lightdm.conf, which commands over the LightDM display manager settings, which is also the login screen commander.

1. Open up LightDM’s configuration file in a text editor by tapping the keys Alt+F2, and type in the following command, and pressing Enter:

$gksu gedit /etc/lightdm/lightdm.conf

2. You will be asked to provide the password, enter the password. You will now able to view/edit the file.

3. Just include the following line to the end of the file, in the [SeatDefaults] section:

Save the file after including the above line.

4. Now, you need to restart the system or you may execute the following command in a terminal to restart LightDM itself and view the modification in place even without restarting your system:

$sudo restart lightdm

After restarting the computer or executing the above command, the Guest Session will disappear from your login screen