Centos 安装fail2ban

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
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容