Skip to content

Instantly share code, notes, and snippets.

@epreston
Last active June 30, 2021 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epreston/5bf5609c37ca0bfdc447782a513d76e8 to your computer and use it in GitHub Desktop.
Save epreston/5bf5609c37ca0bfdc447782a513d76e8 to your computer and use it in GitHub Desktop.
create a quick audit of ssh public keys - name, strength, sha, type,
# Audit SSH Keys
OUTPUT_FILE="audit-$(date +"%FT%H%M%z").txt"
for file in *.pub
do
echo $file
echo -n "$file " >> $OUTPUT_FILE
ssh-keygen -l -f "$file" >> $OUTPUT_FILE
done
# DSA = Unsafe and even no longer supported since OpenSSH version 7.
# RSA = Concerning, see length. 3072 or 4096-bit length is ok.
# ECDSA = Trustworthiness concern on the NIST curves.
# Ed25519 = Recommended public-key algorithm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment