LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 10: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, 10: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, 10: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, 10: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, 03: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, 03:44 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


Cheers,
Tink
 
Old 03-10-2005, 03: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



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 05:20 PM
useradd jerryluis Fedora 9 03-27-2005 07:37 PM
automatic useradd sanacori Linux - Software 0 05-13-2004 07:20 AM
useradd cyrush Linux - Distributions 3 01-21-2003 09:40 PM
useradd qdickens Linux - General 4 11-02-2001 02:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:31 PM.

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
Open Source Consulting | Domain Registration