这是一个创建于 1084 天前的主题,其中的信息可能已经有所发展或是发生改变。
/etc/fail2ban/jail.local 内容如下:
```
[DEFAULT]
destemail = root
sender = root
mta = mail
action = %(action_mwl)s
```
/etc/fail2ban/action.d/mail-whois-lines.conf 中 actionstart 、actionstop 、actionban 均不为空,且都有 mail 命令
Ubuntu 系统,已安装 mail ,很奇怪的是,重启 fail2ban ,可以收到 stop 提醒,但是没有 start 提醒,且 /var/log/fail2ban.log 中有看到 ban 了 ip ,也没有 ban 提醒。
请问下给位,还有哪里配置不对导致的吗?
|
|
1
wnarutou 2021-11-02 22:55:21 +08:00
修正一下,刚才通过 systemctl restart 重启 fail2ban ,确定可以接收到 start 提醒,但是 ban 提醒确实没有
|
|
|
2
wnarutou 2021-11-03 21:51:02 +08:00
破案了,这期间我有修改系统的时区,从 UTC+0 时区修改到+8 区,而没有重启服务器,或者 rsyslog 服务,导致往 /var/log/auth.log 的日志记录的时间还是 UTC+0 的时间记录的,但是呢,fail2ban 是读取的 /var/log/auth.log 的日志以及其中时间来判断 ban 和 unban ,auth.log 中的时间比通过 date 得到的时间要晚 8 小时,所以总是没有被 ban 的 ip 。
至于最上面提到说 fail2ban.log 中有 ban 的 ip ,那是在修改时区之前已经被 ban 的。
|