3

I am new to mac and running a website through apache server. The code for my application is being accessed by the _www user, so I set the ownership to _www user but then when I try to edit a file from netbeans I have to give the ownership back to my user. I dont want to use the my application or netbeans from the root user but is there a way I can give permission to both myuser and _www user to a directory?

Thanks!

1
  • If you open Finder help and search for "set permissions" you should see this article. help.apple.com/machelp/mac/10.11/… Could you edit this to explain what specifically you are unclear about?
    – bmike
    Commented Jan 21, 2016 at 18:27

1 Answer 1

3

To give a user or a group full access to a folder use

chmod +a "user_name allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_inherit" /path/to/folder

You may replace user_name by a group_name.

To remove the ACL simply replace the +a by -a.

It's similar for a single file - the attributes are different though:

chmod +a "user_name allow read,write,execute,delete,append,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown" /path/to/file

Insert a -R for all files in a folder:

chmod -R +a "user_name allow read,...
2
  • But I think it won't work if the owner is root. Will it? Commented Feb 25, 2016 at 13:46
  • @RahulSharma Then you may have to prepend sudo
    – klanomath
    Commented Feb 25, 2016 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .