chage --修改帐号和密码的有效期限

 

 

修改帐号和密码的有效期限

 

 

# chage --help
Usage: chage [options] [LOGIN]

Options:
  -d, --lastday LAST_DAY        set date of last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS 
参数意思:
  -m 密码可更改的最小天数。为零时代表任何时候都可以更改密码。
  -M 密码保持有效的最大天数。
  -W 用户密码到期前,提前收到警告信息的天数。
  -E 帐号到期的日期。过了这天,此帐号将不可用。
  -d 上一次更改的日期
  -I 停滞时期。如果一个密码已过期这些天,那么此帐号将不可用。
  -l 例出当前的设置。由非特权用户来确定他们的密码或帐号何时过期。

 

   列出当前帐号过期信息:

#chage -l myuser
Last password change                                    : Aug 14, 2015
Password expires                                        : Nov 12, 2015
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 90
Number of days of warning before password expires       : 7

   修改密码过期时间:

    chage -M 180 cpe --密码过期周期最多180天

    chage -m 180 cpe--密码过期周期最少180天

 

   再查一下过期信息:

chage -l myuser
Last password change                                    : Aug 14, 2015
Password expires                                        : Feb 10, 2016
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 180
Maximum number of days between password change          : 180
Number of days of warning before password expires       : 7

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值