1.更新源
yum update -y && yum install epel-release -y
2.下载fail2ban 并设置开机自启
yum install fail2ban -y
systemctl start fail2ban
systemctl enable fail2ban
3.配置fail2ban
vi /etc/fail2ban/jail.local
[sshd]
enabled = true
port = 22
filter = sshd
logpath = /var/log/auth.log
maxretry =5
systemctl restart fail2ban
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容