fail2ban安装配置

发布时间:2020-05-28 12:45:10 作者:yht_1990
来源:网络 阅读:560

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/8 113.108.131.85/24#" /etc/fail2ban/jail.conf

sed -i "59s#bantime  = 600#bantime  = 7200#" /etc/fail2ban/jail.conf

sed -i "63s#findtime  = 600#findtime  = 86400#" /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


推荐阅读:
  1. fail2ban 的安装配置
  2. 实战 fail2ban 安装

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

fain2ban 安全 加固 系统 ban

上一篇:SecureCRT修改配色方案

下一篇:PowerShell提示输入命令不是有效命令

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》