When you boot up an Ubuntu Linux machine, the graphical login screen (GDM3) automatically displays a list of all registered user accounts. You simply click your name and type your password to log in.
While this is convenient for home computers, it is a significant security flaw in office or enterprise environments. By displaying the usernames openly, you are giving a potential attacker half of the credentials they need to compromise your system. To increase security, you can configure the login screen to hide the user list, forcing anyone who wants to access the machine to manually type both a valid username and a password.
How to Hide the User List on the Login Screen
You cannot change this via the standard Settings interface. You must modify the GNOME Display Manager (GDM) configuration file using the terminal.
- Open your Ubuntu Terminal (Ctrl + Alt + T).
- You need to edit the GDM custom configuration file as the root user. Type the following command and press Enter:
sudo nano /etc/gdm3/custom.conf - Provide your administrator password when prompted.
- The configuration file will open in the nano text editor. Scroll down using your arrow keys until you find the section labelled
[greeter]. - Directly below the
[greeter]header, you need to add a new line of code. (Note: if the line already exists with a ‘#’ in front of it, just remove the ‘#’ and change the value). - Add the following exact line:
DisableUserList=true - Save your changes by pressing Ctrl + O (the letter O) and hitting Enter.
- Exit the nano editor by pressing Ctrl + X.
The change is now saved, but it will not take effect until the display manager restarts.
To see the change, either type sudo systemctl restart gdm3 (warning: this will instantly log you out and close all your apps) or simply reboot your computer normally.
When the computer starts back up, the login screen will be blank. You will be presented with a prompt asking “Username,” requiring you to manually type your account name before the password field will appear.