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
J.S. Bach wrote:
How do I add a user to the wheel group?
Or more specifically, how do I allow TextWrangler to write to /etc/hosts?
Thanks in advance.
To add a user to wheel:
sudo dscl . -append /Groups/wheel GroupMembership MyUserName
You might also need to give group write access to the folder like this:
sudo chmod 664 /etc/hosts
Or if you want even subfolders to be affected:
sudo chmod -R 664 /etc/hosts
It's always good to check the existing permissions by going to the parent directory and typing:
ls -l
Then you can see what permissions, owner, and group /etc/hosts already had. If you type
id
You can see what groups you belong to and if it matches the group of the folder or not. Admin users are, stupidly enough, not in "wheel" group by default, and wheel group also has no write access in a lot of cases like /etc/hosts. You have to be in sudo (superuser) to write to it, which could be annoying. Best to just set that folder to -664 which gives write access to wheel and then put yourself in the wheel group... problem solved.
Add user to group wheel