Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/etc/passwd hosed !!!

Status
Not open for further replies.

abovebrd

IS-IT--Management
May 9, 2000
690
US

I just hosed my /etc/passwd file.

I restored another file over /etc/passwd. Before I noticed what had happended I had had already created a new tar archive on that tape. I now have no /etc/passwd.

There are also no other backups. I was configuring the tape drive for this purpose.

I am currently logged into the system. As long as I do not log out I have complete root access.

Question: Is there a backup copy of /etc/passwd stored somewhere else on the system. I am using RH linux 7.0
Or does a utility exsit to recreate the /etc/passwd file.

The system does not have a floppy frive, so there are no floopy boot disks boot disks.

I seem to think this can be easily over come ?

Any advice on how to proceed

-Danny






 
I just realized there where two packup copies of /etc/passwd

/etc/passwd.OLD
/etc/passwd-

I was able to recover

Lesson learned !!



-Danny






 
How did you do it? I have the same problem. My system is running under Solaris 7 on x86 based machine. My passwd file got corrupted, but i have a back-up, my problem is i dont know of any way on how to replace the corrupted passwd file.

Hope for your reply
 
Kiko,

Assuming your backup of /etc/passwd is called /etc/passwd.bak (for instance). Just do (as root) rm /etc/passwd, then do cp /etc/passwd.bak /etc/passwd. That should fix it. Cat the file to make sure it reads as it should, also check /etc/shadow to make sure it has all the users it's supposed to have in it (if you have shadow enabled). d3funct
vanya43@yahoo.com
The software required `Windows 95 or better', so I installed Linux.

 
you will need to su to root

cd /etc

cp passwd.bak to passwd

Your back in business

The real problem no becomes distinguising the differences between the hosed passwd file and the backup copy.

If you have a nightly backup it would be best to use the latest copy.

If I mis understood the question please let me know

-Danny






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top