使用 Fail2Ban 防止服务器密码被暴力破解

安装

# yum install fail2ban

配置

配置文件路径

# vi /etc/fail2ban/jail.local

重启后生效

# systemctl restart fail2ban

验证程序启动

# fail2ban-client ping

查看日志

# tail -f /var/log/fail2ban.log

检查程序状态 (iptables)

# iptables --list -n

检查一个特定监狱的状态(ssh-iptables)

# fail2ban-client status ssh-iptables

解锁特定的 IP 地址

fail2ban-client set ssh-iptables unbanip [ip_address]

参考资料

评论