How to hide users from the GDM login screen?

For newer GDM 3.X, old answers don't work, except for this one
The greeter setting in custom.conf is obsolete, i.e. it won't work anymore. One easy workaround if you want to avoid changing the uid of the user:

  1. Open the terminal, and enter (replace user with the username you want to hide from the login screen):

    sudo nano /var/lib/AccountsService/users/user
    
  2. Add the following to the file:

    [User]  
    Language=   
    XSession=gnome  
    SystemAccount=true  
    
  3. Switch user or log out to test if user is not listed anymore.


Edit the file /etc/gdm/gdm.schema find the section that currently looks like this:

  <schema>
    <key>greeter/Exclude</key>
    <signature>s</signature>
    <default>bin,root,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,nobody4,noaccess,postgres,pvm,rpm,nfsnobody,pcap</default>
  </schema>

And to exclude a user called qmail for example add qmail to the default list so the section looks like this.

  <schema>
    <key>greeter/Exclude</key>
    <signature>s</signature>
    <default>qmail, bin,root,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,nobody4,noaccess,postgres,pvm,rpm,nfsnobody,pcap</default>
  </schema>

That will stop user qmail appearing in the gdm greeter. There used to be a nice GUI tool to do this but is has not been in Ubuntu for the last few releases.

The other alternative is to set the UID of the user to under 1000. Those are considered to be system accounts which are excluded in the GDM greeter too.


Hacky but you can modify the user's id so they don't show in the list:

sudo usermod -u 999 <username>

This works because users with id under 1000 are considered to be "system" users (i.e. not humans).

The only other way I know is to hide the list completely:

sudo -u gdm gconftool-2 --type bool --set /apps/gdm/simple-greeter/disable_user_list 'true'

Tags:

Gdm