LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (http://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   how to recover /etc/passwd? (http://www.linuxquestions.org/questions/linux-distributions-5/how-to-recover-etc-passwd-32249/)

debPandra 10-08-2002 11:48 AM

how to recover /etc/passwd?
 
hello,
by mistake I deleted all the content of the /etc/passwd. I have red hat 7.2. It uses the /etc/shadow file. I don't know if this could help. Next time I will do a backup of the /etc/passwd file, but now, is there any way to recover the content of that file? i didnt restart the computer yet.

thanks a lot for your reply
Deb

markus1982 10-08-2002 11:57 AM

If you are REALLY lucky you might find an /etc/passwd- there ... if not, have fun ;)

debPandra 10-08-2002 12:00 PM

the /etc/passwd- is also empty. is there ANY way to recover it?

markus1982 10-08-2002 12:02 PM

At least none I can think of right now ... maybe some rescue software might be possible to do so ... but I doubt it honestly!

debPandra 10-08-2002 12:05 PM

so... what does that mean? I have to reinstall linux, reinstall all the software? do what?

d3funct 10-08-2002 12:44 PM

No, it means you have to rebuild your /etc/passwd file. Look in a Redhat linux manual, or maybe someone who has a redhat filesystem handy ( I don't I'm at work with no Linux) can post their /etc/passwd with only the default users listed in it and you can cut and paste it into your /etc/passwd file. Then you'll have to run adduser to rebuild the users on your system and reset their passwords, etc... Whatever you do don't reboot the box until you have a working /etc/passwd or you WILL be re-installing (or at least coming up in single-user mode to re-build /etc/passwd).


All times are GMT -5. The time now is 11:30 AM.