How to Hide User List from GDM Login Screen in Ubuntu 20.04, 20.10


Want to prevent all users from listing in login screen, then type your username and password to login? Here’s how to do it in Ubuntu 20.04 ang Ubuntu 20.10 Gnome Desktop.

There are 2 ways to do this job: create a configuration file and write rules to disable user list, or run gsettings command in terminal.

Option 1: Create configuration file to disable user list:

  1. Open terminal by pressing Ctrl+Alt+T on keyboard. When it opens, run command:
    sudo gedit /etc/dconf/profile/gdm

    The command will create a profile and open it via Gedit text editor. When the file opens, paste following lines and save it.

    user-db:user
    system-db:gdm
    file-db:/usr/share/gdm/greeter-dconf-defaults

  2. Run command to create /etc/dconf/db/gdm.d directory if it does not exist.
    sudo mkdir /etc/dconf/db/gdm.d
  3. Create and edit the key file under this directory:
    sudo gedit /etc/dconf/db/gdm.d/00-login-screen

    When the file opens, paste following lines and save it.

    [org/gnome/login-screen]
    # Disable user list from login screen
    disable-user-list=true

  4. Finally update database to apply changes by running command:
    sudo dconf update

Option 2: Disable user list via gsettings command.

The gsettings configuration tool can do the job. However, you need to get gdm user privilege before running the command.

NOTE: this method may not work on Ubuntu running as guest in Virtualbox.

Get gdm user privilege in terminal:

First open terminal by pressing Ctrl+Alt+T on keyboard, and run following commands one by one.

  1. Run command to get root permission:
    sudo -i
  2. Add local user gdm to access control list:
    xhost +SI:localuser:gdm
  3. Get the gdm permission in this terminal window:
    su gdm -s /bin/bash

Run gsettings command:

In this command window, run command:

gsettings set org.gnome.login-screen disable-user-list true

Though the command outputs a flatpak permission denied warning, it works in my case after restart.

Merilyn Ne
Hi, I'm Merilyn Ne, a geek who has been working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.