ssh策略之fail2ban

yum -y install epel-release
yum -y install fail2ban

cp /etc/fail2ban/jail.conf /etc/fail2ban/local.conf
vim /etc/fail2ban/local.conf
在文末添加如下代码:

[ssh-iptables]
enabled = true
filter = sshd
action = iptables[name=SSH, port=22, protocol=tcp]
#sendmail-whois[name=SSH, dest=your@email.com, sender=fail2ban@email.com]
logpath = /var/log/secure
maxretry = 3
bantime = 300

尝试次数3,如果失败,300秒内禁止连接

参考自克己复礼,更多内容请点击这

上一篇:关于fail2ban防暴力破解总结


下一篇:品种邻近(寒假每日一题 10)