How to hide users from the GDM login screen?

I have recently added several new users, that I need for qmail. Now they appear in the box in the login screen and clutter it, and I have to scroll to find my user. How can I hide those users from the login box?


Solution 1:

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.

Solution 2:

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.