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.
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:
usermod -u 501 youruser
This changes the group ID of the youruser group to 501:
groupmod -g 501 youruser
The first command changes the ownership of files in your home directory. Fix the rest with:
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:
- Change
GID_MINandUID_MINto match the new range. - Check
/usr/share/lightdm/lightdm.conf.dfor 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:
- Unmount everything under
/media/youruser/. - Delete the folder:
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.