Fail2ban installation configuration
Rpm-Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Yum-y install fail2ban
Sed-I "50s#ignoreip = 127.0.0.1/8#ignoreip = 127.0.0.1 pound 8 113.108.131.85 Universe" / etc/fail2ban/jail.conf
Sed-I "59s#bantime = 600#bantime = 720" / etc/fail2ban/jail.conf
Sed-I "63s#findtime = 600#findtime = 8640 stories" / etc/fail2ban/jail.conf
Sed-I "129s/destemail = root@localhost/destemail = t891958201@126.com/" / etc/fail2ban/jail.conf
Sed-I "216a enabled = true" / etc/fail2ban/jail.conf
Sed-I "218a action = iptables [name=SSH, port=ssh, protocol=tcp]" / etc/fail2ban/jail.conf
Sed-I '219a sendmail-whois [name=SSH, dest=t891958201@126.com, sender=root@localhost, sendername= "Fail2Ban"]' / etc/fail2ban/jail.conf
Sed-I '220s# ^ # # / etc/fail2ban/jail.conf
Sed-I "220a bantime = 7200" / etc/fail2ban/jail.conf
Sed-I "221a findtime = 86400" / etc/fail2ban/jail.conf
Sed-I "222a maxretry = 5" / etc/fail2ban/jail.conf
Sed-I "230a enabled = true" / etc/fail2ban/jail.conf
Sed-I "232a action = iptables [name=ssh-ddos, port=ssh,sftp protocol=tcp,udp]" / etc/fail2ban/jail.conf
Sed-I '233a sendmail-whois [name=SSH, dest=t1934844044@126.com, sender=root@localhost, sendername= "Fail2Ban"]' / etc/fail2ban/jail.conf
Sed-I '234s# ^ # # / etc/fail2ban/jail.conf
Sed-I "234a bantime = 7200" / etc/fail2ban/jail.conf
Sed-I "235a findtime = 86400" / etc/fail2ban/jail.conf
Sed-I "236a maxretry = 5" / etc/fail2ban/jail.conf
Service fail2ban start