# Set Up Fail2ban – Protect SSH & Game Servers from Brute-Force

Install & configure Fail2ban: SSH jails, ban time, whitelist – brute-force protection on VPS and root servers.

**Quick answer:** Install Fail2ban with `apt install fail2ban` – the SSH jail is usually active immediately on Ubuntu/Debian and bans attackers after 5 failed attempts.

**If you landed here:** You see thousands of failed login attempts in logs or want additional SSH protection.

## Install

`apt update && apt install fail2ban -y
systemctl enable --now fail2ban
fail2ban-client status sshd`
## Basic config

`cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
# bantime = 1h, maxretry = 3 under [DEFAULT]
systemctl restart fail2ban`
## Related

- [Secure SSH](/en/root-v-server/ssh-absichern)
- [UFW firewall](/en/root-v-server/firewall-ports)
- [Set up VPS](/en/root-v-server/vps-einrichten)
*Products & ordering: [Root/VPS server](https://nexorahost.com/Dedicated-server) · Manage: [panel.nexorahost.de](https://panel.nexorahost.de) · [My account](https://nexorahost.com/account) · [nexorahost.com](https://nexorahost.com) (Frankfurt · 1 Tbit/s DDoS · 99.9% uptime)*
