|
命令描述:chage is used to list and change the password expiry information of auser.
查看用户的密码更改的相关信息:chage -l beyes
执行后出现如:
Minimum: 0
Maximum: 99999
Warning: 7
Inactive: -1
Last Change: 12月 12, 2008
Password Expires: Never
Password Inactive: Never
Account Expires: Never
|
变更用户密码最后的修改日期:chage -d 2008-12-14 beyes
指定用户至少在几天中才能变更密码(其实也是在修改 /etc/shadow 中的第4栏):chage -m 7 beyes //指定 beyes 的密码至少要用7天才能变更密码
要求用户更改密码的周期(/etc/shadow 中第 5 栏,值为99999为永远都可以不变更密码)chage -M 7 beyes //要求每隔7天就要变更一次密码
设置在密码过期几天后还没变更密码则锁定帐户(修改 /etc/shadow 中第 7 栏):change -I 3 beyes //3 天后 beyes 若还不变更密码则锁定帐户
设置帐号到期日期:(更改 /etc/shadow 的第 8 栏)chage -E 2009-01-01 beyes //指定在09年元旦时密码到期 |
|