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:
- 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
- Run command to create
/etc/dconf/db/gdm.d
directory if it does not exist.sudo mkdir /etc/dconf/db/gdm.d
- 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
- 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.
- Run command to get root permission:
sudo -i
- Add local user gdm to access control list:
xhost +SI:localuser:gdm
- 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.
Leave a Reply