How to unlock linux user after too many failed login attempts

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: myUsername 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?

2 Answers

If you still have access to the system by another account (root or some other account with root-like (sudo?) privileges)

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

If you've found another way to access the file system (through 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/myUsername
1

"sudo" and "faillock" - How to handle "The account is locked due to X failed logins."

If you still have access with root-like privileges, you can view the failed logins...

faillock --user [USERNAME] 

... and/or reset attempts status...

faillock --user [USERNAME] --reset 

PLUS:

You can change the possible attempts number before a lock by uncommenting and changing the parameter...

# deny = 3 

... in the file...

vi /etc/security/faillock.conf 

Normally faillock automatically unlocks the account after 10 minutes (600 seconds), but you can change that too...

# unlock_time = 600 

[Ref(s).: ]

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like