LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2006, 02:50 PM   #1
jwholey
LQ Newbie
 
Registered: Mar 2006
Posts: 19

Rep: Reputation: 0
add existing passwords to /etc/shadow


I'm looking for a ksh script that will insert an encrpyted password into the /etc/shadow on a new server.
I can extract the encrypted password from the /etc/shadow on another server, but I'm having problems inserting it between the first and second colon ":".
But even before I do that, I need to remove what is already beween the first and second colon (.
(colon).
I can't be the first person to do this. thx.
 
Old 06-20-2006, 03:46 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
do you just mean that you are having problems understanding how to use your text editor of choice? which editor are you using?
 
Old 06-21-2006, 07:20 AM   #3
jwholey
LQ Newbie
 
Registered: Mar 2006
Posts: 19

Original Poster
Rep: Reputation: 0
No... not a problem with the text editor... it's vi. I have to add about 75 users... and a manual effort is not the way to go. I figured someone had done this before and had a quick and dirty sed/awk/ksh script to do the insertion. Haven't gotten much feedback. I guess I'll just re-invent the wheel and write it myself.
 
Old 06-21-2006, 07:47 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ahh ok, you sounded like this was just a one off thing, not a large number of connections. seems easy enough with abit of sed and awk, but i'm sure you're also aware of that really... if you post a sample of both files, i'll have a go....
 
  


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
Linux passwords in /etc/shadow LouisR Linux - Newbie 4 01-16-2005 12:45 PM
shadow passwords help? SciYro Linux - Security 2 03-03-2004 05:11 AM
shadow passwords dtheorem Linux From Scratch 2 10-18-2003 11:40 PM
shadow passwords and mdf njnear Linux - Security 5 08-06-2003 03:41 PM
Am I using shadow passwords? keirobyn Linux - Newbie 1 01-28-2002 12:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:47 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