Skip to main content
LPIC-1 Exam 102

Hide Users Ubuntu Login

By November 26, 2015September 12th, 2022No Comments

Hide Users on the Ubuntu Login Screen

Hide Users

For Objective 106.2 of the LPI LPIC-1 102 exam you will be expected to be able to configure the basics of common display managers. Ubuntu uses the lightdm  display manager with the unity greeter. The default greeter  configuration displays the users on the system and allows for the Guest account.




On corporate desktops it is is both insecure and impractical to display the users list. The user list may be populated from an openLDAP directory or even Active Directory and we can see that this would be crazy to attempt to deploy the complete user list from a directory. Additionally, the Guest account can be used by anyone without a password. This is not desirable in a corporate environment.

We can create are own custom configuration in the Ubuntu desktop quite easily and we do not need to edit any existing configuration allowing use to revert at any time should we need. In the example we are using Ubuntu 14.04 LTS.

First we create the directory for the custom configuration:

$ sudo mkdir /etc/lightdm/lightdm.conf.d/

Now we can add the configuration. We will use the vi text editor but feel free to use nano should you want:

$ sudo vi /etc/lightdm/lightdm.conf.d/50-custom.conf

This will be a new file so will open without content. We want to ensure that we do not display the user list or, to put it another way that we hide users in the from the list. This will  be two lines. The 3rd line disable the Guest account. The Initial line just sets the header for the area the configuration that we work with. The file should read as in the following:

[SeatDefaults]
greeter-hide-users=true
greeter-show-manual-login=true
allow-guest=false

We can see this configuration in the screenshot:

greeter

With this setting saved and in place we are ready to go. We can reboot the machine or we can choose the restart the display manager. We will need to do this from a physical console. Use Ctrl+Alt+F1 to access the tty1 console.

If you are using VirtualBox on Windows you can use : Right Ctrl + F1

If you are using VirtualBox on OS X you can use: Left CMD + fn + F1

tty2

We can log on to the text console as your user, in my case tux. From here we can restart the lightdm using the command:

$ sudo service lightdm restart

You will be returned to the login screen and we will see that we now have the desired state. No user list and no Guest login. Of course, we now need to type both the username and password to login.

laterlogin

If we need to revert to the original configuration we can smile delete the configuration file that we created.