Have to use sudo although I’m already a member of wheel

permissionsudovi

I like to edit files in my /Library/WebServer/Documents without having to run sudo all the time.

So I simply added my username abbood to the wheel group using this command:

sudo dseditgroup -o edit -a abbood -t user wheel

i verified that abbood is a member of wheel like so:

$ members wheel
abbood
root

If I run ls -l on my files in that directory.. the user is root and the group is wheel.

However as abbood I'm still required to sudo everytime I want to edit a file.. how come? how do I avoid that?

Best Answer

Answering based on system defaults (because of lack of the information in the question):

[~]# ls -ld /Library/WebServer/Documents
drwxr-xr-x  5 root  wheel  170 Feb 21  2016 /Library/WebServer/Documents/

[~]# ls -l /Library/WebServer/Documents
total 72
-rw-r--r--  1 root  wheel   3726 Feb 21  2016 PoweredByMacOSX.gif
-rw-r--r--  1 root  wheel  31958 Feb 21  2016 PoweredByMacOSXLarge.gif
-rw-r--r--  1 root  wheel     45 Jun 12  2007 index.html.en

Members of group wheel do not have write permissions to the /Library/WebServer/Documents directory nor the files inside.

Hence adding any account to the group wheel will not allow this account to write files in/to the above directory.