等保要求密码过期时间配置
新用户
编辑 /etc/login.defs
PASS_MAX_DAYS 90
PASS_MIN_DAYS 2
PASS_MIN_LEN 10
PASS_WARN_AGE 14
#PASS_MAX_DAYS 90 更改周期为90天
#PASS_MIN_DAYS 2 将两次改变密码之间相距的最小天数设为“最小天数”
#PASS_MIN_LEN 10 #密码最小长度
#PASS_WARN_AGE 14 将过期警告天数设为“警告天数”
注意: 配置之前的建的账号无效需要使用如下命令进行处理
chage -m 2 -M 90 -W 14 用户名
[root@m1 ~]# chage -h用法:chage [选项] 登录
选项: -d, --lastday 最近日期 将最近一次密码设置时间设为“最近日期” -E, --expiredate 过期日期 将帐户过期时间设为“过期日期” -h, --help 显示此帮助信息并推出 -I, --inactive INACITVE 过期 INACTIVE 天数后,设定密码为失效状态 -l, --list 显示帐户年龄信息 -m, --mindays 最小天数 将两次改变密码之间相距的最小天数设为“最小天数” -M, --maxdays MAX_DAYS set maximum number of days before password change to MAX_DAYS -R, --root CHROOT_DIR chroot 到的目录 -W, --warndays 警告天数 将过期警告天数设为“警告天数”
设置示例
[root@5017 light]# chage -m 2 -M 90 -W 14 root && chage -m 2 -M 90 -W 14 light[root@5017 light]# chage -l lightLast password change : Jun 29, 2023Password expires : Sep 27, 2023Password inactive : neverAccount expires : neverMinimum number of days between password change : 2Maximum number of days between password change : 90Number of days of warning before password expires : 14[root@5017 light]# chage -l rootLast password change : Jul 06, 2023Password expires : Oct 04, 2023Password inactive : neverAccount expires : neverMinimum number of days between password change : 2Maximum number of days between password change : 90Number of days of warning before password expires : 14

浙公网安备 33010602011771号