sudo nvim /etc/ssh/sshd_config

Port 33322

sudo systemctl restart sshd


CentOS/RHEL/AlmaLinux

sudo dnf install fail2ban

Avvia e abilita all’avvio

sudo systemctl enable –now fail2ban

[DEFAULT] bantime = 1h findtime = 10m maxretry = 3 ignoreip = 127.0.0.1/8 ::1 93.35.140.145 banaction = firewallcmd-rich-rules # se usi firewalld

[sshd] enabled = true port = 33322 backend = systemd maxretry = 3 bantime = 1h findtime = 10m

sudo systemctl restart fail2ban sudo fail2ban-client status sshd