Des bots scannent et attaquent votre SSH 24/7 — Fail2ban bannit automatiquement les IP qui échouent trop de connexions.
Installation
apt install -y fail2ban
systemctl enable --now fail2ban
Configuration SSH
nano /etc/fail2ban/jail.local
[sshd]
enabled = true
port = ssh
maxretry = 5
bantime = 1h
findtime = 10m
systemctl restart fail2ban
5 échecs en 10 min → banni 1 heure.
Vérifier les bannis
fail2ban-client status sshd
Débannir une IP : fail2ban-client set sshd unbanip 1.2.3.4











