fail2ban是一款非常实用的安全软件,通过监视系统日志,设置错误登陆次数,可阻挡暴力密码攻击。

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

1.安装epel
yum install epel-release -y

2.安装fail2ban
yum install fail2ban -y

3.配置
cd /etc/fail2ban/
cp jail.conf jail.local
vim jail.local
[DEFAULT]
bantime = 3600
[sshd]
enabled = true

maxretry = 3

4.启动
systemctl start fail2ban
systemctl enable fail2ban

5.查看日志
fail2ban-client status

tailf /var/log/fail2ban.log

 

 

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄