首页 > 代码库 > Linux用户密码期限修改

Linux用户密码期限修改

今天有开发报故,sftp无法登录。检查服务都是正常的,之前3月份也出现过此问题,当时忙没有注意,现在看每3个月出现问题。这才想到是密码过期导致的。

 

先重置用户密码,发现过期日志为Oct 08, 2017,有效期为90天。

[root@01 ~]# chage -l testuserLast password change     : Jul 10, 2017Password expires     : Oct 08, 2017Password inactive     : neverAccount expires     : neverMinimum number of days between password change     : 0Maximum number of days between password change     : 90Number of days of warning before password expires    : 10

 

修改密码为永不过期,修改后见红色标注

[root@01 ~]# chage -M 99999 testuser[root@01 ~]# chage -l testuserLast password change                    : Jul 10, 2017Password expires                    : neverPassword inactive                    : neverAccount expires                        : Oct 16, 2243Minimum number of days between password change        : 0Maximum number of days between password change        : 99999Number of days of warning before password expires    : 10

 

 参考

Linux账户密码过期安全策略设置 - 潇湘隐者 - 博客园
http://www.cnblogs.com/kerrycode/p/5600525.html

 

Linux用户密码期限修改