Homelab Cheat Sheet
Quick commands for Fail2Ban, SSH, logs, networking, and Docker basics.
Quick Navigation
Fail2Ban Commands
Overall Status
Check the main Fail2Ban status and list active jails.
sudo fail2ban-client status
Specific Jail Status
Show banned IPs, failed attempts, and jail settings.
sudo fail2ban-client status sshd
Unban All IPs
Remove all bans across all jails.
sudo fail2ban-client unban --all
Note: If unsupported, unban by jail with
fail2ban-client set <jail> unbanip <ip>.
Unban Specific IP (SSH)
Remove a single IP from the SSH jail.
sudo fail2ban-client set sshd unbanip IP_ADDRESS
Logs & Monitoring
Recent SSH Activity
View recent SSH logins, failures, and disconnects.
sudo journalctl -u ssh -n 20
Note: Some systems use
sshd instead of ssh.
sudo journalctl -u sshd -n 20
Fail2Ban Logs
Show recent Fail2Ban bans, unbans, and errors.
sudo journalctl -u fail2ban -n 50 --no-pager
Networking
Get Public IP
Useful for whitelisting or verifying outbound IP.
curl ifconfig.me
SSH Sessions
Who Is Logged In
See active users, IPs, and login times.
who
Docker Basics
List Running Containers
docker ps
List All Containers
docker ps -a
Stop a Container
docker stop container_name
Remove a Container
docker rm container_name
Remove Container + Anonymous Volumes
docker rm -v container_name
List Volumes
docker volume ls
Remove Unused Volumes
docker volume prune
Full Cleanup (Aggressive)
Removes stopped containers, unused images, networks, and volumes.
docker system prune -a --volumes
Inspect Container Mounts
Find where data is stored on the host.
docker inspect container_name
