VPS1Euro Dashboard Wiki

Complete client guide: infrastructure, services, account and support.

FR EN

Fail2Ban (protection against brute force attacks)

Automatically block IPs that attempt to authenticate repeatedly.

What this tutorial does

The tutorial "Fail2Ban (protection against brute force attacks)" helps you achieve this goal:

Automatically block IPs that attempt to authenticate repeatedly.

← Back to tutorials
1 profiles 11 steps 5 commands ~15 min

Debian/Ubuntu

  1. Install Fail2Ban: apt install -y fail2ban
  2. Copy configuration: cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
  3. Edit /etc/fail2ban/jail.local, section [DEFAULT]:
  4. bantime = 3600 (ban duration in seconds)
  5. findtime = 600 (detection window)
  6. maxretry = 5 (tentatives avant ban)
  7. Enable SSH protection in [sshd]: enabled = true
  8. Enable Apache protection in [apache-auth]: enabled = true
  9. Start Fail2Ban: systemctl enable --now fail2ban
  10. See banned IPs: fail2ban-client status sshd
  11. Unban an IP: fail2ban-client set sshd unbanip 1.2.3.4