Last active
September 6, 2019 00:43
-
-
Save edendekker/fb38bbbbbb895daa2d878a4e9c0ca634 to your computer and use it in GitHub Desktop.
Delete google pam files that cause the machine to get locked out.
This file contains hidden or 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
#!/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