The Perfect Server CentOS 5.4 fail2ban

Discussion in 'HOWTO-Related Questions' started by Hagforce, Jan 28, 2010.

  1. Hagforce

    Hagforce New Member

    Hello

    I`m trying out ISPConfig 3, after running ISPConfig 2 for some years.
    When installing I used Falcos TPS guide for CentOS 5.4

    When trying to access fail2ban log in ISPConfig I get this message "fail2ban is not installed at this server."

    I have verified that fail2ban is running ( /etc/init.d/fail2ban status
    Fail2ban (pid 30663) is running...).

    What might be the problem?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    I've added this to our bugtracker, so we'll check that.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Please run these commands on your system as root user:

    Code:
    PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin
    . /etc/profile
    which fail2ban

    and post the output. The fail2ban binary has to be installed within the path above. If you installed it in another path, create a symlink.

    Also make sure that your fail2ban is working properly and writes its log file to /var/log/fail2ban.log which is the default location for all redhat based systems.
     
    Last edited: Jan 29, 2010
  4. Hagforce

    Hagforce New Member

    Code:
    /usr/bin/which: no fail2ban in (/usr/kerberos/sbin:/usr/kerberos/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin)
    Fail2ban is installed via yum.

    Notting was written in the fail2ban log.
    I enabled a few rules and tested.
    After the log file was populated it works.

    But when I added pure-ftpd to fail2ban, it won`t start.

    I added this in jail.conf
    Code:
    [pure-ftpd]
    
    enabled  = true
    port     = ftp
    filter   = pure-ftpd
    logpath  = /var/log/messages
    maxretry = 3
    The pure-ftpd.conf file was already in filter.d directory.
    And it seems fine
    Code:
    # Fail2Ban configuration file
    #
    # Author: Cyril Jaquier
    # Modified: Yaroslav Halchenko for pure-ftpd
    #
    # $Revision: 3$
    #
    
    [Definition]
    
    # Error message specified in multiple languages
    __errmsg = (?:Authentication failed for user|Erreur d'authentification pour l'utilisateur)
    
    #
    # Option: failregex
    # Notes.: regex to match the password failures messages in the logfile. The
    #         host must be matched by a group named "host". The tag "<HOST>" can
    #         be used for standard IP/hostname matching and is only an alias for
    #         (?:::f{4,6}:)?(?P<host>\S+)
    # Values: TEXT
    #
    failregex = pure-ftpd(?:\[\d+\])?: (.+?@<HOST>) \[WARNING\] %(__errmsg)s \[.+\]$
    
    # Option:  ignoreregex
    # Notes.:  regex to ignore. If this regex matches, the line is ignored.
    # Values:  TEXT
    #
    ignoreregex =
    
    Any idea why it won`t start after adding pure-ftpd to jail.conf?
     
  5. Hagforce

    Hagforce New Member

    Any ideas here? Plz. :p
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Search the location of the fail2ban binary on your system and the make a symlink to it in one off the directories that belong to the system path.
     
  7. driverdave

    driverdave New Member

    fail2ban is not installed at this server.

    having this problem with centos 5.5 64 bit & ispconfig 3.0.3.1

    followed the perfect server guide for this setup and ispconfig 3

    looks like fail2ban binary is not in my path.

    [[email protected] memcache-2.2.6]# which fail2ban-client
    /usr/bin/fail2ban-client

    [[email protected] memcache-2.2.6]# which fail2ban
    /usr/bin/which: no fail2ban in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

    my problem is, i don't know what the "fail2ban binary" is.

    is it one of the files below?

    /usr/bin/fail2ban-client
    /usr/bin/fail2ban-regex
    /usr/bin/fail2ban-server

    thanks in advance for any help with this.
     
  8. jerry1091

    jerry1091 New Member

    CentOS release 5.6 (Final)


    This worked for me:

    Code:
    ln -s /usr/bin/fail2ban-client /usr/bin/fail2ban
     

Share This Page