Skip to content

Instantly share code, notes, and snippets.

@guerzon
Created November 14, 2018 01:23
Show Gist options
  • Save guerzon/8bbb09db5b48aea54173c70b7e4b104c to your computer and use it in GitHub Desktop.
Save guerzon/8bbb09db5b48aea54173c70b7e4b104c to your computer and use it in GitHub Desktop.
Reset pam module login counters
### On RHEL5 servers ###
1. Check the login failure count
pam_tally --user username
2. Reset the login failures
pam_tally --user username --reset
3. Retry logging in.
### On RHEL6 and RHEL7 servers ###
1. Check the login failure count
pam_tally2 --user username
2. Reset the login failures
pam_tally2 --user username --reset
3 Retry logging in.
### Important Notes ###
1. It is important to find out the root cause of login failures instead of resetting the login counter on a regular basis.
2. Usually, RHEL6 and RHEL7 servers in the environment should be able to automatically reset the counters after a specified amount of time, given that there are no more recent failed logins. This can be verified via the files below.
/etc/pam.d/login
/etc/pam.d/system-auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment