/Etc/passwd &/etc/shadow details 1. the passwd file is stored in the/etc directory. This file stores information about all user accounts, including the user name and password. Therefore, it is critical to the system. Run the following command to view the file: the cat/etc/passwdPasswd file consists of many records, each of which occupies one row and records all information of a user account. Each record consists of seven fields separated by the colon ":". The format is as follows: username: password: User ID: Group ID: comment: home directory: shell field Description: username uniquely identifies a user account, which is used when a user logs on. Password the password stored in the passwd file of this account is encrypted. The encryption algorithm in Linux is very strict, and the password is almost impossible to crack. Account theft usually uses special hacker program to construct countless passwords, and then uses the same encryption algorithm to encrypt them, and then compares them with this field. If they are the same, it indicates that the constructed password is correct. Therefore, we recommend that you do not use birthdays or frequently used words as passwords. They are almost vulnerable to hacking. Especially for systems directly connected to a large network, system security is particularly important. User ID, UID for short. In Linux, UID is used to identify the user rather than the user name. UID is an integer, and the user's UID is different from each other. Group ID User Group Identifier, GID for short. Different users can belong to the same user group and have the same permissions. Similar to UID, GID uniquely identifies a user group. Comment is an annotation for the user account. It is generally the user's real name, phone number, address, etc., of course, it can also be empty. The home directory belongs to this account. After a user logs on, it will be placed in this directory, just like returning home. Generally, the main directory of the root account is/root, and the home directories of other accounts are all under the/home directory, with the same name as the user name. Login command: The command that the user executes after logon generally starts a shell program. For example, after you log on to the bbs account, you can directly access the bbs system because the bbs account's login command points to the bbs program and runs these commands automatically when the system logs on to the bbs. The system account system also has some default accounts, such as daemon and bin. These accounts have special purposes and are generally used for system management. Most of the passwords of these accounts are expressed by (x), which means they cannot be used during logon. 2. To enhance system security, the shadow file can also provide MD5 and Shadow Security Password services for users in Linux. If the MD5 and Shadow services are selected on the related configuration options during Linux installation, no matter which user is the passwd in the/etc/passwd file, all are "x", which means these users cannot log on. the system actually stores the real password data in the/etc/shadow file. The/etc/shadow file can only be viewed as root. The reason for doing so is actually very simple. During system design, the/etc/passwd file can be read by anyone, then those who are interested can use this file and use a variety of tools to try out the user or even root password by encrypting the Linux Password, in this way, the entire system will be controlled by him, seriously endangering the security of the system and the confidentiality of user data. 3. The command pwconv generates/etc/shadow Based on the/etc/passwd file. It moves all passwords from/etc/passwd to/etc/shadow. Pwunconv tries its best to restore the information in/etc/shadow to/etc/passwd.