FL1GHT5 Lab • Privacy & Self-Hosting

Use Fail2ban to Protect SSH and Web Services

Who This Is For

Beginner. A simple security project with visible, understandable results.

Think of it like a bar bouncer who remembers faces. Get the password wrong too many times at the door, and you're not walking back in again for a while.

What You'll Build

SSH protected by a working Fail2ban jail that actually bans repeat offenders.

Prerequisites

Install Fail2ban

$sudo apt install fail2ban

Never Edit jail.conf Directly

That file gets overwritten on updates. Create your own override instead:

$sudo nano /etc/fail2ban/jail.local

Enable SSH Protection

$[sshd]
$enabled = true
$maxretry = 5
$findtime = 10m
$bantime = 1h

Understand the Key Settings

Add a Jail for Nginx

$[nginx-http-auth]
$enabled = true

View Active Bans

$sudo fail2ban-client status sshd

Test Without Locking Yourself Out

Test from a second machine or a network you're not currently connected through, not your own active session.

Security & Backup Notes

Troubleshooting

Lab Finish Line

SSH is protected by a working Fail2ban jail.

What to Build Next

Planning a business implementation?

Explore our infrastructure and systems services.

View services