On Sun, 2004-08-15 at 11:55, Simon Kitching wrote: > On Sun, 2004-08-15 at 06:14, Pete Clarke wrote: > > Hi there, > > > > <dumb mode>I managed to delete the root entry in /etc/passwd whilst playing > > on a test box</dumb mode> > > Is there an easy way of re-inserting, or copying the backup passwd file I > > have without physical access to the box? > > > > I can ssh into it, but only as a regular user - obviously I can't su to root > > as it doesn't exist anymore :-) > > I presume it's still possible to boot into "single user mode" with a > broken /etc/passwd. Here are instructions I found by googling for "linux > boot single user mode": > http://www.redhat.com/docs/manuals/linux/RHL-7.3-Manual/ > custom-guide/s1-rescuemode-booting-single.html > It should then be possible to edit the /etc/passwd file. > > Alternatively, boot using a rescue disk, mount the filesystem containing > the /etc/passwd file, then edit it to reinsert a root entry. I think the > Debian install CD will function as a "rescue disk" for this purpose. Or > Knoppix/Gnoppix/etc will do the job.
Sorry, I didn't read the original email properly, and missed the bit about not having physical access to the machine. Are the security patches on the server up-to-date? If not, you might be able to download code for one of the local-root-exploit holes that have been found within the last 6 months :-) Otherwise, I think you're stuffed. Rather like I was when I misconfigured iptables on a remote server :-( Regards, Simon -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]