$ sudo chage -l dory Last password change : Mar 15, 2020 Password expires : Jun 13, 2020 <== Password inactive : never Account expires : never Minimum number of days betweenpassword change : 10 Maximum number of days betweenpassword change : 90 Number of days ofwarningbeforepassword expires : 14
如果未应用密码时效,那么帐户信息将如下所示:
1 2 3 4 5 6 7 8
$ sudo chage -l nemo Last password change : Jan 14, 2019 Password expires : never <== Password inactive : never Account expires : Mar 26, 2706989 Minimum number of days betweenpassword change : 0 Maximum number of days betweenpassword change : 99999 Number of days ofwarningbeforepassword expires : 7
$ sudo chage -l dorothy Last password change : Jul 09, 2019 Password expires : never Password inactive : never Account expires : never Minimum number of days betweenpassword change : 0 Maximum number of days betweenpassword change : 99999 Number of days ofwarningbeforepassword expires : 7
$ sudo chage -M 90 -m 10 shark $ sudo chage -l shark Lastpassword change : Mar 16, 2020 Password expires : Jun 14, 2020 Password inactive : never Account expires : never Minimum number of days betweenpassword change : 10 <== Maximum number of days betweenpassword change : 90 <== Number of days of warning before password expires : 7
你还可以使用 -E 选项为帐户设置特定的到期日期。
1 2 3 4 5 6 7 8 9
$ sudo chage -E 2020-11-11 tadpole $ sudo chage -l tadpole Last password change : Oct 15, 2019 Password expires : never Password inactive : never Account expires : Nov 11, 2020 <== Minimum number of days betweenpassword change : 0 Maximum number of days betweenpassword change : 99999 Number of days ofwarningbeforepassword expires : 7