When sudo Suddenly Ghosts You: A Quick Fix
Ever had sudo
suddenly refuse to work, even though you know you're typing the right password? That just happened to me, and the cause was surprisingly silly.
The Symptom
Every sudo
command kept responding with:
[sudo] password for user:
Sorry, try again.
[sudo] password for user:
Sorry, try again.
[sudo] password for user:
sudo: 3 incorrect password attempts
And yes, I was absolutely certain I was typing it correctly!
The Culprit
Turns out I had mindlessly hit enter
a few times during a yay -Syu
system upgrade (you know, the way you do when you're impatient 😅). Those extra enters got buffered and when yay
eventually asked for my sudo password, it interpreted those buffered enters as failed password attempts.
This triggered sudo
's built-in security feature that temporarily locks your account after too many failed attempts.
The Fix
Thankfully, the solution is super simple. Just run:
faillock --reset
And you're back in business! If that doesn't work, you might need to run it as root:
su root
faillock --reset --user your-username
Pro Tips
- You can check your current faillock status with:
faillock
- The default configuration for failed attempts is in
/etc/security/faillock.conf
- If you're frequently hitting this issue, you might want to adjust the
deny
andunlock_time
settings in that file
Comments