Linux passwd command
Linux passwd command to change a user's password
grammar
passwd [-k] [-l] [-u [-f]] [-d] [-S] [username]
Necessary parameters:
- -d remove the password
- -f enforcement
- -k update can only be sent after the expiration
- -l stop using the account
- -S Display password information
- -u Enable account has been stopped
- -x Set Password Validity
- -g group password modification
- -i expired user account is stopped
Selection parameters:
- --help display help information
- --version display version information
Examples
Change password
# passwd w3cschool //设置w3cschool用户的密码 Enter new UNIX password: //输入新密码,输入的密码无回显 Retype new UNIX password: //确认密码 passwd: password updated successfully #
Display account password information
# passwd -S w3cschool w3cschool P 05/13/2010 0 99999 7 -1
Delete a user password
# passwd -d lx138 passwd: password expiry information changed.