Error installing Fail2Ban

Hi,

Not sure if this post goes here. I've trying to install Fail2Ban but for some reason I always get the same error. My Linode is a Centos 7 (a new Linode) and this is the output when I try to install Fail2Ban:

[root@localhost ~]# sudo service fail2ban restart
Redirecting to /bin/systemctl restart  fail2ban.service
Job for fail2ban.service failed. See 'systemctl status fail2ban.service' and 'journalctl -xn' for details.

--------------------------------------------------

[root@localhost ~]# systemctl status fail2ban.service
fail2ban.service - Fail2Ban Service
   Loaded: loaded (/usr/lib/systemd/system/fail2ban.service; disabled)
   Active: failed (Result: start-limit) since Mon 2015-02-16 21:40:09 UTC; 30s ago
     Docs: man:fail2ban(1)
  Process: 30270 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)

Feb 16 21:40:08 localhost.localdomain systemd[1]: Failed to start Fail2Ban Service.
Feb 16 21:40:08 localhost.localdomain systemd[1]: Unit fail2ban.service entered failed state.
Feb 16 21:40:09 localhost.localdomain systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Stopping Fail2Ban Service...
Feb 16 21:40:09 localhost.localdomain systemd[1]: Starting Fail2Ban Service...
Feb 16 21:40:09 localhost.localdomain systemd[1]: fail2ban.service start request repeated too quickly, refusing to start.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Failed to start Fail2Ban Service.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Unit fail2ban.service entered failed state.

--------------------------------------------------

[root@localhost ~]# journalctl -xn
-- Logs begin at Mon 2015-02-16 16:49:32 UTC, end at Mon 2015-02-16 21:40:09 UTC. --
Feb 16 21:40:08 localhost.localdomain fail2ban-client[30270]: 'enabled = true\n'
Feb 16 21:40:08 localhost.localdomain systemd[1]: fail2ban.service: control process exited, code=exited status=255
Feb 16 21:40:08 localhost.localdomain systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Unit fail2ban.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fail2ban.service has failed.
-- 
-- The result is failed.
Feb 16 21:40:08 localhost.localdomain systemd[1]: Unit fail2ban.service entered failed state.
Feb 16 21:40:09 localhost.localdomain systemd[1]: fail2ban.service holdoff time over, scheduling restart.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Stopping Fail2Ban Service...
-- Subject: Unit fail2ban.service has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fail2ban.service has begun shutting down.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Starting Fail2Ban Service...
-- Subject: Unit fail2ban.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fail2ban.service has begun starting up.
Feb 16 21:40:09 localhost.localdomain systemd[1]: fail2ban.service start request repeated too quickly, refusing to start.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Failed to start Fail2Ban Service.
-- Subject: Unit fail2ban.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit fail2ban.service has failed.
-- 
-- The result is failed.
Feb 16 21:40:09 localhost.localdomain systemd[1]: Unit fail2ban.service entered failed state.

Is there I'm doing wrong here? Thanks in advance!

3 Replies

Where are you installing fail2ban from? EPEL?

I know of one CentOS7 install where fail2ban from EPEL is working, but I wasn't the one to set it up so I don't know if any special fiddling was needed to make it start. I did have to manually fool with the bantime parameter.

It is weird, I tried all ways. Is there some final guide to install fail2ban in CentOS 7?

Try this:

setenforce 0
service fail2ban start

What is the result of that?

Note, this will turn off SELinux until the system is rebooted, you could/should switch it back on after via

setenforce 1

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct