Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-18-2006, 01:08 PM
|
#1
|
LQ Newbie
Registered: May 2006
Location: VA
Distribution: RHEL
Posts: 3
Rep:
|
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!
|
|
|
05-18-2006, 05:02 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
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.
|
|
|
05-19-2006, 08:54 AM
|
#3
|
LQ Newbie
Registered: May 2006
Location: VA
Distribution: RHEL
Posts: 3
Original Poster
Rep:
|
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!
|
|
|
05-19-2006, 10:35 AM
|
#4
|
LQ Newbie
Registered: May 2006
Location: VA
Distribution: RHEL
Posts: 3
Original Poster
Rep:
|
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!
|
|
|
All times are GMT -5. The time now is 10:45 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|