LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-18-2006, 01:08 PM   #1
skreaminskull
LQ Newbie
 
Registered: May 2006
Location: VA
Distribution: RHEL
Posts: 3

Rep: Reputation: 0
Moving portions of /etc/passwd and /etc/shadow


Hello all,

First post on the site, but from what I've seen, there are a lot of knowledgeable users here so I'm hoping someone can lend me some advice.

I'm moving from Redhat 7.2 to Enterprise 4. There are about 70 users I need to put on this new system from the old. All have the same group id so I was thinking I could write a Perl script to get the users from the /etc/passwd file matching the group id I'm looking for and put into a temp file. Then use that temporary file to pull the matching users from the /etc/shadow file into another temporary file and then append the contents of both files to the respective files on the new system. Assuming that the group id is the same on the new system as the old (or I could change that in the temp file to match the id on the new system) and the user ids are valid for the new system (which they should be), does anyone know of any potential problems or reasons why this would not work? Are the /etc/passwd and /etc/shadow laid out the same from version 7 to Enterprise? Is there an easier way to accomplish what I'm trying to do? I thought about copying the two file from the old to the new, but I don't want all the accounts from the old, just users in a certain group id.

Any comments or suggestions would be greatly appreciated.

Thanks!
 
Old 05-18-2006, 05:02 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I haven't seen RedHat 7.2, but I can't imagine they've made changes to passwd or shadow.

Make sure you're using the same password hash on both systems. And there will probably be different app-level pseudo users and groups in RHEL4 (e.g. apache user, apache group), so be careful you don't trample anyone.
 
Old 05-19-2006, 08:54 AM   #3
skreaminskull
LQ Newbie
 
Registered: May 2006
Location: VA
Distribution: RHEL
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for your reply, anomie.

Right, once I have RHEL4 installed, I am going to check to make sure the group id is not in use on the new system. I think I will be ok, since the group number is high. Same for the user ids. If it is in use, I will create the a new group on the system and then use a script to change it in the temp file to be appended to the passwd file.

About the password hash; I did not set up the box that is being replaced. I'm not sure how to go about determining what hash is used on the system to be replaced. I know it uses PAM. I looked out in the passwd file in /etc/pam.d and it is making calls to pam_stack.so. Is there another configuration file that I can look in on the system to know what it is using to generate the hash?

Thanks!
 
Old 05-19-2006, 10:35 AM   #4
skreaminskull
LQ Newbie
 
Registered: May 2006
Location: VA
Distribution: RHEL
Posts: 3

Original Poster
Rep: Reputation: 0
OK, I think I found it. Digging around the pam.d directory, I looked in the system-auth file and I see where it is using MD5. I'll check to make sure RHEL4 uses the same.

Thanks!
 
  


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
passwd shadow problem rblampain Linux - Distributions 2 10-04-2005 12:00 AM
Moving /etc/passwd and /etc/shadow john8675309 Linux - Software 1 01-24-2005 08:44 PM
It is ok if i unshadow the /etc/passwd and /etc/shadow Paxmaster Linux - Software 1 01-12-2005 10:07 PM
mismatch with /etc/passwd and /etc/shadow AngryKeebler Linux - General 1 07-23-2004 03:42 PM
/etc/passwd or /etc/shadow? tiger7007 Linux - Security 2 03-21-2004 04:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10: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
Open Source Consulting | Domain Registration