您当前的位置:首页 > linux教程

如何在 CentOS 6/7 上移除被 Fail2ban 禁止的 IP

Io2linux系统宝典

fail2ban 是一款用于保护你的服务器免于暴力攻击的入侵保护软件。fail2ban 用 python 写成,并广泛用于很多服务器上。fail2ban 会扫描日志文件和 IP 黑名单来显示恶意软件、过多的密码失败尝试、web 服务器利用、wordpress 插件攻击和其他漏洞。如果你已经安装并使用了 fail2ban 来保护你的 web 服务器,你也许会想知道如何在 CentOS 6、CentOS 7、RHEL 6、RHEL 7 和 Oracle Linux 6/7 中找到被 fail2ban 阻止的 IP,或者你想将 ip 从 fail2ban 监狱中移除。Io2linux系统宝典

如何列出被禁止的 IP

要查看所有被禁止的 ip 地址,运行下面的命令:Io2linux系统宝典

# iptables -LChain INPUT (policy ACCEPT)target     prot opt source               destinationf2b-AccessForbidden  tcp  --  anywhere             anywhere            tcp dpt:httpf2b-WPLogin  tcp  --  anywhere             anywhere            tcp dpt:httpf2b-ConnLimit  tcp  --  anywhere             anywhere            tcp dpt:httpf2b-ReqLimit  tcp  --  anywhere             anywhere            tcp dpt:httpf2b-NoAuthFailures  tcp  --  anywhere             anywhere            tcp dpt:httpf2b-SSH    tcp  --  anywhere             anywhere            tcp dpt:sshf2b-php-url-open  tcp  --  anywhere             anywhere            tcp dpt:httpf2b-nginx-http-auth  tcp  --  anywhere             anywhere            multiport dports http,httpsACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHEDACCEPT     icmp --  anywhere             anywhereACCEPT     all  --  anywhere             anywhereACCEPT     tcp  --  anywhere             anywhere            tcp dpt:EtherNet/IP-1ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:httpREJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibitedChain FORWARD (policy ACCEPT)target     prot opt source               destinationREJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibitedChain OUTPUT (policy ACCEPT)target     prot opt source               destinationChain f2b-NoAuthFailures (1 references)target     prot opt source               destinationREJECT     all  --  64.68.50.128         anywhere            reject-with icmp-port-unreachableREJECT     all  --  104.194.26.205       anywhere            reject-with icmp-port-unreachableRETURN     all  --  anywhere             anywhere

如何从 Fail2ban 中移除 IP

# iptables -D f2b-NoAuthFailures -s banned_ip -j REJECT

我希望这篇教程可以给你在 CentOS 6、CentOS 7、RHEL 6、RHEL 7 和 Oracle Linux 6/7 中移除被禁止的 ip 一些指导。Io2linux系统宝典


via: http://www.ehowstuff.com/how-to-remove-banned-ip-from-fail2ban-on-centos/Io2linux系统宝典

作者:skytech 译者:geekpi 校对:wxyIo2linux系统宝典

本文由 LCTT 原创编译,Linux中国 荣誉推出Io2linux系统宝典



沪ICP备10206494号-4