Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used:

usermod -L myUser

to disable the password for this account. Assuming that I don't know the password how do I check that it has been disabled.

According to the man page it places ! in the front of the encrypted password, but I don't know how to check that either.

share|improve this question
up vote 14 down vote accepted

You can use the passwd utility to look at the status of the user's password entry

passwd -S user
user LK 2012-11-06 0 99999 7 -1 (Password locked.) (CentOS)
user L 01/22/2013 0 99999 7 -1 (Ubuntu)

The LK as well as the (Password Locked) text indicate a locked password entry on CentOS and L indicates a locked password entry on Ubuntu.

You can also use getent to read the shadow database

getent shadow user

or you can just look at the shadow file yourself

grep user /etc/shadow
share|improve this answer
What does the 'K' mean? No entry in the man page, and it is also not present here: I also do not get (Password locked) as indicated (just mentioned as a troubleshoot, it really isn't a problem) – DarkSheep Feb 11 '13 at 15:10
Sorry my mistake I was on a CentOS system when I ran the passwd command and it's obviously different from Ubuntu. On Ubuntu the meaning of L is locked, NP means no password and P indicate a usable password. Use the man command on the Ubuntu box - man passwd and look up -S – Iain Feb 11 '13 at 15:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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