Home page Forum

Go Back   MyServerZone » My Server Discussion » Server protection & Scripting » Protection

Reply
 
LinkBack Thread Tools Display Modes
Old 11-13-2008, 05:40 PM
Administrator
 
KING's Avatar
 
Join Date: Nov 2008
Posts: 23
Send a message via ICQ to KING Send a message via Yahoo to KING Send a message via Skype™ to KING
Default Debian Fail2Ban

Fail2Ban - tool to prevent bruteforce attacks to SSH, FTP, SMTP, Apache, etc.

Fail2ban have easy configuration and easy to install.

Lets start:

Command to install Fail2ban:

apt-get install fail2ban

Configuration files are located in:

cd /etc/fail2ban directory.


Find jail.conf file and open it:

pico /etc/fail2ban/jail.conf

Example if you want to enable this tool only on SSH find this line:

[ssh]

enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 5


and in if you want you can easy configure ban time,
and set option how much times same ip can fail to enter
correct password.

Find lines:

ignoreip = 127.0.0.1 192.168.0.99 there_should_be_your_ip
bantime = 600
maxretry = 3

I think configuration is really easy.
Save jail.conf file CTRL+X y

And restart Fail2Ban
/etc/init.d/fail2ban restart
Logs are located in:
pico /var/log/fail2ban.log

They should look like this example:

2008-06-10 05:35:25,680 fail2ban.actions: WARNING [ssh] Ban 203.177.104.**
2008-06-10 05:45:25,800 fail2ban.actions: WARNING [ssh] Unban 203.177.104.**
2008-06-10 11:31:54,170 fail2ban.actions: WARNING [ssh] Ban 216.133.248.**
2008-06-10 11:41:54,356 fail2ban.actions: WARNING [ssh] Unban 216.133.248.**


Have fun
KING is offline   Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:54 PM.