# /etc/shadow is foobar

## blarson

So I was adding a few users yesterday with useradd...  I think I used the -p flag to give them a default password.

Someone complains that they can't log on, so I try my user account, and it can't log on either.  Root is still ok (phew!)  so I go in and look at /etc/passwd... looks good.  /etc/shadow:  all the users have their password set to the default password, not encrypted at all.  WHAT DID I DO?!?

any reason why useradd would change the password for all users?  Maybe I should just add users by hand from now on.

----------

## DeKoder

you did a "-p cleartextpassword" :P the -p switch on "useradd" is followed by the *hashed* password, not a clear text one...which made its way into /etc/shadow when that file is supposed to contain the hashed passwords :)

So, i recommend you to useradd without the -p switch, and then do a `passwd username.just.created` and set the password! Or you could also use the output of crypt() function on a C program or perl script...it's up to you!

Cyaz

DeKoder

----------

