Created
February 16, 2016 16:36
-
-
Save vincentdavis/66adc666ba9c7871638d to your computer and use it in GitHub Desktop.
List all user Authorized ssh keys
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 | |
for X in $(cut -f6 -d ':' /etc/passwd |sort |uniq); do | |
if [ -s "${X}/.ssh/authorized_keys" ]; then | |
echo "### ${X}: " | |
cat "${X}/.ssh/authorized_keys" | |
echo "" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment