Technical article 110161

I can't clear a lock on a user's account that was locked when they exceeded the maximum number of login attempts using the command 'passwd -u <username>'.

OpenServer 6.0.0OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

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 Account

However, 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:
0

but 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 username

If the failures have exceeded the maxLoginAttempts, then the account can be unlocked by resetting unsuccessfulLoginAttempts to zero, using /etc/usermod:

# usermod -x "{unsuccessfulLoginAttempts 0}" user

The 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}' username

The 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}' username

This 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)

From the Xinuos technical article database, record 110161. Reproduced with permission. The original is at www.sco.com/ta/110161, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.