Back to search

Fail2ban setup

wizard security

Install and configure Fail2ban for SSH brute-force protection

Required Packages

sudo apt install -y fail2ban

Steps

Step 1 of 6 17%
Show all steps

How long an IP is banned (e.g. 10m, 1h, 1d)

Time window to count failures

Port name or number (e.g. ssh, 22, 2222)

Generated Output

sudo apt install -y fail2ban && sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local && cat <<'EOF' | sudo tee /etc/fail2ban/jail.d/sshd.local [DEFAULT] bantime = 10m findtime = 10m maxretry = 5 [sshd] enabled = true port = ssh EOF && sudo systemctl enable --now fail2ban && sudo fail2ban-client status sshd