Disable userlist in GDM

Hi,

Has someone found a way to disable the userlist in GDM ? In our local school we’re currently using KDE from EPEL with SDDM. This display manager has the advantage that it disables the userlist automatically as soon as your system has more than something like half a dozen users.

SDDM seems to have a problem with NVidia drivers, so I’m considering replacing it with GDM. Unfortunately GDM is stubbornly displaying all users, and when you have more than a hundred, this becomes quite tedious to manage. There seems to be no option like display_users=0 in the GDM configuration file.

Cheers,

Niki

    - name: Ensure that GDM config dir exists (gdm 3.28 did not have it)
      ansible.builtin.file:
        path: /etc/dconf/db/gdm.d
        state: directory
        mode: '0755'

    - name: Hide users from GDM login screen
      ansible.builtin.copy:
        content: |
          [org/gnome/login-screen]
          # Do not show the user list
          disable-user-list=true
        dest: /etc/dconf/db/gdm.d/00-login-screen
      when:
      - dm_hide_users|bool
      notify:
      - dconf update

    - name: Add to dconf
      ansible.builtin.copy:
        content: |
          user-db:user
          system-db:gdm
          file-db:/usr/share/gdm/greeter-dconf-defaults
        dest: /etc/dconf/profile/gdm
# handler
  - name: dconf update
    command: dconf update

Alas, I cannot remember what/why my “Add to dconf” does/exists.


If we use LightDM with MATE, then:

    - name: Hide users from lightdm login screen
      ansible.builtin.copy:
        src: hide-users.conf
        dest: /etc/lightdm/lightdm.conf.d/hide-users.conf
      when:
      - dm_hide_users|bool

With hide-users.conf:

[Seat:*]
greeter-hide-users=true
1 Like

Create the file /etc/dconf/db/gdm.d/00-login-screen if does not exists.
Below is a sample from our labs

[org/gnome/login-screen]

Do not show the user list

disable-user-list=true
#Display the hostname as a banner message
banner-message-enable=true
banner-message-text=‘ws10’

1 Like

Thanks to you both ! That did the trick !