fail2ban
sudo apt install fail2ban -ysudo 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 hoursudo systemctl restart fail2banUsing the client
sudo fail2ban-client status
sudo fail2ban-client status sshd
sudo fail2ban-client set sshd unbanip 192.168.1.100