过等保本地机器配置记录

1、系统空闲超时时间设置
export TMOUT=30 #写入 /etc/profile 单位为s

2、用户登录失败处理能力
vi /etc/pam.d/system-auth
auth required pam_tally2.so onerr=fail deny=3 unlock_time=40 even_deny_root root_unlock_time=30
#以上策略表示:普通帐户和 root 的帐户登录连续 3 次失败,就统一锁定 40 秒, 40 秒后可以解锁

3、密码复杂度以及定期修改密码策略
vi /etc/pam.d/system-auth
password requisite pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type= minlen=8 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1 enforce_for_root
#retry=3 定义登录/修改密码失败时,可重试的次数 #minlen=8 密码最小长度为8个字符 #三个-1分别表示最少一个小字母、大字母、数字、符号

4、auditd规则配置
规则查看 auditctl -l
状态查看 auditctl -s
添加一条规则 auditctl -w 目录或文件 -p 规则 例如: auditctl -w /root -p wx #表示记录/root目录的写或者执行操作
删除一条规则 auditctl -W /root -p wx #只需把w换为W即可表示删除此条规则

5、tcpwrappers配置
工作流程: 优先匹配hosts.allow  匹配即停止 允许有限
                允许个别 拒绝所有  hosts.allow添加允许的策略 hosts.deny添加 ALL
                拒绝个别 允许所有  hosts.allow为空 hosts.deny添加单个策略
示例:      仅允许某一ip使用ssh登录  hosts.allow ——> sshd: 192.168.70.1 hosts.deny ——> sshd: ALL

posted @ 2023-02-22 10:12  ZANAN  阅读(34)  评论(1编辑  收藏  举报