Fail2ban failed to start

Support for security such as Firewalls and securing linux
Post Reply
keema
Posts: 1
Joined: 2016/11/06 08:50:48

Fail2ban failed to start

Post by keema » 2016/11/06 09:21:17

hello
i just installed and configured fail2ban on new server "Centos7"
when i try to start the service using
fail2ban-client start
I got this response
ERROR Error in action definition $(action_mw)s
ERROR Errors in jail 'sshd'. Skipping...
so how to solve this
thanks in advance

mghe
Posts: 766
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: Fail2ban failed to start

Post by mghe » 2016/11/06 10:49:43

Check your banaction, choose right to iptables or firewallcmd

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Fail2ban failed to start

Post by lightman47 » 2016/11/06 15:25:01

You have config errors that need to be fixed according to your post. As mghe suggested, check your 'ban action' for your ssh jail in /etc/fail2ban/jail.local.

Unfortunately, I am just a 'beginner' to fail2 ban and documentation is POOR at best - but I have it running and banning. I found the "action" particularly UNCLEAR. I pounded my system until it started working. My (edited) SSH section looks like - personal settings replaced with inside/including the "{}" braces. Don't use the braces, and substitute YOUR settings:

Code: Select all

# SSH servers
#
[ssh-iptables]
enabled = true
filter = sshd
action   = iptables[name=SSH, port=ssh, protocol=tcp]
           sendmail-whois[name=SSH, dest={MyEmailAddress}, sender=fail2ban@example.com, sendername="Fail2Ban {myMachineName}"]

maxretry = 1
# 172800 = 48 hours
#bantime = 172800
bantime = 345600
logpath=/var/log/secure

If you want emails (as I do above) then the bottom of /etc/fail2ban/fail2ban.local

Code: Select all

[MAIL]
enabled = true
to = {MyEmailAddress}
Yes - I have mine really 'tight'.
If you're editing the actual ".conf" files, you shouldn't be (read the top - where it tells you to COPY to a '.local' file which you then edit). Not catastrophic, but if you want it to work right .. ;)

Hope this helps.
If you need something more diverse, I am no help to you but have seen posts here with more knowledge/experience than myself that tweak fail2ban to more specific settings.

Post Reply