1. User File:/etc/passwd
[Root @ pinfun6 ~] # Cat/etc/passwdroot: x: 0: 0: root:/root: /bin/bash 1 2 3 4 5 6 7 | -- the default SHELL used by the user ||||| | -- the user's home directory | -- User finger information (comment information) | -- User Group ID (GID) | -- User ID (UID) | -- password placeholder (the password is saved in the/etc/shadow file) | -- User Name
Add USER command: useradd [option]... this file is operated by USERNAME.
The default/home/USERNAME directory of the new user is stored in the/etc/skel directory.
Ii. User Password File:/etc/shadow
[Root @ pinfun6 ~] # Cat/etc/shadowroot: $1 $. TZS2yur $ uQ3.5XLbdEhLkak9HKqZx/: 16042: 0: 99999: 7: blank 1 2 3 4 5 6 7 8 9 |||||| -- reserved field, currently blank | -- User expiration date (Unit/day). This field specifies the number of days the user has expired (from January 1, to the present) | -- how many days after the password expires to disable this user | -- how many days in advance to warn that the user password will expire |||| -- twice the maximum number of days for password modification ||||-- the minimum interval between two password modifications |||-- the last password change time (Unit/day ), days from January 1, January 01, 1970 to the present | -- User Password (corresponding to the password placeholder in the/etc/passwd file), if the password is added "!"" Indicates disabling this user | -- User Name (corresponding to the user name in the/etc/passwd file) Note: when the values of fields 4, 5, 6, 7, and 8 are empty, the account can be used permanently.
Set User Password command: passwd [option]... USERNAME operation is this file.
3. User group file:/etc/group
[Root @ pinfun6 ~] # Cat/etc/grouproot: x: 0: root | -- Additional groups (multiple groups can be separated by commas (,) | -- group ID (GID) | -- group password placeholder | -- group name
Add group command: groupadd [option]... GROUPNAME
Ii. User Group file:/etc/gshadow
[Root @ pinfun6 ~] # Cat/etc/gshadowroot: blank: root | -- group members separated by commas | -- Group administrators separated by commas | -- encrypted password | -- group name