Skip to content

Instantly share code, notes, and snippets.

@eshleebien
Created February 26, 2020 02:59
Show Gist options
  • Save eshleebien/52d1569cfea4c013af082062b6f6c318 to your computer and use it in GitHub Desktop.
Save eshleebien/52d1569cfea4c013af082062b6f6c318 to your computer and use it in GitHub Desktop.
To check fingerprints of all users
#!/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