Hi Kj, the "sudo -s" command to make yourself super user has always worked. The difference is just that with the new tabs in Terminal it is really handy to have it going in one tab and your normal self in the other tab, where you can switch back and forth between them by just clicking the appropriate tab. It is probably a security risk to leave the sudo tab going any longer than is strictly necessary though.
Neville: that is basically the way I edit system files. I copy the one I want to the Desktop by drag 'n drop, then open in TextEdit. I can then edit and save to my heart's content. Once I am satisfied with what I've got I put a copy of it in a folder called Mods, by Save as, and amend the name to something along the lines of "foomine" and drag 'n drop the original to the Mods folder as well, so I have copies of both "foo" and "foomine" in case I change my mind about something, or the modification doesn't work.
However, doing this messes up the ownership. You can drag your modified version off the Desktop back to the original location, authenticate to replace the original, and then run Repair Permissions from Disk Utility. Faster is to use Terminal with a sudo chown command. Thus if you modified the hosts file, you would need to change the owner back to root and the group back to wheel.
sudo chown 0:0 /private/etc/hosts
I use the Uid and Gid numbers because I get confused by the "system" vs "root" business and numbers aren't subject to linguistic ambiguity. And as to "why it is considered necessary to have root as the owner of this file"--it isn't necessarily required, but the file is supposed to belong to root so that ordinary users can't mess with it, and when a process calls for it the process can use it as intended. My brother once pointed out that if absolutely everyone has read and write permissions to something it will work. It won't be secure, but it will work. In this particular case it will work, because the file only needs to be read, and the read permissions allow everyone (and thus every process) to read the altered file, even with incorrect ownership.
But if you get used to TextWrangler, that is still the easiest way to go.
Francine
Francine
Schwieder