我已经在 CentOS 7 上安装了fail2ban并添加了jail.local:
[sshd]
enabled = true
当我尝试错误的 ssh 登录时,我会在 /var/log/secure 中收到如下日志条目:
Jun 5 11:09:40 arsenal sshd[32595]: Connection closed by 192.168.1.202 port 61745 [preauth]
但是,除非我将其设置为“调试”,否则fail2ban日志中不会出现任何内容:
2019-06-05 11:09:40,893 fail2ban.filtersystemd [32110]: DEBUG Read systemd journal entry: '2019-06-05T11:09:40.893324arsenal sshd[32595]: Connection closed by 192.168.1.202 port 61745 [preauth]'
即使我连续多次尝试这种错误的登录,它也不会阻止任何内容:
# fail2ban-client status sshd
Status for the jail: sshd
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- Journal matches: _SYSTEMD_UNIT=sshd.service + _COMM=sshd
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list: