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: ssh-keygen -lf audits authorized_keys, a security check for forgotten keys

Security
~/tips/tip-security-ssh-keygen-lf-authorized-keys

ssh-keygen -lf ~/.ssh/authorized_keys

Lists the fingerprint and type of every key allowed to log in to an account.

An authorized_keys file grows over the years. I like to see what is in it before I trust it.

ssh-keygen -lf ~/.ssh/authorized_keys
sudo ssh-keygen -lf /root/.ssh/authorized_keys

-l prints the length, fingerprint, comment and type of every key in the file, one line each, even when the file holds many keys. Compare the fingerprints with ssh-keygen -lf ~/.ssh/id_ed25519.pub on your own machines to find keys nobody can explain.

The comment at the end is free text and can be edited by anyone, so judge by the fingerprint and use the comment only as a hint. Check the root account and service users as well as your own.

Further reading: ssh-keygen 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