chage详解:liunx账户密码过期时处理

公司安装elasticSearcher7.10.2版本时提示账户密码过期,可以做以下的处理方式:

一.查看账户的使用情况

chage -l baikang

[root@localhost ~]# chage -l baikang
Last password change                    : Oct 19, 2021
Password expires                    : Oct 29, 2021
Password inactive                    : never
Account expires                        : Oct 03, 2024
Minimum number of days between password change        : 5
Maximum number of days between password change        : 10
Number of days of warning before password expires    : 7

 

 二.调整账户及其密码永不过期

chage -M 99999 -E -1  baikang

[root@localhost ~]# chage -M 99999 -E -1  baikang
[root@localhost ~]# chage -l baikang
Last password change                    : Oct 19, 2021
Password expires                    : never
Password inactive                    : never
Account expires                        : never
Minimum number of days between password change        : 5
Maximum number of days between password change        : 99999
Number of days of warning before password expires    : 7

 

 三.详解chage常用命令

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

 

posted @ 2022-03-13 10:22  Mrwhite86  阅读(418)  评论(0)    收藏  举报