brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: fail2ban-client status sshd shows who is banned, a quick security check

Security
~/tips/tip-security-fail2ban-client-status-jail

sudo fail2ban-client status sshd

Shows the matches and banned addresses of a fail2ban jail, and how to lift a ban.

Fail2ban runs quietly, so I check from time to time that a jail really catches something.

sudo fail2ban-client status
sudo fail2ban-client status sshd
sudo fail2ban-client set sshd unbanip 203.0.113.7

The first command lists the active jails. The second shows, for one jail, how many log lines failed, how many bans happened in total and the list of currently banned addresses. A jail with zero matches on a public server is a hint that the log path or filter is wrong.

unbanip lifts a ban, which is useful when you lock yourself out. The jail name sshd is the default on Debian and Ubuntu, but your own jail names may differ.

Further reading: fail2ban-client manual page

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link