Install fail2ban on CentOS 7


Linux System Administrator with over 8 years experience in administering production level servers (CentOS/Ubuntu/Debian with apache2/nginx, mysql server, etc)

You may also like...

5 Responses

  1. Chris says:

    what if you are using firewalld in CentOS 7 instead of iptables?

  2. Paul says:

    There’s a fail2ban-firewalld.noarch package in epel (at least in release 7-2) – it gets installed as a dependency when installing fail2ban.

    @rasho: There’s an easier way for installing epel itself (at least for CentOS):
    yum install epel-release.noarch

  3. dougwo says:

    I have installed this on to servers and it still will not ban anyone. I disabled firewalld and am running iptables. Does that matter? I get this kind of response from logwatch nightly…


    Authentication Failures:
    root ( 4842 Time(s)
    root ( 4785 Time(s)
    root ( 3609 Time(s)
    root ( 1275 Time(s)
    root ( 1143 Time(s)
    root ( 1113 Time(s)
    root ( 805 Time(s)
    root ( 391 Time(s)
    root ( 348 Time(s)
    root ( 286 Time(s)

    And I know fail2ban is running because I get this with ps -ax | grep fail2ban

    3242 ? S 0:00 /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/ -x

    What can I check to see why it isn’t working?

  4. jack says:

    nic ciekawego

  5. Orion Poplawski says:

    If you don’t enable any jails, fail2ban won’t do anything. All jails are disabled by default.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.