Created
April 30, 2016 08:57
-
-
Save rahul286/3291e376bc1fd6da9e7ac3dd6b58fcc1 to your computer and use it in GitHub Desktop.
fingerprint all authorized_keys
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
## direct/one-time | |
while read l; do | |
[[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l; | |
done < .ssh/authorized_keys | |
## add into .bashrc | |
function fingerprints() { | |
local file="$1" | |
while read l; do | |
[[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l | |
done < $file | |
} | |
## call | |
fingerprints .ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment