安装Fail2ban自动配置防 SSH 爆破

这段时间以来,服务器一直遭受着SSH暴力破解攻击,即便换了SSH端口,也会很容易被namp出来。有人建议我密钥登录,我觉得不是很方便,尤其是像我这种每天都换着手机用的人。于是和@ixh想了个这样的办法,用fail2ban来解决强行爆破SSH和WordPress后台密码的问题。 原理 Fail2ban会通过检查日志来匹配错误信息,从而使用iptables来防止暴力破解。理论上只要是能够在服务器本地输出错误日志和访问日志的程序都可以使用Fail2ban来保驾护航。 功能 一键安装部署 Fail2ban,自动配置防 SSH 爆破。可自定义 ip 封禁时间,最高重试次数。 安装 wget https://raw.githubusercontent.com/FunctionClub/Fail2ban/master/fail2ban.sh bash fail2ban.sh Welcome to Fail2ban! ——————– This Shell Script can protect your server from SSH attacks with the help of Fail2ban and iptables Do you want to change your SSH Port? [y/n]: y(你想改SSH端口吗?) Please input SSH port(Default: 22): 6666(这个随便写) Input the maximun … Continue reading 安装Fail2ban自动配置防 SSH 爆破