Fail2ban SSH

Fail2ban SSH
Photo by Scott Webb / Unsplash
apt-get install fail2ban -y
 
cd /etc/fail2ban/
vi jail.local
[DEFAULT]
ignoreip = 127.0.0.1/8
 
#
# JAILS
#
 
#
# SSH servers
#
 
[sshd]
 
enabled = true
filter = sshd
port    = ssh
banaction = iptables-multiport
bantime = 3600
maxretry = 1
logpath = %(sshd_log)s
backend = %(sshd_backend)s
/etc/init.d/fail2ban restart

Done!