Fail2ban

Revision as of 10:22, 6 June 2014 by WikiFreak (talk | contribs) (Created page with " =Installation= <syntaxhighlight lang="bash"> apt-get install fail2ban </syntaxhighlight> =Set default configuration= Edit the configuration file <syntaxhighlight lang=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Installation

apt-get install fail2ban


Set default configuration

Edit the configuration file

vim /etc/fail2ban/jail.conf


Enable and adjust (~ line 24, ~ line 120):

  • Bantime
  • SSH port
  • SSH-DDOS


 
[DEFAULT]
ignoreip = 127.0.0.1/8
...
# "bantime" is the number of seconds that a host is banned.
bantime  = 3600

...

[ssh]
enabled  = true
#port     = ssh
port     = 2200
filter   = sshd
logpath  = /var/log/auth.log
maxretry = 4

...

[ssh-ddos]
enabled  = false
#port     = ssh
port     = 2200
filter   = sshd-ddos
logpath  = /var/log/auth.log
maxretry = 6