Add user to group wheel

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.

Macbook5,2, Mac OS X (10.6.4), Powerbook G4, iMac G4, Powerbook G3 Pismo, iMac G3 Bondi Blue, etc

Posted on Jan 8, 2011 1:11 PM

Reply
16 replies

Oct 7, 2011 10:32 PM in response to J.S. Bach

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.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Add user to group wheel

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.