LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 01-19-2007, 08:06 AM   #1
jeewiz
LQ Newbie
 
Registered: Jan 2007
Distribution: CentOS 6.5
Posts: 19

Rep: Reputation: 0
useradd -p <encrypted password>


I'm about to convert my company workstations from slackware to red hat enterprise using a red hat satellite server. For those of you new to the satellite server it basically allows you to install a red hat OS across your network with one boot cd and a short command at the start then it's hands off. This makes it easier to update and install mass amounts of workstations at one time.

One of the features of a "kickstart" they call it is the post script where you can basically input shell commands to be run after the OS is installed. I would love to be able to utilize this to create all of the admin accounts with the following:

useradd <admin_name> -G wheel -p <encrypted_password>

another option to solve the same issue could be:
useradd <admin_name> -G wheel
echo "<entry from /etc/shadow>" >> /etc/shadow


I'm having some real issues solving either of these options. I'm unsure of how to use the crypt command to generate a proper password entry. Also when you echo a line like what you see in /etc/shadow you lose much of the line, it seems to conflict with the "$"s. Either of these methods should have the same end results.

Thanks in advance!
 
Old 01-19-2007, 09:17 AM   #2
jeewiz
LQ Newbie
 
Registered: Jan 2007
Distribution: CentOS 6.5
Posts: 19

Original Poster
Rep: Reputation: 0
Solved! After toying here's how to do it:

useradd -G wheel -p <encrypted password>

where <encrypted password> is:

1- create shadow entry using passwd on linux box
2- tail the /etc/shadow and you'll see:
<userAccount>:$1$<string1>$<string2>:<numbers>:<numbers>etc...)
3- Highlight everything from "$1$<string1>$<string2>"
4- paste this after the "-p" in useradd
5- escape out the "$"s using "\"
6- hit enter!

end result should be:
useradd -G wheel -p \$1\$<string1>\$<string2>

Last edited by jeewiz; 01-19-2007 at 09:19 AM.
 
  


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
Encrypted Password alejandroye Linux - Security 2 03-01-2006 03:12 PM
root password not encrypted meskensj Linux - Newbie 3 10-19-2005 05:56 AM
useradd without shadow password twallstr Linux - Software 1 09-08-2005 03:14 PM
Password Problems With useradd Jude Lucien Debian 4 08-18-2005 11:44 AM
set logon password without useradd? ldp Linux - Security 2 01-22-2005 08:12 PM


All times are GMT -5. The time now is 04:45 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration