Skip to content

Instantly share code, notes, and snippets.

Last active Aug 25, 2020
What would you like to do?
Given a base64 public SSH key, output fingerprint
#!/usr/bin/env bash
echo $1 | base64 -d | md5sum | sed 's/../&:/g;s/: .*$//;s/.*/MD5:&/'
echo $1 | base64 -d | sha256sum | xxd -r -p | base64 | sed 's/=*$//;s/.*/SHA256:&/'
Copy link

redmcg commented Aug 25, 2020

If you only have a private key, you can create the public key with:
ssh-keygen -y -f <private_key>

The SSHFP can also be seen with:
ssh-keygen -lf <public_key>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment