zoukankan      html  css  js  c++  java
  • Linux用户密码期限修改

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

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

    [root@01 ~]# chage -l testuser
    Last password change     : Jul 10, 2017
    Password expires     : Oct 08, 2017
    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    : 10

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

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

    如果账户设置过了过期时间,后面新加的用户都会受到这个设置的影响

    这个主要是由/etc/login.defs参数文件中的一些参数控制的的。它主要用于用户账号限制

    PASS_MAX_DAYS 90
    PASS_MIN_DAYS 0
    PASS_MIN_LEN 6
    PASS_WARN_AGE 10

     参考

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

  • 相关阅读:
    CF891E Lust
    Comet OJ 2019 夏季欢乐赛题解
    CF1098E Fedya the Potter
    CF1063F String Journey
    P4218 [CTSC2010]珠宝商
    AGC028 E
    51Nod 1584 加权约数和
    51Nod 1769 Clarke and math2
    Educational Codeforces Round 67
    斯特林数学习笔记
  • 原文地址:https://www.cnblogs.com/paul8339/p/7145788.html
Copyright © 2011-2022 走看看