Skip to content

Instantly share code, notes, and snippets.

@andy722
Created January 28, 2020 19:44
Show Gist options
  • Save andy722/ca53f60d55c4a493a3d51a5b1b52fcfd to your computer and use it in GitHub Desktop.
Save andy722/ca53f60d55c4a493a3d51a5b1b52fcfd to your computer and use it in GitHub Desktop.
Determine which SSH public key was used for access
# /var/log/secure:
...
Jan 28 10:47:22 web01 sshd[17503]: Accepted publickey for <myuser> from <myip> port 56325 ssh2: RSA SHA256:<checksum>
...
# Compute fingerprints from authorized keys.
# Match w/ the one in `secure' log.
# ssh-keygen -lf ~myuser/.ssh/authorized_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment