Frequently Asked Question

What is a UID, and why does Linux care more about it than about my username?

A UID is a user identifier, an unsigned integer that the kernel stamps onto every process, every open file, and every network socket on the system. When the kernel decides whether you may read a file or send a signal to a process, it compares UIDs; it never looks at usernames. Usernames are a convenience for humans, resolved through /etc/passwd (or LDAP, or SSSD) whenever a tool needs to print one.

That is why two accounts with different names but the same UID are, from the kernel's point of view, the same user, they own each other's files and can signal each other's processes. It is also why renaming a user with usermod -l does not touch any of their files: the UID on disk is unchanged. By convention, UID 0 is root, 1–999 are system accounts (daemons, the postgres user, the mail user), and 1000 upwards are ordinary humans. The special UID 65534 is nobody, traditionally used by NFS and sandboxes for unprivileged work.

Video

Further reading and video