Last active
August 25, 2020 21:01
-
-
Save redmcg/d419b36e1280bd71a48c594f1666fcc9 to your computer and use it in GitHub Desktop.
Given a base64 public SSH key, output fingerprint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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:&/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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>