在我的服务器中,ssh 端口不是标准的 22。我设置了不同的端口。如果我设置了fail2ban,它能检测到那个端口吗?我如何告诉它检查该端口而不是端口 22?
的输出iptables -L -v -n
:
Chain fail2ban-ssh (1 references)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * * 119.235.2.158 0.0.0.0/0
0 0 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
Chain fail2ban-ssh-ddos (0 references)
pkts bytes target prot opt in out source destination
Run Code Online (Sandbox Code Playgroud)
服务 iptables status 的输出:
iptables: unrecognized service
Run Code Online (Sandbox Code Playgroud)
总结fail2ban-regex /var/log/auth.log /etc/fail2ban/filter.d/sshd.conf
:
Summary
=======
Addresses found:
[1]
[2]
[3]
113.59.222.240 (Wed Mar 21 18:24:47 2012)
113.59.222.240 …
Run Code Online (Sandbox Code Playgroud)