How do I unlock a user account and see failed logins with the faillog command?
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- pam_tally
- faillog
Issue
How do I unlock a user account and see failed logins with the faillog command?
Resolution
To unlock the account, execute the following command:
# faillog -u <username> -r
To see all failed login attempts after being enabled issue the command:
# faillog
You can also use pam_tally commands to do the same - to display the number of failed attempts:
# pam_tally --user <username>
And to reset the count:
# pam_tally --user <username> --reset[=n]
More details can be found on the pam_tally and faillog pages.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments