#!/bin/bash#fail2ban-0.8.14.tar.gz#python > 2.4v#user:roottar -zxf fail2ban-0.8.14.tar.gzcd /root/fail2ban-0.8.14/python setup.py install cp /root/ Fail2ban-0.8.14/files/redhat-initd /etc/init.d/fail2banchkconfig --add fail2bansleep 1rm -rf /root/fail2ban-0.8.14/rm -rf /root/fail2ban-0.8.14.tar.gz[ -f /etc/fail2ban /jail.bak ]if [ $? -eq 0 ];thenexit 0elsecp /etc/fail2ban/jail.conf /etc/fail2ban/jail.bakfised -i ' 96c enable = true ' /etc/fail2ban/ jail.confsed -i ' 100c logpath = /var/log/secure ' /etc/fail2ban/ jail.confsed -i ' 101c maxretry = 3 ' /etc/fail2ban/jail.confsed -i ' 101a\bantime = 3600 ' /etc/fail2ban/jail.confsed -i ' 101a\findtime = 300 ' /etc/fail2ban/jail.confsleep 1[ -f /var/log/secure.bak ]if [ $? -eq 0 ];thenexit 0elsecp /var/log/secure /var/log/secure.bakfi> /var/log/secure/etc/init.d/fail2ban start &>/dev/null
This article is from the "Ho Sun" blog, please be sure to keep this source http://heyangguang.blog.51cto.com/10930823/1894392
fail2ban-0.8.14 Shell Automatic deployment script