0

I was checking my password status and noticed that instead of NP or P there was a L returned so i checked the man pages and found it was a locked password could someone explain what this is to me?

1

From the passwd manual on an Ubuntu system:

-S, --status

Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). [...]

Getting L back from passwd --status hence means that the user's password has previously been locked with passwd --lock:

-l, --lock

Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ! at the beginning of the password).

Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970).

Users with a locked password are not allowed to change their password.

This means that an account with a locked password still has the old password associated with it, but in a disable form (it's invalid). The user may still log in through other means that do not involve using this password (e.g. through SSH with key authentication). If an administrator unlocks the password, the old password is then again usable for logins.

  • So basically it removes a password from the account? – Joe Jun 25 at 7:40
  • @Joe the password is usually still there (so you can unlock it later without having to set a password). This just prevents password-based login. – muru Jun 25 at 7:41
  • @Joe No, it invalidates it so that it can't be used. An administrator can then unlock the password so that the user may use it again. I have tried to clarified this in the answer now. – Kusalananda Jun 25 at 7:45
  • Thank you i believe i understand now – Joe Jun 25 at 7:51
0

From the manual page of passwd:

-S, --status

Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days.

L indicates the account is locked. If the other fields are blank, that implies that the account has no date of the last password change, minimum age, maximum age, et cetera.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.