一,首先是服務(wù)安裝
#vim /etc/yum.repos.d/Centos-Base.repo
在最新新增
[atrpms]
name=Red Hat Enterprise Linux $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
然后再yum裝即可.
#yum -y install fail2ban
安裝完的目錄
#/etc/fail2ban
1.?????? 安裝
2.?????? yum install fail2ban logwatch gamin
3.?????? 相關(guān)文件說明
a)???????? 安裝完成后配置文件在目錄/etc/fail2ban/中:
b)??????? /etc/fail2ban/fail2ban.conf ?#fail2ban的配置文件
c)???????? /etc/fail2ban/jail.conf #阻擋設(shè)定文件
d)??????? /etc/fail2ban/filter.d/ #具體過濾規(guī)則文件目錄
e)???????? /etc/fail2ban/action.d/ #具體過濾規(guī)則檢測到后采取相對應(yīng)措施的目錄
4.?????? 根據(jù)需要的目的.在jail.conf文件中追回相關(guān)的內(nèi)容
5.???????

6.?????? action = iptables[name=nginx, port=http, protocal=tcp] ;
7.?????? 然后再創(chuàng)建/etc/fail2ban/filter.d/nginx.conf 文件.并添加相關(guān)的內(nèi)容.這個內(nèi)容可以復(fù)制之前的規(guī)則.
8.??? /etc/init.d/fail2ban restart 重啟下相關(guān)的程序
9.??? jail.conf的規(guī)則這個就不說了.按上面的抄就可以了.說明也在上面了.
10.但是nginx.conf怎么寫.這個用正則來寫就可以了.相關(guān)的規(guī)則這個就不多說了.
11.比如下面,我添加的一個dovecot.conf的規(guī)則文件.
12.???

13.?? localhost dovecot: auth-worker(.*): dict\((.*),<HOST>\): Password mismatch
http://rpmfind.net/linux/rpm2html/search.php?query=python-inotify
http://dl.fedoraproject.org/pub/epel/6/i386/