LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2005, 11:26 AM   #1
spud
LQ Newbie
 
Registered: Oct 2004
Posts: 19

Rep: Reputation: 0
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
 
Old 03-10-2005, 11:32 AM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
man useradd

It tells you about the -p option
 
Old 03-10-2005, 11:38 AM   #3
spud
LQ Newbie
 
Registered: Oct 2004
Posts: 19

Original Poster
Rep: Reputation: 0
But does it mean you have to enter the encrypted password after the -p flag
And if so how
 
Old 03-10-2005, 11:41 AM   #4
spud
LQ Newbie
 
Registered: Oct 2004
Posts: 19

Original Poster
Rep: Reputation: 0
Sorry just spotted a post further down.

Thanks
 
Old 03-10-2005, 04:20 PM   #5
spud
LQ Newbie
 
Registered: Oct 2004
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 03-10-2005, 04:44 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
http://www.linuxquestions.org/questi...word+encrypted


Cheers,
Tink
 
Old 03-10-2005, 04:50 PM   #7
jmercier
LQ Newbie
 
Registered: Nov 2004
Location: Dallas, TX
Distribution: Suse 10
Posts: 25

Rep: Reputation: 15
..

If you didnt want to use script just use:

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
useradd probs rickict Slackware 5 04-18-2005 06:20 PM
useradd jerryluis Fedora 9 03-27-2005 08:37 PM
automatic useradd sanacori Linux - Software 0 05-13-2004 08:20 AM
useradd cyrush Linux - Distributions 3 01-21-2003 10:40 PM
useradd qdickens Linux - General 4 11-02-2001 03:41 PM


All times are GMT -5. The time now is 10:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration