Skip to content

Server notes

Change your user ID below 1000 on Ubuntu 14.04

Changing a user ID below 1000 on Ubuntu is possible, but it touches file ownership, LightDM, and removable media. Here is the sequence that worked.

By Jozsef 2 min read

Log in as root in a command line session first (CTRL+ALT+F1). If the root user has no password, set one with sudo passwd root.

This command changes the user ID of youruser to 501:

bash
usermod -u 501 youruser

This changes the group ID of the youruser group to 501:

bash
groupmod -g 501 youruser

The first command changes the ownership of files in your home directory. Fix the rest with:

bash
chown youruser:yourgroup /home/youruser

Notes and issues

Cannot log in

After the change you may not be able to log in through LightDM. Two settings usually need attention:

  1. Change GID_MIN and UID_MIN to match the new range.
  2. Check /usr/share/lightdm/lightdm.conf.d for configuration files that should be adjusted for the login screen.

Cannot use USB mass storage

If USB sticks no longer mount automatically in Nautilus, remove the old media folder for the user:

  1. Unmount everything under /media/youruser/.
  2. Delete the folder:
    bash
    rmdir /media/youruser
    

Changing a UID is not a small edit. Take a backup, keep a root shell open, and test the login before you close the session.

Sources and further reading