User identifier
lastmod 2024-12-11created 2024-12-111 edits
The kernels of Unix-like (*nix) operating systems identify users with a positive integer called a user identifier (abbreviation: UID, User ID). The range of integers used for UIDs varies by system. At minimum, a UID is represented as a 15-bit integer (0 to 32767) with the following constraints.
- UID 0 is always the superuser.
- Traditionally, the nobody user is assigned the largest UID (32767 for a 15-bit integer).
- By convention, 1 through 100 are reserved for system use. Red Hat Enterprise Linux recommends reserving 101 through 499 for system use, and Debian up to 999.
The user corresponding to a UID can be found in /etc/password. The shadow password file and Network Information Service also refer to users by UID. UIDs are also used in Unix file systems and processes. Some operating systems support 16-bit UIDs, allowing 65,536 numbers to be used as UIDs. Modern operating systems that use 32-bit UIDs support 232 (= 4,294,967,296) UID values.
In POSIX-compatible environments, the id command-line program can be used to find a user's UID, username, primary group, group identifier, and so on.