www.thorko.de Thorsten Kohlhepp - Systems administrator | Protect OpenSSH server

 

Protect your OpenSSH server from brute force attacks

install fail2ban

apt-get install fail2ban

in jail.conf

[ssh]
enabled = true
port    = ssh
filter  = sshd
logpath  = /var/log/auth.log
action = %(action_mw)s         # bans ip and sends an email to destemail address in default section
bantime = 1200                        # how long to ban the IP (20 minutes)
maxretry = 5                              # how many failed tries

start fail2ban

/etc/init.d/fail2ban start