Article Title: describes advanced features of users, groups, and permissions. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Introduce UID and GID
1. Each User name has a corresponding User ID;
2. Each Group name also has a corresponding Group ID number;
3. The data of these numbers is stored on the disk in the form of numbers;
In fact, the above three points should be known through the previous chapter.
II. Introduction to the files of the/etc/passwd,/etc/shadow, and/etc/group storage verification materials
Verification information is stored in the following four files in a clear code:
1. the/etc/passwd file is the user's database.
2. the/etc/shadow file stores the User Password Database.
3. the/etc/group file is the database of the user group.
4./etc/gshadow (not used in this course, not considered for the moment)
Iii. Introduction to system accounts and system groups
1. cat/etc/passwd open the account database file. The UID and GID numbers of 1-499 are usually used by the built-in system users and system groups, these system users and system groups have control permissions for certain services or applications. For example, the apache account is for web Services and the lp account is for Printer services.
4. Change the password and switch between different users
1. You can use the passwd command to change the password. If an insecure password is set when the password is changed, it will be rejected by the computer, but the root account can set an Insecure Password, because the root account has the highest permissions, as shown in:
2. Use the passwd command to view the user's password status, for example:
3. describes how to use the su command to switch to another account.
For example, switch su user1 to user1. If you switch from the root account to another normal account, you do not need to enter a password. Note: You need to enter a password for switching between normal users.
When su-user1 switches to an account, A hyphen (-) is added in the middle to indicate that the current environment variable will change to the current environment variable of user1.
Su does not specify the account to switch to, it will switch to the root account
Su-added-and no account is specified. It also switches to the root account and loads the root environment variable.
[1] [2] [3] Next page