LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-14-2011, 03:40 AM   #1
redrat
Member
 
Registered: Sep 2011
Posts: 31

Rep: Reputation: Disabled
Moving /etc/passwd and /etc/shadow in a read-only file system Red Hat 6


Hello, everybody,

i need some help.

I post it in the Security Forum but noone got a solution to my problem:

http://www.linuxquestions.org/questi...at-6-a-901586/

Someone can help me?

It's important.

Thanks

Last edited by redrat; 09-14-2011 at 03:42 AM.
 
Old 09-14-2011, 08:55 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You should not post the same question in more than one forum.

Reading your original thread it appears you got quite a bit of response to it. Not liking the response and/or the extra work implied by such responses is no reason to violate the rules.

 
Old 09-15-2011, 09:00 AM   #3
redrat
Member
 
Registered: Sep 2011
Posts: 31

Original Poster
Rep: Reputation: Disabled
Question Moving /etc/passwd and /etc/shadow in Red Hat 6

Hello everybody,

I decide to follow this solution in order to try to resolve my problem.

I install Red Hat 6 with only a root partition and the minimal installation in order to start the system in console mode.

I got in the Web theses 2 packages :

-shadow-utils-4.1.4.2-9.el6.src.rpm which contains the source code of the binaries (passwd, login, userdel, useradd ...)


-pam-1.1.1-8.el6.src.rpm which contains the source code of the PAM modules (pam_deny, pam_unix, pam_cracklib ...).


In all the source code, i replace all theses occurences :

/etc/group /etc/shadow /etc/gshadow /etc/passwd

by /var/group /var/shadow /var/gshadow /var/passwd.

In order to make it, i use theses commands :

find . -type f | xargs perl -i -pe 's~/etc/passwd~/var/passwd~g'
find . -type f | xargs perl -i -pe 's~/etc/shadow~/var/shadow~g'
find . -type f | xargs perl -i -pe 's~/etc/gshadow~/var/gshadow~g'
find . -type f | xargs perl -i -pe 's~/etc/group~/var/group~g'


After I run the scripts ./configure to get the Makefiles and I execute the command maketo get the new binaries.

I execute the command make install to install all the new binaries (login,passwd, useradd, userdel ...) and the dynamic libraries used by PAM (pam_deny.so, pam_cracklib.so, pam_unix.so ...).

Then I get a look in the repertories /lib/security, the old librairies (pam_deny.so, pam_cracklib.so, pam_unix.so ...) were well replaced bt the new ones (after running the command make install).

And the same thing in the repertories /bin, /usr/bin,/usr/sbin for the binaries passwd, login ,useradd, userdel ...

The last thing that I do was to move the files /etc/passwd /etc/group /etc/shadow and /etc/gshadow to /var using these commands :

mv /etc/passwd var
mv /etc/shadow /var
mv /etc/gshadow /var
mv /etc/group /var


Well, i reboot my computer. At the startup Red Hat prints this messages :

Welcome to Red Hat Enterprise Linux Server
Starting udev /bin/chown : invalid user : 'root:disk'
/bin/chown : invalid user : 'root:disk'
/bin/chown : invalid user : 'root:lp'
/bin/chown : invalid user : 'root:lp'


And the system is lock.

I can get the prompt login and password.

Anyone have a suggestion ?

Thanks

Last edited by redrat; 09-15-2011 at 09:10 AM.
 
0 members found this post helpful.
Old 09-15-2011, 10:32 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by redrat View Post
Anyone have a suggestion ?
Yes, ask this thread to be merged with http://www.linuxquestions.org/questi...at-6-a-901586/ (use the report button) and stay there, please.
 
Old 09-16-2011, 10:41 PM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

From the LQ Rules which you agreed to when you signed up:
Quote:
  • Do not post the same discussion in more than one forum. Duplicate discussions can be frustrating for other members. Try and pick the most relevant forum for your post. If you are unsure put it in Linux - General.
redrat (Last Activity: Today 10:32 AM) -- I know you've had a chance to read & follow the suggestion above. Since you haven't asked that this be merged w/ your duplicate thread, I am going down the normal & easier path of closing this. You can always paste anything important from here to there.

Please be more respectful of the Rules in the future. If necessary, please re-read them.

Thank you for your co-operation.
 
  


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
Moving /etc/passwd and /etc/shadow in a read-only system Red Hat 6 redrat Linux - Software 56 09-22-2011 05:26 PM
Moving user accounts between computers (Something wrong with passwd, shadow, etc.) Lionhard Linux - Software 5 01-18-2008 08:53 PM
Moving portions of /etc/passwd and /etc/shadow skreaminskull Linux - Security 3 05-19-2006 10:35 AM
Moving /etc/passwd and /etc/shadow john8675309 Linux - Software 1 01-24-2005 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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