LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   useradd command (http://www.linuxquestions.org/questions/linux-general-1/useradd-command-501467/)

Linuxien 11-14-2006 06:44 AM

useradd command
 
Dear all,

I've got an issue with the useradd command. Well, I think it isn't really an issue but I need more details on it.
I create two users by two differents ways:
1/ useradd guest -p guest01
Following the man the password should be encrypted.
2/ useradd dave
passwd dave
Then, when I did a more /etc/shadow, I've got the two following lines :
guest:guest01:13466:0:99999:7:::
dave:$1$nPzRX924$WBlu2/2fG4OhAr7zZ.kra/:13466:0:99999:7:::

One seems to be encrypted and the other one not, but following the man and the arguement -p in the command useradd the one that should be encrypted should be guest and not dave, isn't it ?

The man of the argument -p said :
-p, --password PASSWORD
The encrypted password, as returned by crypt(3). The default is to disable the account.

Then, the problem is that I can't log in with the login guest like it was deactivated !!

Can you please help me to describe me what I did wrong and what is the right command to encrypt a pwd and leave it active ?

Many thanks in advance.

dxqcanada 11-14-2006 07:12 AM

I believe that the -p option expects the encrypted password ... and that it does not take a plain text password and encrypt it.


-p, --password PASSWORD
The encrypted password, as returned by crypt(3). The default is to
disable the account.

pixellany 11-14-2006 07:32 AM

Quick glance says that "adduser" might be better---eg it prompts you for a password.
Me lazy--always use GUI user manager.


All times are GMT -5. The time now is 07:06 PM.