ssh-keygen
The OpenSSH tool for creating SSH keys and showing their fingerprints.
In more detail
ssh-keygen -lf authorized_keys prints the size, fingerprint, comment and type of each key in the file, which is how a sweep matches an attacker's key reliably. It can also generate new key pairs when credentials are rotated.
Related terms
- SSH key — A key pair used to log in over SSH: the private key stays on your machine and the public key is added to the server account.
- key fingerprint — A short hash of a public key, such as SHA256:abc..., that people can compare to confirm two keys are the same.
- authorized_keys — The file in a user's ~/.ssh directory listing the public keys allowed to log in to that account over SSH.
Taught in
- Containment & Eradication: Host, Net & Identity — Security Operations & Threat Hunting (SOC)
- Root Over SSH From Anywhere: Keys, sshd, setuid Files And Attributes — CompTIA Linux+ (XK0-006) Exam Prep