Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

As far as I know 2nd field of /etc/shadow is encrypted password of user. But some user e.g. daemon user have * in the field, in my environment(Ubuntu 12.04) root have ! in the field.

I assume ! means like "all password is invalid, you can not login with this user.". But I couldn't find document for it.

What does mean * and ! in shadow file?

share|improve this question
up vote 11 down vote accepted

'!' and '!!' mean essentially the same thing, but different tools use one or the other, passwd -l for instance, uses a pair of exclamation points. usermod -L on the other hand only uses one.

Usually, accounts with '*' never had a password (as in, have always been disabled for login). This is different to an account with no password hash entry at all, in which case no password is needed (and often won't even be prompted for) which is nearly always BAD!.

If it's an invalid hash (which all of '*', '!', and '!!' are) it effectively locks the account and prevents logins to that account. Often this is furthered by setting the account's shell to something like /bin/false or /sbin/nologin in the /etc/passwd file

You'll often find that if a user's account is locked after previously having a valid password set, that password hash has exclamation marks prefixed to it, this is so when the account is unlocked the password resumes working again.

share|improve this answer
Thanks for your detailed explanation. This is very helpful! – ironsand Jul 25 '13 at 4:01
no problem. One thing i forgot to mention (but did imply) is to be careful of locking account with passwd and trying to unlock it with usermod. It'll only remove the first '!', which won't work. – Sirex Jul 25 '13 at 4:56

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.