安装failban组件:[root@localhost ~]# yum install fail2ban logwatch gamin 下面为安装过程截图
可能缺少的安装包下载地址http://rpmfind.net/linux/rpm2html/search.php?query=python-inotifyhttp://dl.fedoraproject.org/pub/epel/6/i386/
安装后在/etc/fail2ban 下面有相关的目录
编辑/etc/fail2ban/jail.conf 文件,屏蔽25、110、143端口设置:[root@localhost fail2ban]# vim /etc/fail2ban/jail.conf
复制一份/etc/fail2ban/filter.d/postfix.conf文件,并重命名为/etc/fail2ban/filter.d/umail.conf:#cp /etc/fail2ban/filter.d/postfix.conf /etc/fail2ban/filter.d/umail.conf
编辑/etc/fail2ban/filter.d/umail.conf文件:#vim /etc/fail2ban/filter.d/umail.conf加红框中这些(注意图示格式):localhost dovecot: auth-worker\((.*)\): dict\((.*),
重启failban服务,再观察:#/etc/init.d/fail2ban restart
设置成开机启动:(一般默认是开机启动)# chkconfig fail2ban on
果要加IP信任,如下格式(编辑vim /etc/fail2ban/jail.conf文件):ignoreip = 127.0.0.1/8 192.168.1.122 保存后重启服务。