<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">The explanation seems to be that pam_tally2 records a failed login when login command is started, even before a password is entered. Normally, the failed logins counter is reset when the user enters the correct password.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">For login this works correctly when the following line is added in pam config (common-auth):</div><div class="gmail_extra"><br></div><div class="gmail_extra">auth  required  pam_tally2.so  file=/var/log/tallylog deny=5 even_deny_root unlock_time=1200 serialize</div><div class="gmail_extra"><br></div><div class="gmail_extra">However, when using sudo, the counter only gets reset when the following line is added to pam configuration (common-account):</div><div class="gmail_extra"><br></div><div class="gmail_extra">account        required        pam_tally2.so</div><div class="gmail_extra"><br></div><div class="gmail_extra">Why is the behaviour different for login and sudo?</div><div class="gmail_extra">Is this a bug?</div><div class="gmail_extra"><br></div><div class="gmail_extra">I think this is a bit confusing and it might be good to explain it in more detail on the man page (and the examples section).</div><div><br></div><div>marko</div></div></div>