How to Restrict User List Display on Ubuntu 10.04 GDM Login Screen: A Terminal-Based Approach


30 views

In Ubuntu 10.04 (Lucid Lynx), the GNOME Display Manager (GDM) controls which users appear on the graphical login screen. The user list is generated automatically from system accounts, but administrators often need to restrict visible users for security or organizational purposes.

The primary configuration file controlling this behavior is /etc/gdm/gdm.conf or /etc/gdm/custom.conf. Here's how to modify it via terminal:

# First, make a backup
sudo cp /etc/gdm/gdm.conf /etc/gdm/gdm.conf.backup

# Edit the configuration
sudo nano /etc/gdm/gdm.conf

Locate the [greeter] section and add the following configuration:

[greeter]
IncludeAll=false
Include=user1,user2,user3

Replace user1,user2,user3 with your allowed usernames, separated by commas. This creates an explicit whitelist of users who will appear in the login screen.

If you prefer to hide specific users rather than whitelist them, use:

[greeter]
Exclude=unwanted_user1,unwanted_user2

After modifying the configuration, restart GDM to apply changes:

sudo /etc/init.d/gdm restart
# or alternatively
sudo service gdm restart

When managing this remotely via SSH, ensure you have a stable connection before restarting GDM. Consider using screen or tmux to maintain your session:

sudo apt-get install screen
screen
# Then proceed with edits and restarts

If users still appear after changes, check:

  • File permissions on gdm.conf (should be root:root)
  • Syntax errors in the configuration
  • Multiple configuration files (custom.conf may override gdm.conf)
# Verify file permissions
ls -l /etc/gdm/gdm.conf
# Should show: -rw-r--r-- 1 root root

Remember this only affects the graphical login. Hidden users can still:

  • Log in via console (Ctrl+Alt+F1-F6)
  • Use SSH if enabled
  • Be accessed via su or sudo

In Ubuntu 10.04 (Lucid Lynx), the GNOME Display Manager (GDM) controls which user accounts appear on the graphical login screen. By default, it shows all local users with valid login shells in /etc/passwd, but this behavior can be customized through configuration files.

The primary configuration file controlling this behavior is:

/etc/gdm/custom.conf

To restrict visible users, you'll need to modify the GDM configuration with these steps:

# Open the configuration file with sudo privileges
sudo nano /etc/gdm/custom.conf

# Add these lines under the [greeter] section
[greeter]
IncludeAll=false
Include=user1,user2,user3

For more complex scenarios, create a userlist file:

# Create a user list file
sudo nano /etc/gdm/userlist

# Add allowed users (one per line)
user1
user2
user3

# Then reference it in custom.conf
[greeter]
IncludeAll=false
IncludeFile=/etc/gdm/userlist

After making changes, restart GDM to apply them:

sudo service gdm restart

If users still appear, check:

# Verify file permissions
ls -l /etc/gdm/userlist

# Check for syntax errors
grep -v ^# /etc/gdm/custom.conf | grep -v ^$

Remember that this only hides users from the graphical login - hidden users can still:

  • Log in via console (Ctrl+Alt+F1-F6)
  • Use SSH if enabled
  • Be targeted with su or sudo