Security

Block brute-force attacks with Fail2ban

Automatically ban IP addresses that try to guess passwords. · 3 min read

apt -y install fail2ban
cat > /etc/fail2ban/jail.local <<'EOF'
[DEFAULT]
bantime  = 1h
findtime = 10m
maxretry = 5

[sshd]
enabled = true
EOF
systemctl enable --now fail2ban
fail2ban-client status sshd

Unban an address:

fail2ban-client set sshd unbanip 203.0.113.10
Order a server built by real engineers or talk to our team — we are online 24/7. Support →

Security

All tutorials

Ready to launch your project?

Order a server built by real engineers or talk to our team — we are online 24/7.