Linux – How to unlock linux user after too many failed login attempts

linuxuser-accounts

After trying to login with the wrong password, my account is locked. When logging in on a TTY console I get the following message

mylaptop login: username
The account is locked due to 3 failed logins.
(10 minutes left to unlock)
Password: 

I am on Manjaro linux. I still have root access to this device.

How do unlock my user without waiting 10 minutes?

Best Answer

  1. Login as root
  2. You can view the failed logings with faillock
    root# faillock --user username
    username:
    When            Type     Source     Valid
    Timestamp 1     TTY      /dev/tty1  V
    Timestamp 2     TTY      /dev/tty1  V
    Timestamp 3     TTY      /dev/tty1  V
    
  3. Reset them with the --reset-flag
    root# faillock --user username --reset
    root# faillock --user username
    username:
    When            Type     Source     Valid
    

Or, if you've found a way to access the filesystem (logging as root, or though a rescue disk or something):

  1. Navigate to /run/faillock, this folder should contain a file with the locked username
  2. Remove the file with the username to unlock rm /run/faillock/username
Related Question