chage

    1. -m:密码可更改的最小天数。为零时代表任何时候都可以更改密码。
    2. -M:密码保持有效的最大天数。
    3. -w:用户密码到期前,提前收到警告信息的天数。
    4. -E:帐号到期的日期。过了这天,此帐号将不可用。
    5. -d:上一次更改的日期。
    6. -i:停滞时期。如果一个密码已过期这些天,那么此帐号将不可用。
    7. -l:例出当前的设置。由非特权用户来确定他们的密码或帐号何时过期

    查询用户密码过期时间

    1. [root@test-waf-ap01 ~]# cat /etc/passwd|grep boccfc
    2. boccfc:x:310:310::/home/boccfc:/bin/bash
    3. [root@test-waf-ap01 ~]#
    4. [root@test-waf-ap01 ~]# chage -l boccfc
    5. Last password change : Dec 09, 2020
    6. Password expires : Mar 09, 2021
    7. Password inactive : never
    8. Account expires : never
    9. Minimum number of days between password change : 0
    10. Maximum number of days between password change : 90
    11. Number of days of warning before password expires : 7
    12. [root@test-waf-ap01 ~]#
    1. [root@test-waf-ap01 ~]# chage -M 99999 boccfc
    2. [root@test-waf-ap01 ~]#
    3. [root@test-waf-ap01 ~]# chage -l boccfc
    4. Last password change : Dec 09, 2020
    5. Password expires : never
    6. Password inactive : never
    7. Account expires : never
    8. Minimum number of days between password change : 0
    9. Maximum number of days between password change : 99999
    10. Number of days of warning before password expires : 7
    11. [root@test-waf-ap01 ~]#