Problem
The maximum login attempt limit for a user has been set to five in
the Account Manager. The user failed to log in successfully within
five attempts and now their account is locked. As the Account
Administrator, when I issue the command:passwd -u <username>it does not remove the lock because it isn't an administrative lock. I know I can issue the command:
scoadmin account-username-login controls-unlock AccountHowever, is there a complete command line option that I can type to remove the lock from the user's account? I have tried editing the file:
/tcb/files/auth/[a-z]/<username]and manually resetting the variable:u_numunsuclog#[x]to:0but I am concerned about editing authentication database files because of the possibility of accidental corruption. Is there a better way to do this?
Solution
The user's login failure settings can also be checked using /etc/userls:
# userls -x "{maxLoginAttempts} {unsuccessfulLoginAttempts}" -l usernameIf the failures have exceeded the maxLoginAttempts, then the account can be unlocked by resetting unsuccessfulLoginAttempts to zero, using /etc/usermod:
# usermod -x "{unsuccessfulLoginAttempts 0}" userThe account should now be unlocked, if not then also reset the passwdSuccessfulChangeTime and administrativeLockApplied values to zero:
# usermod -x '{administrativeLockApplied 0}{passwdSuccessfulChangeTime 0} {unsuccessfulLoginAttempts 0}' usernameThe above command will clear the lock, but tell the user that their password has expired. It will then prompt them for the old one and ask if they want to choose a new password or have one picked for them.
Another option is:# usermod -x '{administrativeLockApplied 0} {unsuccessfulLoginAttempts 0}' usernameThis option will not tell the user their password has expired and will not make them choose a new one.
See also
man pages usermod(ADM), passwd(C)