Add user to group wheel
Or more specifically, how do I allow TextWrangler to write to /etc/hosts?
Thanks in advance.
Macbook5,2, Mac OS X (10.6.4), Powerbook G4, iMac G4, Powerbook G3 Pismo, iMac G3 Bondi Blue, etc
Macbook5,2, Mac OS X (10.6.4), Powerbook G4, iMac G4, Powerbook G3 Pismo, iMac G3 Bondi Blue, etc
mac1685 wrote:
Yep - 3.5.
It kinda irks me to revert back to a previous version.
I thought perhaps I could add myself to the wheel group, and fix this problem.
Any other ideas?
How do I add a user to the wheel group?
cp /etc/hosts hosts.backup
sudo nano /etc/hosts
sudo -i
cat
sudo /usr/bin/edit /etc/hosts
Linc Davis wrote:
Second and last try to keep you from doing real damage. Don't modify things like system groups and permissions when you don't know what you're doing. If you don't like my suggestion of editing the file in place, then do the following. I'll make this as simple as I can.
1. In the Finder, press the key combination Shift-Command-G.
2. A window with the title "Go to Folder" will open. In the text field, type "/etc" (without the quotes.)
3. Press Return, or click the 'Go' button. A Finder window will open with the contents of /etc showing. Find the file you want and drag it to your Desktop. The file will be copied, not moved.
4. Edit the copy using any editor you want. Save the changes.
5. Open a Terminal window. Drag the following text into the window:
sudo -i
Press Return. Type your password when prompted. Now type:
cat
There's a space after the word 'cat'. Do not press Return or any other key.
6. Drag the icon of the file you just edited from your Desktop into the Terminal window. Some text will appear automatically. Right after that text, type '> '. That's Shift-Period followed by a space.
7. Drag the icon of the original /etc/hosts file from the Finder window into the Terminal window. Click in the Terminal window to bring it forward, then press Return.
8. Verify that the modified hosts file does whatever you're expecting it to do. If it does, you can close the Terminal window and delete the hosts file from your Desktop. If not, revert the changes you made to the copy and repeat the above steps to revert the changes to the original.
vi 'til I die 🙂
I'm not sure why there's the whole discussion about sudo, nano, vi, etc. (except, maybe, that it's a better way to edit files), but the answer to the original question:
How do I add a user to the wheel group?
Go to System Preferences -> Accounts (or Users & Groups, depending on your OS version), select your account and click the 'Allow user to administer this computer.
That doesn't add the user to the wheel group; it adds him to the admin group, and it won't enable him to edit the hosts file, which isn't writable by any group.
Add user to group wheel