redhat5.x,6.x,7.x
centos5.x,6.x,7.x
suse9、10、11、12
加固要求 |
检查口令生存周 |
加固方法 |
在文件/etc/login.defs中设置 PASS_MAX_DAYS 不大于标准值,PASS_MAX_DAYS 90,如果该文件不存在,则创建并按照要求进行编辑。 |
检查方法 |
使用命令: cat /etc/login.defs |grep PASS_MAX_DAYS 结果中PASS_MAX_DAYS不大于90为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
所有的系统账户,口令长度应至少8位,并包括:数字、小写字母、大写字母和特殊符号4类中至少3类,配置须通过堡垒机实现,所有账户均应纳入堡垒机管理 |
加固方法 |
centos6.x系统: 修改/etc/pam.d/system-auth文件, 在ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 选3种,追加到password requisite pam_cracklib.so后面,添加到配置文件中。 centos7.x系统: 修改/etc/security/pwquality.conf 配置文件,将ucredit、 lcredit、dcredit、ocredit四个参数中至少任意三项的注释去掉并且将对应的值修改为“-1” Suse9: 修改/etc/pam.d/passwd文件, 在ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 选3种,追加到password requisite pam_cracklib.so后面,添加到配置文件中。 Suse10,Suse11: 修改/etc/pam.d/common-password文件, 在ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1 选3种,追加到password requisite pam_cracklib.so后面,添加到配置文件中。 例如:password requisite pam_cracklib.so ucredit=-1 lcredit=-1 dcredit=-1 注:ucredit:大写字母个数;lcredit:小写字母个数;dcredit:数字个数;ocredit:特殊字符个数。 |
检查方法 |
centos7.x、Redhat7 使用命令: cat /etc/security/pwquality.conf centos6.x、redhat版本使用命令: cat /etc/pam.d/system-auth Suse9操作系统使用命令: cat /etc/pam.d/passwd Suse10,Suse11操作系统: cat /etc/pam.d/common-password 结果中包含ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1中任意三种或以上为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
密码重复使用次数限制不超过5次 |
加固方法 |
centos/redhat: 运行 authconfig --help 查看相关帮助并配置 Suse9:编辑/etc/pam.d/passwd文件,修改设置如下 password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5 Suse10,Suse11,Suse12:编辑/etc/pam.d/common-password文件, 修改设置如下 password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5 |
检查方法 |
centos7.x、Redhat7 使用命令: cat /etc/security/pwquality.conf centos6.x、redhat版本使用命令: cat /etc/pam.d/system-auth Suse9操作系统使用命令: cat /etc/pam.d/passwd Suse10,Suse11,Suse12操作系统: cat /etc/pam.d/common-password 结果中包含ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1中任意三种或以上为符合 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
口令更改最小间隔天数大于30 |
加固方法 |
在文件/etc/login.defs中设置 PASS_MIN_DAYS 不小于标准值30。 |
检查方法 |
使用命令: cat /etc/login.defs |grep PASS_MIN_DAYS 结果中 PASS_MIN_DAYS 值不小于30为符合 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
检查口令最小长度 |
加固方法 |
在文件/etc/login.defs中设置 PASS_MIN_LEN 不小于标准值8。 |
检查方法 |
使用命令: cat /etc/login.defs |grep PASS_MIN_LEN 结果中PASS_MIN_LEN 结果不小于8即为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
超出规定时间进行账户退出操作,避免系统被恶意操纵 |
加固方法 |
以root账户执行,vi /etc/profile,增加 export TMOUT=600(单位:秒,可根据具体情况设定超时退出时间,要求不小于600秒),注销用户,再用该用户登录激活该功能。 |
检查方法 |
使用命令: cat /etc/profile |grep "export TMOUT" 结果中包含export TMOUT=600为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
远程登录时采用更加安全的SSH协议,并禁用telnet协议 |
加固方法 |
1. 对于使用IP协议进行远程维护的设备,应配置使用SSH协议: 在网站上免费获取OpenSSH http://www.openssh.com/,并根据安装文件说明执行安装步骤; 2. 对于使用IP协议进行远程维护的设备,应禁止使用telnet协议: 在/etc/services文件中,注释掉 telnet 23/tcp 一行(如不生效重启telnetd服务或xinetd服务或系统,例如,Red Hat 上重启xinetd:service xinetd restart,根据实际情况操作)。 |
检查方法 |
使用命令: service telnet status 结果中显示“telnet: 未被识别的服务”或者“telnet.service could not be found”为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
配置openssh安全选项,保证openssh安全 |
加固方法 |
1.确保/etc/ssh/sshd_config或/etc/ssh2/sshd2_config文件存在。如果不存在,则忽略下面配置步骤。 2.在sshd_config或sshd2_config中配置:Protocol 2。 3.在sshd_config或sshd2_config中配置:PermitRootLogin no或PermitRootLogin NO。 |
检查方法 |
使用命令:find / -name sshd_config 和 find / -name sshd2_config查找sshd_config、sshd2_config配置文件路径 使用命令 cat /etc/ssh/sshd_config |grep Protocol cat /etc/ssh/sshd_config |grep PermitRootLogin cat /etc/ssh/sshd2_config |grep Protocol cat /etc/ssh/sshd2_config |grep PermitRootLogin 查看Protocol 和PermitRootLogin参数对应的值 结果中sshd_config、sshd2_config文件中包含PermitRootLogin配置为no则符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
检查口令过期前警告天数不小于标准值30 |
加固方法 |
在文件/etc/login.defs中设置 PASS_WARN_AGE 不小于标准值30。 |
检查方法 |
使用命令: cat /etc/login.defs|grep PASS_WARN_AGE 结果中PASS_WARN_AGE值不小于30即为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
禁止系统有用户的口令为空 |
加固方法 |
按照密码设置策略设置非空密码 命令: passwd [OPTION...] <accountName> |
检查方法 |
使用命令: cat /etc/shadow 结果中不包含空口令的账户为符合。 centos6.5: centos7.7: redhat7: SUSE Linux Enterprise Server 11 SP4: SUSE 12 SP4: |
加固要求 |
配置屏幕超时自动锁定时间,超过规定时间无操作,屏幕自动锁定 |