Type POSIX requires the UID to be an
integer type. Most Unix-like operating systems represent the UID as an unsigned integer. The size of UID values varies amongst different systems; some UNIX OS's used 15-bit values, allowing values up to 32767, while others such as Linux (before version 2.4) supported
16-bit UIDs, making 65536 unique IDs possible. The majority of modern Unix-like systems (e.g., Solaris 2.0 in 1990, Linux 2.4 in 2001) have switched to
32-bit UIDs, allowing 4,294,967,296 (232) unique IDs.
Reserved ranges The
Linux Standard Base Core Specification specifies that UID values in the range 0 to 99 should be statically allocated by the system, and shall not be created by applications, while UIDs from 100 to 499 should be reserved for dynamic allocation by system administrators and post install scripts.
Debian Linux not only reserves the range 100–999 for dynamically allocated system users and groups, but also centrally and statically allocates users and groups in the range 60000-64999 and further reserves the range 65000–65533.
Systemd defines a number of special UID ranges, including • 60001-60513: UIDs for home directories managed by systemd-homed • 61184-65519 (0xef00-0xffef): UIDs for dynamic users On
FreeBSD, porters who need a UID for their package can pick a free one from the range 50 to 999 and then register the static allocation. Some POSIX systems allocate UIDs for new users starting from 500 (
macOS,
Red Hat Enterprise Linux till version 6), others start at 1000 (Red Hat Enterprise Linux since version 7,
openSUSE,
Debian • −1: The value (uid_t) -1 is reserved by POSIX to identify an omitted argument. • 65535: This value is still avoided because it was the API error return value when uid_t was 16 bits. • Nobody: Historically, the user "
nobody" was assigned UID -2 by several operating systems, although other values such as 215−1 = 32,767 are also in use, such as by
OpenBSD. For compatibility between 16-bit and 32-bit UIDs, many Linux distributions now set it to be 216−2 = 65,534; the Linux kernel defaults to returning this value when a 32-bit UID does not fit into the return value of the 16-bit system calls.
Fedora Linux assigns the last UID of the range statically allocated for system use (0–99) to nobody: 99, and calls 65534 instead nfsnobody. == Alternatives ==