User accounts vs user IDs: login, lookup, and permissions

Once you've logged in, the numeric user ID of your running programs and system resources determines your programs' ability to access resources and perform operations, such as sending signals to other processes. Textual names are used only by utilities and applications that need to convert between names and numeric IDs.

Note: Changing user names, groups, user IDs, and so on in the account database has no effect on your permission to access files, etc. until you next log in.

The root user (user ID 0) has permission to do nearly anything to files, regardless of their ownership and permission settings. For more information, see File ownership and permissions in Working with Files.

Note: When the shell interprets a ~username pathname, it gets the user's home directory from /etc/passwd. If you remove or change a user's account, any shell running in the system that had previously accessed that user's home directory via ~username may be using the old home directory information to determine the actual path, because the shell caches the data.

New shells read the data afresh from /etc/passwd. This may be a problem if a shell script that uses ~username invokes another shell script that also uses this feature: the two scripts would operate on different paths if the home directory information associated with the user name has changed since the first shell looked the information up.