fail2ban安装及配置

百度网盘地址:https://pan.baidu.com/s/1Ez7D_mAsQqDIto0fLe-ILg

提取码:6c7u

tar xf fail2ban-0.9.4.tar.gz

cd fail2ban-0.9.4

python setup.py install

cp redhat-initd /etc/init.d/fail2ban

/etc/init.d/fail2ban restart

cat /etc/fail2ban/jail.conf

[nginx]
enabled = true
port = http,https
filter = nginx
action = iptables[name=nginx, port=http, protocol=tcp]
sendmail-whois[name=tomcat, dest=zhanglei_mu@163.com]
logpath = /var/log/nginx/access.log
bantime = 60
findtime = 50
maxretry = 10

[root@nshop-web02 files]# cat /etc/fail2ban/filter.d/nginx.conf
[Definition]
failregex = <HOST> -.*- .*HTTP/1.* 200 .*$
ignoreregex =

转载自:https://www.cnblogs.com/bestOPS/p/10616401.html

 

posted @ 2019-08-23 17:37  Moooo  阅读(706)  评论(0编辑  收藏  举报