Created
February 26, 2020 02:59
-
-
Save eshleebien/52d1569cfea4c013af082062b6f6c318 to your computer and use it in GitHub Desktop.
To check fingerprints of all users
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
#!/bin/bash | |
function fingerprints() { | |
local file="${1:-$HOME/.ssh/authorized_keys}" | |
echo $file | |
while read l; do | |
[[ -n $l && ${l###} = $l ]] && ssh-keygen -l -f /dev/stdin <<<$l | |
done < "${file}" | |
} | |
for d in /home/*/ ; do | |
fingerprints "$d.ssh/authorized_keys" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment