LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using Useradd (https://www.linuxquestions.org/questions/linux-newbie-8/using-useradd-300022/)

spud 03-10-2005 10:26 AM

Using Useradd
 
Is there a way to create a user and on the same command line give them a password

I thought it would be...
useradd USERNAME -p PASSWORD
but the user is unable to logon
Thanks

Technoslave 03-10-2005 10:32 AM

man useradd

It tells you about the -p option

spud 03-10-2005 10:38 AM

But does it mean you have to enter the encrypted password after the -p flag
And if so how

spud 03-10-2005 10:41 AM

Sorry just spotted a post further down.

Thanks

spud 03-10-2005 03:20 PM

Hi
Ive tried evrything i can think of to find the solution.
Can anybody tell me how i can achieve the following

useradd USERNAME -p PASSWORD

from what ive read the password has to be in MD5, is there a way this can be done. I have A LOT of users i have to add so the easiest solution would be appreciated.

Thanks

Tinkster 03-10-2005 03:44 PM

http://www.linuxquestions.org/questi...word+encrypted


Cheers,
Tink

jmercier 03-10-2005 03:50 PM

..
 
If you didnt want to use script just use:

Code:

useradd <username> -g <usergroup> -p `openssl passwd -crypt <clearpass>`


All times are GMT -5. The time now is 04:59 AM.