等保测评

1建议该操作系统设置密码长度和复杂度要求(建议设置长度8位以上,由数字、大小写字母以及特殊符号组成),设置密码有效期(建议每90天更换一次密码)

 

vim /etc/pam.d/system-auth

 

 

在pam_pwquality.so模块后面加入密码的验证规则

minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1

 

设置密码有效期

vi  /etc/login.defs

 

PASS_MAX_DAYS   90

PASS_MIN_DAYS   0

PASS_MIN_LEN    8

PASS_WARN_AGE   15

 

 

 

2限制非法登录5次及失败后的锁定时间30分钟,

vim /etc/pam.d/sshd

auth       required     pam_tally2.so deny=5 unlock_time=1800 even_deny_root root_unlock_time=1800

 

登录超时时间15分钟

vim /etc/profile

export TMOUT=900

 

more /etc/profile|grep TMOUT

source /etc/profile

 

3新增审计管理员、安全管理员账户

adduser  audit  #审计管理员

passwd audit

audit

 

adduser  security  #安全管理员账户

passwd security

Kkkk@12345

 

 

 

 

 

visudo

root ALL=(ALL) ALL  #此处下面新增

security ALL=(ALL)      NOPASSWD:ALL

 

 

 

usermod -g root security

service sshd restart

 

4禁止root用户远程登录

sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config

 

more /etc/ssh/sshd_config|grep PermitR

 

5该操作系统未在/etc/hosts.allow或/etc/hosts.deny中限制终端的接入方式

sed -i '$a\sshd: 58.42.233.143/32   59.51.172.69/32'  /etc/hosts.allow&& sed -i '$a\sshd: ALL'  /etc/hosts.deny

 

 

#上面地址是你允许远程登录的地址

 

posted @ 2022-06-20 15:07  奋斗!奋斗!  阅读(468)  评论(0编辑  收藏  举报