Tag: unlock

Linux denying user access after reseting password

Depending of how you configured your Linux server, the Pluggable Authentication Module (PAM) won’t let you login.

To check the login attempts to see if it needs to be reset type faillog -u <username>

root@linux:~ # faillog -u username
Username Failures Maximum Latest
<username>       15        0

Reset the counter with the -r flag

root@linux:~ # /usr/bin/faillog -r username
Username Failures Maximum Latest
<username>        0        0

If you’re root but is not managing to become a user with su, you also need to reset the login counter

root@linuxserver ~ # su – username
su: incorrect password

root@linux:~ # /sbin/pam_tally —-user username —-reset
User <username> (685) had 36

root@linux:~ # su – username
username@linux:~ $

For RHEL 6, it uses pam_tally2

root@rhel64:~ # /sbin/pam_tally2 —-user username —-reset
Login Failures Latest failure From
username 9 02/13/14 09:22:10 /dev/pts/1

root@rhel64:~ # /sbin/pam_tally2 —-user username —-reset
Login Failures Latest failure From
username 0