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 reasons. This how-to tutorial will tell you how to disable/enable guest session on Ubuntu 16.04 LTS.
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.
This will create the new file name 50-no-guest.conf in /etc/lightdm/lightdm.conf.d directory.
Step 4: Restart the machine, that’s it. You won’t see guest session 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!
Anyone who uses the guest session to sign into 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 which 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.
- Ramakrishna Jujare