Created
August 28, 2018 23:50
-
-
Save gnanet/c3ecb9bf46c224af9ede59bb91f166ad to your computer and use it in GitHub Desktop.
One-Liner for split authorized_keys, generate a fingerprint for each public key with ssh-keygen
This file contains 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
cat authorized_keys | while read keyline; do if [ "$keyline" != "" ]; then keyname=$(echo $keyline | cut -d' ' -f 3); keytype=$(echo $keyline | cut -d' ' -f 1); echo $keyline > ${keytype}_${keyname}.pub; ssh-keygen -l -f ${keytype}_${keyname}.pub && rm ${keytype}_${keyname}.pub; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment