Auditing Stale SSH Keys with ssh-keygen -l and Protecting with fail2ban
SSH keys that sit unused for months can become a silent backdoor if a private key ever gets compromised. On a production server the safest way to keep the key list lean is to audit it regularly and block any brute‑force attempts that surface while you’re cleaning up.
1. List all authorized keys with fingerprints
The authorized_keys file lives in each user’s ~/.ssh/. To see which keys are actually present, run: