阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

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

170次阅读
没有评论

共计 1690 个字符,预计需要花费 5 分钟才能阅读完成。

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

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 监狱中移除。

如何列出被禁止的 IP

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

  1. # iptables -L
  2. Chain INPUT (policy ACCEPT)
  3. target prot opt source destination
  4. f2b-AccessForbidden tcp -- anywhere anywhere tcp dpt:http
  5. f2b-WPLogin tcp -- anywhere anywhere tcp dpt:http
  6. f2b-ConnLimit tcp -- anywhere anywhere tcp dpt:http
  7. f2b-ReqLimit tcp -- anywhere anywhere tcp dpt:http
  8. f2b-NoAuthFailures tcp -- anywhere anywhere tcp dpt:http
  9. f2b-SSH tcp -- anywhere anywhere tcp dpt:ssh
  10. f2b-php-url-open tcp -- anywhere anywhere tcp dpt:http
  11. f2b-nginx-http-auth tcp -- anywhere anywhere multiport dports http,https
  12. ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
  13. ACCEPT icmp -- anywhere anywhere
  14. ACCEPT all -- anywhere anywhere
  15. ACCEPT tcp -- anywhere anywhere tcp dpt:EtherNet/IP-1
  16. ACCEPT tcp -- anywhere anywhere tcp dpt:http
  17. REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
  18. Chain FORWARD (policy ACCEPT)
  19. target prot opt source destination
  20. REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
  21. Chain OUTPUT (policy ACCEPT)
  22. target prot opt source destination
  23. Chain f2b-NoAuthFailures(1 references)
  24. target prot opt source destination
  25. REJECT all --64.68.50.128 anywhere reject-with icmp-port-unreachable
  26. REJECT all --104.194.26.205 anywhere reject-with icmp-port-unreachable
  27. RETURN all -- anywhere anywhere

如何从 Fail2ban 中移除 IP

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

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


via: http://www.ehowstuff.com/how-to-remove-banned-ip-from-fail2ban-on-centos/

作者:skytech 译者:geekpi 校对:wxy

本文由 LCTT 原创编译,Linux 中国 荣誉推出

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2015-12/126033.htm

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-21发表,共计1690字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中