Editing system files on shared drive
July 6, 2006 9:24 PM   Subscribe

I need to edit a file on a shared network drive but Windows XP tells me that I can't because it's a system file.

The shared drive in question is mounted on an "unslung" NSLU2 storage device running linux. I'm pretty sure I screwed up /etc/profiles because I can no longer telnet in. When I try to telnet in as root, I get "Cannot execute /opt/bin/sh:/bin/sh: No such file or directory" which corresponds with the careless edit I made to /etc/profiles when trying to upgrade busybox. When I try to log in as a non-root account, I get a different error message but still no access.

Otherwise the box is running OK. I do have write access to the drive apart from this problem file, which I cannot delete or edit. I'm hoping someone can tell me of a setting I'm missing that will let me edit the file from my desktop machine, or perhaps some other way to fix things without starting from scratch. Thanks in advance.
posted by exogenous to Computers & Internet (7 answers total)
 
I don't know if you have FTP/SCP access, with write access (i.e. as root?), but you could always grab /etc/profiles, edit it locally, and put it back intact.
posted by kcm at 9:27 PM on July 6, 2006


Response by poster: Unfortunately I don't have write access by FTP either.
posted by exogenous at 9:34 PM on July 6, 2006


In some circumstances (this is obvious so I apologize in advance) you can rename a file, I would think so if you have write access; can't you rename the file in question and "rebuild" the copied, renamed file?
posted by AllesKlar at 9:49 PM on July 6, 2006


Response by poster: Sorry, can't rename it either. My googling has revealed that Windows has something called "system file checker" than can be disabled after registry edits and hex edits, but I'm disinclined to go that route since I'm not sure it would help with a file on a shared drive.
posted by exogenous at 9:54 PM on July 6, 2006


Best answer: If it was unslung in the normal way, it should boot to the unmodified firmware when there's no drives attached.

Detach the drive, attach the drive after the NSLU2 boots, telnet in and change the file on the drive back. You'll need to look up whatever the default password is again.

If you not sure you can fix it, just copy the file from the firmware (now /etc/profiles) to the drive (now /share/XXX/data/etc/profiles). Use the mount command to figure out where the hard drive is. You'll have to set up users again, but that's an easier issue.
posted by easyasy3k at 10:03 PM on July 6, 2006


If SSH is enabled, even though you might not be able to login via SSH, SFTP as root might still work. I recommend FileZilla as a SFTP client.
posted by Sharcho at 4:13 AM on July 7, 2006


Response by poster: Thanks everyone. Due to my configuration, I couldn't SFTP at all and FTP as root was locked into an irrelevant directory. Fortunately easyasy3k's method worked nicely (turns out out I had borked /etc/passwd).
posted by exogenous at 9:19 AM on July 7, 2006


« Older Raw stream of bytes to / from Hyperterminal   |   Fly anywhere US or Caribbean free! Newer »
This thread is closed to new comments.