- fail2ban reads a service's log, catches refusals with a filter and bans the address through the firewall; the bundle "source → filter → action" is a jail.
- The source is set by
backend(systemd— the journald journal,logpath— a file), andjournalmatchnarrows the journal to the right unit. maxretry,findtimeandbantimeset the threshold, the window and the ban duration;ignoreipprotects your own addresses; the settings live injail.local.- The state is seen with
fail2ban-client status sshd, and the ban is a rule in nftables (nft list ruleset, thef2b-tabletable), see nftables rules. - At the start of the lesson the brute force was going on, and the jail showed 0 bans: it read another service's journal. You aimed it at
lab-sshd, and the ban appeared.
Step 7 of 7 · summary · 3 min
Summary
Found an inaccuracy? Report an error in the lesson