我的 Ubuntu 服务器邮件是在职的。我用下面的命令进行了验证。
echo "Mail is working on this server." | mail -s subject <[email protected]>
在我的整个jail.local
前任。入侵者ip=1.1.1.1
[sshd]
port = 2222
destemail = [email protected]
sendername = fail2ban
mta = mail
action = %(action_mwl)s
actionban = curl -s https://www.app.com/ssh/ban?ip=1.1.1.1
当使用禁止凭证的 ssh 尝试失败 5 次时,IP 似乎被禁止,我也收到了电子邮件,但不知道为什么curl 没有触发我的 api。
我错过了什么吗?
我试过了
[sshd]
port = 2222
destemail = [email protected]
sendername = fail2ban
mta = mail
bantime = 1m
maxretry = 1
action = %(action_mwl)s
banaction = %(curlAction)s <<<< ADDED ⭐️
卷曲操作.conf
[Definition]
actionstart =
actionstop =
actioncheck =
actionban = curl -s https://www.app.com/ssh/ban?ip=1.1.1.1
actionunban =