/etc/shadow passwords not encrypted after new user creation

/etc/shadow passwords not encrypted after new user creation

Post by Jak » Wed, 28 Aug 2002 04:00:12



I have set up two new user on our SuSe Linux mailserver using the
useradd [username] -s /bin/false -p [password] command.  I add the
users to the virtusertable and execute the "make" command to compile
the virtusertable.db.  I test the new accounts by telneting to the
mailserver using USER [username} and PASS [password}  I get a "Bad
Login" message.  I went and checked the passwd file and an entry exist
for the new users but in the shadow file, their passwords are in
cleartext instead of being encrypted?  Help!  What can I do to get the
new logons to work?
 
 
 

/etc/shadow passwords not encrypted after new user creation

Post by Ian Northeas » Wed, 28 Aug 2002 04:31:13



> I have set up two new user on our SuSe Linux mailserver using the
> useradd [username] -s /bin/false -p [password] command.  I add the
> users to the virtusertable and execute the "make" command to compile
> the virtusertable.db.  I test the new accounts by telneting to the
> mailserver using USER [username} and PASS [password}  I get a "Bad
> Login" message.  I went and checked the passwd file and an entry exist
> for the new users but in the shadow file, their passwords are in
> cleartext instead of being encrypted?  Help!  What can I do to get the
> new logons to work?

useradd -p takes an already encrypted password. See the man page. If you
want to do that, encrypt it first.

Otherwise, do not use -p but set the password afterwards with passwd.

Regards, Ian

 
 
 

/etc/shadow passwords not encrypted after new user creation

Post by davide_sp.. » Wed, 28 Aug 2002 04:32:46



> for the new users but in the shadow file, their passwords are in
> cleartext instead of being encrypted?

That's normal. If you use useradd ... -p [password] the [password] is
used as password without being encrypted, it is supposed to be already
encrypted.

If you want, you can use -p `crypt [password]` to obtain the pass an encrypted
password, or you can use passwd username AFTER the creation to insert the
crypted password in /etc/shadow.

see man useradd for more info.

Davide

 
 
 

/etc/shadow passwords not encrypted after new user creation

Post by Wayne Polloc » Wed, 28 Aug 2002 10:44:38


A modern system using shadow passwords is unlikely to use (or have)
crypt.  More common is MD5 encryption.  Use "man openssl" to see how
to used this.  On my system I have this "one-liner" called md5crypt:

        echo "$1" |openssl passwd -1 -stdin

I have also found "pwgen" useful to generate good (but pronouncable)
passwords.

Hope this helps!

-Wayne



> > for the new users but in the shadow file, their passwords are in
> > cleartext instead of being encrypted?

> That's normal. If you use useradd ... -p [password] the [password] is
> used as password without being encrypted, it is supposed to be already
> encrypted.

> If you want, you can use -p `crypt [password]` to obtain the pass an encrypted
> password, or you can use passwd username AFTER the creation to insert the
> crypted password in /etc/shadow.

> see man useradd for more info.

> Davide