Skip to content

Instantly share code, notes, and snippets.

@rahul286
Created April 30, 2016 08:57
Show Gist options
  • Save rahul286/3291e376bc1fd6da9e7ac3dd6b58fcc1 to your computer and use it in GitHub Desktop.
Save rahul286/3291e376bc1fd6da9e7ac3dd6b58fcc1 to your computer and use it in GitHub Desktop.
fingerprint all authorized_keys
## 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