Skip to content

Instantly share code, notes, and snippets.

@edendekker
Last active September 6, 2019 00:43
Show Gist options
  • Save edendekker/fb38bbbbbb895daa2d878a4e9c0ca634 to your computer and use it in GitHub Desktop.
Save edendekker/fb38bbbbbb895daa2d878a4e9c0ca634 to your computer and use it in GitHub Desktop.
Delete google pam files that cause the machine to get locked out.
#!/usr/bin/bash
# Add this to /etc/crontab
#
echo "Checking for bad config files..."
BAD_GOOGLE_PAM_FILE=/home/user/.google_authenticator~
HAS_BAD_GOOGLE_PAM_FILE=$(ls $BAD_GOOGLE_PAM_FILE|wc -w)
if [[ $HAS_BAD_GOOGLE_PAM_FILE -eq 1 ]]
then
sudo rm $BAD_GOOGLE_PAM_FILE
echo "Bad config found. Successfully removed."
else
echo "There is not a bad google pam file that will lock this machine out."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment