Well, when reading a book, I can't remember what the ID corresponds to, so ~~
User ID
1. User ID: the user ID in the logon entry of the password file is a numerical value, which identifies different users to the system. The system administrator determines the user ID while determining the login name of a user. Users cannot change their user IDs. Generally, each user has a unique user ID.
2. Group ID: the logon entry of the password file also includes the user's group ID, which is a numerical value. The Group ID is also allocated by the system administrator in the specified user login name. Generally, multiple record items in the password file have the same group ID. A group is used to assign several users to different project groups or departments. This mechanism allows all members in the same group to share resources before.
3. Additional group ID: In addition to specifying a group ID for a login name in the password file, Most UNIX system versions allow a user to belong to another group.
Process-related ID
There are 6 or more IDs related to a process, as described below:
Who are we actually: actual user ID, actual group ID
Used for file access permission check: valid user ID, valid group ID, and additional group ID
Saved by the exex function: Set the saved user and set group ID.
PS: I was confused by the two "saved" for a long time when I was reading this book, even if the book has such an explanation: the saved set user ID and the saved set group ID contain a copy of the valid user ID and valid group ID when executing a program. Fortunately, now we know that, by referencing chapter 8th, the saved user ID settings are obtained by exec copying a valid user ID. If a user ID is set for the file, the copy will be saved after exec sets a valid user ID for the process based on the user ID of the file. (That is, the valid ID of the file)