Hostxpeed
Login Get Started →
Security

How to Configure Fail2ban for SSH

4 min read
29 views
Jun 10, 2026

Step 1: Create Local Configuration

sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

Step 2: Edit SSH Settings

sudo nano /etc/fail2ban/jail.local

Find the [sshd] section and adjust:

[sshd]
enabled = true
maxretry = 3
bantime = 3600
findtime = 600

Step 3: Restart Fail2ban

sudo systemctl restart fail2ban

Step 4: Check New Settings

sudo fail2ban-client status sshd

Was this article helpful?