Sie sind auf Seite 1von 2

Fail2ban installation

Reference: http://www.fail2ban.org/wiki/index.php/MANUAL_0_8

##Manual Installation

# Download Fail2ban from http://www.fail2ban.org/wiki/index.php/Downloads

cd /tmp
wget http://nchc.dl.sourceforge.net/sourceforge/fail2ban/fail2ban-0.8.1.tar.bz2

tar jxvf fail2ban-0.8.1.tar.bz2


rm -rf /tmp/fail2ban-0.8.1.tar.bz2
cd fail2ban-0.8.1

./setup.py install

cd /tmp/fail2ban-0.8.1/config

cp -a redhat-initd /etc/init.d/fail2ban

cd /etc/init.d/

chown root.root fail2ban

chmod 755 fail2ban

/sbin/chkconfig --add fail2ban

/sbin/chkconfig fail2ban on

cd /tmp/fail2ban-0.8.1/config

cp -a fail2ban.conf.shorewall fail2ban.conf.shorewall.orig

vi fail2ban.conf.shorewall

####
background = true

maxfailures = 3

####

cp -a fail2ban.conf.shorewall /etc/fail2ban.conf

cd /etc

chown root.root fail2ban.conf


chmod 644 fail2ban.conf

# Log rotation of Fail2ban Logs

cd /etc/logrotate.d

vi fail2ban

###
/var/log/fail2ban.log {
missingok
notifempty
copytruncate
}
###

chown root.root fail2ban


chmod 644 fail2ban

/etc/rc.d/init.d/fail2ban start

# Check fail2ban.log for any errors

tail -f /var/log/fail2ban.log

rm -rf /tmp/fail2ban-0.8.1

# Installation using yum ( Incomplete ..Yet to be tested)

yum install fail2ban

cp -a /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.conf.orig
cp -a /etc/fail2ban/action.d/shorewall.conf /etc/fail2ban/fail2ban.conf

vi /etc/fail2ban/fail2ban.conf

####
background = true

maxfailures = 3

####

/sbin/chkconfig fail2ban on

/etc/rc.d/init.d/fail2ban start