Install fail2ban on CentOS 7

Rasho

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…

    sshd:

    Authentication Failures:
    root (103.41.124.21): 4842 Time(s)
    root (103.41.124.59): 4785 Time(s)
    root (62-210-172-56.rev.poneytelecom.eu): 3609 Time(s)
    root (222.73.7.32): 1275 Time(s)
    root (62-210-172-181.rev.poneytelecom.eu): 1143 Time(s)
    root (62-210-141-172.rev.poneytelecom.eu): 1113 Time(s)
    root (1.93.29.136): 805 Time(s)
    root (123.125.219.130): 391 Time(s)
    root (61.174.51.228): 348 Time(s)
    root (122.225.109.115): 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/fail2ban.pid -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.