Wednesday, July 1, 2015

Reset user password

pam_tally2 command to reset password.

pam_tally2 module is used to lock user accounts after number of failed ssh
login attempts to the system. This module keeps the count of attempted accesses
and the failed attempts.

By default, pam_tally2 module is already installed on the most of the Linux
systems and it is controlled by PAM package itself.

How to Lock and Unlock User Accounts

After you made more than 3 attempts you will get the following message.
# ssh jay@192.168.10.120
jay@192.168.10.120's password:
Permission denied, please try again.
jay@192.168.10.120's password:
Permission denied, please try again.
jay@192.168.10.120's password:
Account locked due to 4 failed logins
Account locked due to 5 failed logins

# pam_tally2 --user=jay

Login           Failures  Latest    failure     From
jay              5    04/22/13  21:22:37    192.168.10.2
How to reset or unlock the user account to enable access again.

# pam_tally2 --user=jay --reset


Verify login attempt is reset or unlocked
# pam_tally2 --user=jay
Login           Failures   Latest   failure     From
jay              0

No comments:

Post a Comment