This sounds like a bug but is likely completely cosmetic, so long as you stay with one tool or the other, just not both! If you take a look at the shadow man page (
man 5 shadow) it has this to say about the password field (On CentOS).
Refer to crypt(3) for details on how this string is interpreted.
If the password field contains some string that is not a valid result
of crypt(3), for instance ! or *, the user will not be able to use a
unix password to log in (but the user may log in the system by other
This field may be empty, in which case no passwords are required to
authenticate as the specified login name. However, some applications
which read the /etc/shadow file may decide not to permit any access
at all if the password field is empty.
A password field which starts with a exclamation mark means that the
password is locked. The remaining characters on the line represent
the password field before the password was locked.
This last paragraph would make the issue sound like it's an implementation bug in the
passwd command, since a single (
!) is all that is needed to lock a password.
One thing that bothered me with the above potentiality of this being a bug is that I can't imagine it would've persisted for this long. The other thing that bothered me with this is that in my
/etc/shadow file I have lines like the following:
So searching a bit more I did come across this article titled: Understanding /etc/shadow file. In the comment section of this article is the following bit:
lesca September 23, 2010 at 4:29 am
!! means user account has not been initialed or has not been locked.
! means group password is not available.
* means login disabled.
This last bit jogged my memory enough to remember that in the not too distant past there used to be group passwords as well as user passwords. You can read more about them in this blog post titled: Linux Set or Change User Password as well as the replaced functionality
gpasswd in this blog post titled: A group password in Linux.
At any rate I believe you have found a bug! The bug is in the