Skip to content

Instantly share code, notes, and snippets.

@vincentdavis
Created February 16, 2016 16:36
Show Gist options
  • Save vincentdavis/66adc666ba9c7871638d to your computer and use it in GitHub Desktop.
Save vincentdavis/66adc666ba9c7871638d to your computer and use it in GitHub Desktop.
List all user Authorized ssh keys
#!/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