set up failed Login attempts, now linux password doesnt work?
by affinity0g from LinuxQuestions.org on (#55NZ7)
I wanted to make it so that if 3 failed password attempts occur, the password cant be typed for at least 5-10minutes.
I did the following:
Add the following lines in the file /etc/pam.d/common-auth"
auth required pam_tally2.so onerr=fail deny=3 unlock_time=300 audit
auth required pam_tally2.so onerr=fail deny=3 unlock_time=300 audit even_deny_root root_unlock_time=600
source: https://www.linuxtechi.com/lock-user...ttempts-linux/
Then I tested it running a sudo apt-get install call, purposely made 3 incorrect password attempts. Now whenever I make a sudo call, it always says the password is incorrect. Even after I restart the computer and even after more than 10 minutes has passed. Locking the workspace/unlocking and logging into the desktop works but seems like any sudo call or even a passwd change wont work. It recognizes my password as incorrect now.
I cant even edit that file anymore to remove those lines as it requires sudo.
How can i Fix this?
Why did this happen?
Many thanks!


I did the following:
Add the following lines in the file /etc/pam.d/common-auth"
auth required pam_tally2.so onerr=fail deny=3 unlock_time=300 audit
auth required pam_tally2.so onerr=fail deny=3 unlock_time=300 audit even_deny_root root_unlock_time=600
source: https://www.linuxtechi.com/lock-user...ttempts-linux/
Then I tested it running a sudo apt-get install call, purposely made 3 incorrect password attempts. Now whenever I make a sudo call, it always says the password is incorrect. Even after I restart the computer and even after more than 10 minutes has passed. Locking the workspace/unlocking and logging into the desktop works but seems like any sudo call or even a passwd change wont work. It recognizes my password as incorrect now.
I cant even edit that file anymore to remove those lines as it requires sudo.
How can i Fix this?
Why did this happen?
Many thanks!