Understanding the User ID

The UID field is a unique numeric identifier for the user. The range of UID numbers on most Unix systems is 0 to 65536. On Linux systems using the Linux 2.4 kernel, the range is 0 to 4294967295. Numbers below 100 are reserved for special system accounts, such as uucp, news, mail, and so on. By definition, the root account is UID 0. Other than these restrictions, you can select any available number in the valid range.

Every user account has a UID and at least one GID. Every file and process on a Linux system also has a UID and a GID. Matching UIDs determine ownership of files and processes. Matching GIDs determine group access to files and processes.

On an isolated system, files are only available to users of that system. But on a network, files are available between systems through file sharing. The most popular file-sharing technique on Unix and Linux systems is Network File System (NFS). NFS uses the same file security mechanisms as the Linux system—the UID and the GID—and can work only if the user IDs and group IDs assigned on the various systems on the network are coordinated. For example, if tyler was assigned UID 505 on crow, and daniel was assigned 505 on robin, a potential conflict could exist. Mounting a filesystem from crow on robin would give daniel ownership privileges to files that really belonged to tyler! Because of this, care must be taken to develop a plan for assigning user IDs and group IDs across every system on your network.

Note NFS and the issue of properly assigning user IDs and group IDs in an NFS environment are covered in Chapter 9, "File Sharing."

Was this article helpful?

0 0

Post a comment