Linux installation using fail2ban method

  
                

Fail2ban is a very useful software, it can monitor the system log, can effectively prevent ssh from being violently cracked. The following small series will introduce the installation and use of Fail2ban under Linux. Let's take a look at it. Let's go.

block this IP access via iptables, tcp-wrapper, shorewall other ways.

Need Pytion support

python installation

python installation method:

cd /tmp

wget http://python.org /ftp/python/2.7.3/Python-2.7.3.tgz

tar xzf Python-2.7.3.tgz

cd Python-2.7.3

. /configure

make && make install

rm -rf /usr/bin/python

ln -s /tmp/Python-2.7.3/python /Usr/bin/

fail2ban installation

cd /tmp

wget https://github.com/downloads/fail2ban/fail2ban/fail2ban_0.8.6.orig.tar. Gz

tar xzf fail2ban_0.8.6.orig.tar.gz

cd fail2ban-fail2ban-a20d1f8/

. /setup.py install

cp files/RedHat-initd /etc/init.d/fail2ban

chmod 755 /etc/init.d/fail2ban

Configuring fail2ban logs Round robin:

vi /etc/logrotate.d/fail2ban

Write:

/var/log/fail2ban.log {

weekly< Br>

rotate 7

missingok

compress

postrotate

/etc/init.d/fail2ban restart 1》/dev/null

Copyright © Windows knowledge All Rights Reserved