How to unlock linux user after too many failed login attempts
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: City Beneath the Waves Looping
--
Chapters
00:00 How To Unlock Linux User After Too Many Failed Login Attempts
00:21 Accepted Answer Score 91
01:13 Answer 2 Score 15
01:56 Answer 3 Score 0
02:13 Thank you
--
Full question
https://superuser.com/questions/1597162/...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #useraccounts
#avk47
ACCEPTED ANSWER
Score 91
If you still have access to the system by another account
root or some other account with root-like (sudo?) privileges
- You can view the failed logins with
faillock# 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
- Reset them with the
--reset-flag# faillock --user myUsername --reset # faillock --user myUsername myUsername: When Type Source Valid
If you've found another way to access the file system
through a rescue disk or someone else's computer
Navigate to
/var/run/faillock(*), this folder should contain a file with the locked username# ls /var/run/faillock myUsername
Remove the file with the username to unlock
# rm /var/run/faillock/myUsername
* This is called 'tally directory' and its location depends on your system's configuration, which is likely to be found at /etc/security/faillock.conf
ANSWER 2
Score 15
"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).: https://forum.manjaro.org/t/how-to-remove-or-increase-password-attempts/47986/2?u=eduardolucioac ]
ANSWER 3
Score 0
By default tally log is present in /var/run/faillock. If it is configured in /etc/security/faillock.conf to write in different path, then use below command.
faillock --reset --user <user> --dir <tally dir path>