Article Title: passwd and shadow files under etc. 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.
Before changing the File Permission, you must first know the owner and owner group information under the File Permission!
User Information ----/etc/passwd
User Password ---/etc/shawdow
User group information ---/etc/group
User Information and user passwords are opened separately. Of course, they are for security purposes!
[Contact two viewing commands:
Head-n/etc/passwd view the first n rows of passwd
Tail-n/etc/passwd view the last n rows of passwd
]
Tail-1/etc/passwd to view the last line
Sabayon: x: 86: 86: Sabayon user:/home/sabayon:/sbin/nologin
Separated by colons:
Username: Password (not displayed): UID (user number): GID (group number): Note: Home Directory: Login shell
The annotations can be ignored. I don't know much about the meaning, and I can't explain them clearly on the Internet, but I can ignore them. I hope some seniors can give some advice!
Login to shell this user sabayon set is not allowed to log on locally/sbin/nologin
Here, root is the user of the linux God, which can be compared as follows:
Root: x: 0: 0: root:/bin/bash
Tail-5/etc/shadow
Sabayon :!! : 14844: 0: 99999: 7 :::
Similarly, the colon is the dividing line and is divided into nine fields:
① User
② Password ,! Indicates that no password is set. $ indicates that the password is set.
③ The number of days the password was modified since January 1, January 1, 1970 (the first year of the computer)
④ How long will it take to change the password (0 indicates that the password can be changed at any time)
⑤ Password expiration time, that is, you must modify the password on that day, and the system forces you to modify the password. 99999 represents a long time, and it is estimated that the password will not expire in the lifetime!
⑥ Warning days of expiration time, reminding you to expire 7 days later
7. The password expires and the system automatically disables the number of days for the account.
Indicates the number of days that the account has been disabled
Slave with backup