大网数据广告活动
服务器运维问答

Why isn't Fail2ban regenerating its iptables chains?

· 52CE 我爱测

At some point while running iptables -S on an Ubuntu 18.04.2 LTS system with Fail2ban installed, I noticed that the following lines were missing: -N f2b-sshd -A f2b-sshd -j RETURN What command should I run to regenerate the f2b-s…

问题原文

原帖链接 · Chris Frederick · CC BY-SA 4.0

At some point while running iptables -S on an Ubuntu 18.04.2 LTS system with Fail2ban installed, I noticed that the following lines were missing:

-N f2b-sshd
-A f2b-sshd -j RETURN

What command should I run to regenerate the f2b-sshd chain and all the rules associated with it? I tried running fail2ban-client restart, but this doesn't appear to have any effect.

已采纳解答

原帖链接 · Chris Frederick · CC BY-SA 4.0

Given a banaction of iptables-multiport in /etc/fail2ban/jail.conf or /etc/fail2ban/jail.local, it looks like Fail2ban will automatically regenerate the f2b-sshd chain when it bans an IP address—but no earlier. If you'd like to test this for yourself, try running the following command to manually ban an address (like this one from TEST-NET-1):

# fail2ban-client -vvv set sshd banip 192.0.2.0

This behavior appears to be new in Fail2ban v0.10, which now creates chains on demand the first time an IP address is banned by an iptables action.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-03-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。