Role: Modify user password
Format: passwd [options] [LOGIN]
Describe:
Ordinary users can only modify their own password, Superuser can modify the password of any account, can also change the validity of the relevant account password;
Superuser can not enter the password of the user to be modified;
Options:
-A,--All
Use with-S to show all user status
-D,--Delete
Delete User Password
-E,--expire
Disable the user's password immediately, forcing the user to modify the password at the next logon
-H,--Help
Display Help information and exit
-I,--inactive inactive
When the account expires inactive, users can no longer use the account login
-N,--mindays min_days
Password two times to modify the time at least interval min_days days, if Min_days is 0, it can be modified at any time
-S,--Status
Displays account status information, a total of 7 fields, namely login name, L (P or NP), last modified time, minimum age, maximum age, warning period, inactive period. The units of these ages are all days.
-W,--warndays warn_days
Warn Warn_days days before password expires
-X,--maxdays max_days
Set the maximum lifetime of a password
File:
/etc/passwd
User account information
/etc/shadow
Encrypt user account information
/etc/pam.d/passwd
Pam Configuration for passwd
Exit Value:
0: Success
1: Access Denied
2: Option binding is not valid
3: Unknown failure, nothing done
4: Unknown failure, passwd file missing
5:PASSWD file is occupied, try again
6: Option has invalid parameter
Example:
View all user Information
Sudo--status--all
Modify Current User Password
passwd