How to disable guest account in Ubuntu 17.04. On Ubuntu 17, users can easily disable guest account.
A guest session can be launched either from the login screen or from within a regular session. If you are currently logged in, click the icon at the far right of the menu bar and select Guest Session. This will lock the screen for your own session and start the guest session. A guest cannot view the home folders of other users, and by default any saved data or changed settings will be removed/reset at logout. It means that each session starts with a fresh environment, unaffected by what previous guests did.
The default Ubuntu Login (LightDM login) screen shows the users list and Guest Session. For security concerns or on personal computers you may want to disable or hide or remove the guest session/user list from the login screen in Ubuntu Systems
There is a way to disable and hide the users list and Guest Session from the Ubuntu login screen. You can add a rule into the LightDM display manager configuration file and disable the login options on Ubuntu Systems – Ubuntu 17.04, Ubuntu 16.04, Ubuntu 16.10, Ubuntu 15.04, Ubuntu 15.10, Ubuntu 14.04, Ubuntu 14.10 and Derivatives.
Step 1 – Install GKSu
I assume you have installed GKSu. The GKSu can be insatlled via Ubuntu Software Center. Open Ubuntu Software Center and search for gksu and install it.
GKSu is a Gtk+ frontend to su and GKSudo is a frontend to sudo. Their primary purpose is to run graphical commands that need root without the need to run an X terminal emulator and using su directly.
If no command is given, the gksu program will display a small window that allows you to type in a command to be run, and to select what user the program should be run as.
Step 2 – Edit LightDM Configuration File
Open terminal and run the following commands to edit the LightDM display manager configuration file:
sudo apt install gksu && gksudo gedit /etc/lightdm/lightdm.conf.d/50-no-guest.conf
Hide The User List From Ubuntu Login Screen
To hide the Ubuntu login screen user list, paste the following code in the file:
Disable The Guest Session From Ubuntu Login Screen
To disable the Ubuntu login screen Guest Session, paste the following code in the file:
Then save the file and restart your computer to apply changes.
You can also add the two codes in one.