Install and enable fail2ban
1
2
sudo systemctl start fail2ban
sudo systemctl enable fail2ban
Edit the jails
1
sudo vim /etc/fail2ban/jail.local
Restart fail2ban
1
sudo systemctl restart fail2ban
Check status for all jails
sudo fail2ban-client status
Check status for a certain jail
sudo fail2ban-client status sshd
Un-ban a IP
sudo fail2ban-client set sshd unbanip XXX.XXX.XXX.XXX