As system administrator it is necessary to lock / unlock users or to reset failed login count.

let's look how we can perform lock / unlock users or to reset on UNIX/AIX


2 Answers 2

  • Fist become root:
      su - root
      lsuser -a unsuccessful_login_count userid 
  • reset unsuccessful login count:
      chsec -f /etc/security/lastlog -a unsuccessful_login_count=0 -s userid
  • unlock account:
      chuser account_locked=false userid
  • to lock an AIX account:
      chuser account_locked=true userid
  • check if locked:
      lsuser userid

For Linux like redhat distros

pam_tally2 --user=test1
pam_tally2 --user=test1 --reset

I would like to "improve" the answer, but I don't dare to edit it :-)

Just to say thanks for this, it works, but, when you put the userid: DO NOT PUT THEM IN <>.

It may be obvious, but it took me a few minutes to realize it, thanks to this post:Password Reset on AIX machine trouble


  • I made the necessary edits to the answer; you can therefore delete this post if you like.
    – AdminBee
    Sep 9, 2021 at 14:39
  • all right! thanks!
    – Pipo
    Sep 9, 2021 at 16:39

You must log in to answer this question.