更新时间:2019-03-21 17:46:22浏览次数:1+次
1.设置密码修改最小间隔时间,限制密码更改过于频繁
在 /etc/login.defs 中将 PASS_MIN_DAYS 参数设置为5-14之间,建议为 :7
PASS_MIN_DAYS 7需同时执行命令为root用户设置:
chage --mindays 7 root
PASS_MAX_DAYS 90。需同时执行命令设置root密码失效时间:
chage --maxdays 90 root
LogLevel INFO修改后重启SSH服务生效,命令如下:
service sshd restart
MaxAuthTries 5修改后重启SSH服务生效,命令如下:
service sshd restart
ClientAliveInterval 900
ClientAliveCountMax 0
chown root:root /etc/passwd /etc/shadow /etc/group /etc/gshadow
chmod 0644 /etc/group
chmod 0644 /etc/passwd
chmod 0400 /etc/shadow
chmod 0400 /etc/gshadow
相关资讯