Home ServerFail2ban

fail2ban

sudo apt install fail2ban -y
sudo vim /etc/fail2ban/jail.local
[ssh]
enabled = true
port = 2222 # or ssh if you did not change the port
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600 # seconds = 1 hour
sudo systemctl restart fail2ban

Using the client

sudo fail2ban-client status
sudo fail2ban-client status sshd
sudo fail2ban-client set sshd unbanip 192.168.1.100