The passwd command changes passwords for user accounts. A normal user may only change the password for his/her own account,while the superuser may change the password for any account. passwd also changes the account or associated password validity period.
基本用法很简单 – 只需执行passwd命令即可使用任何选项/输入。
The user is first prompted for his/her old password,if one is present. This password isthen encrypted and compared against the stored password.The user has only one chance to enter the correct password. The superuser is permitted to bypass this step so that forgotten passwords may be changed.
After the password has been entered, password aging information is checked to see if the user is permitted to change the password at this time.Ifnot, passwd refuses to change the password and exits.
The user isthen prompted twice for a replacement password.The second entry is compared against the first and both are required to match in order for the password to be changed.
Then, the password is tested for complexity.As a general guideline, passwords should consist of 6 to 8 characters including one or more characters from each of the following sets:
· lower case alphabetics
· digits 0 thru 9
· punctuation marks
Care must be taken not to include the system default erase or kill characters. passwd will reject any password which isnot suitably complex.
Display account status information.The status information consists of 7 fields.The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days.