0

My Ubuntu server mail is working. I verified with this command below.

echo "Mail is working on this server." | mail -s subject <myemail@gmail.com>

In my entire jail.local

ex. intruder ip = 1.1.1.1

[sshd]
port       = 2222
destemail  = myemail@gmail.com
sendername = fail2ban
mta        = mail
action     = %(action_mwl)s
actionban  = curl -s https://www.app.com/ssh/ban?ip=1.1.1.1

IP seems to get banned when ssh with ban credentials attempt failed 5 times and I also got the email, but not sure why curl is not triggering to my api.

Am I missing anything ?


I've tried

[sshd]
port       = 2222
destemail  = myemail@gmail.com
sendername = fail2ban
mta        = mail
bantime    = 1m
maxretry   = 1
action     = %(action_mwl)s
banaction  = %(curlAction)s <<<< ADDED ⭐️

curlAction.conf

[Definition]
actionstart =
actionstop = 
actioncheck = 
actionban = curl -s https://www.app.com/ssh/ban?ip=1.1.1.1
actionunban = 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.