Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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
user:!$6$ic7iX.Q2$q9K5gi5pOb...TJlhAIoKVJfAybADtv80:15650:0:99999:7:::

or you can just look at the shadow file yourself

grep user /etc/shadow
user:!$6$ic7iX.Q2$q9K5gi5pOb...TJlhAIoKVJfAybADtv80:15650:0:99999:7:::
share|improve this answer
    
What does the 'K' mean? No entry in the man page, and it is also not present here: manpages.ubuntu.com/manpages/precise/en/man1/passwd.1.html. 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

 
discard

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.