Skip to content

Instantly share code, notes, and snippets.

@Swop
Created July 17, 2013 23:31
Show Gist options
  • Save Swop/6025495 to your computer and use it in GitHub Desktop.
Save Swop/6025495 to your computer and use it in GitHub Desktop.
Lists crontab and authorized keys for all the machine users (inline shell version: copy/paste into the terminal)
echo "===== CRONTAB ====="; \
for user in $(getent passwd | cut -f1 -d:); do \
echo -e "\n\n==> $user:" && echo "`crontab -u $user -l `"; done; \
echo "===== SSH_KEYS ====="; \
for user in $(getent passwd | cut -f1 -d:); do \
user_home=$(getent passwd | grep -E "^$user:" | cut -f6 -d:); \
if [ -e $user_home/.ssh ]; then \
if [ -e $user_home/.ssh/authorized_keys ]; then \
echo "----- $user :"; cat $user_home/.ssh/authorized_keys; \
fi; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment