How to make a local user be able to edit files created by _www user and group on OS X?

0

1

I'm using OS X Snow Leopard. I have a web application hosted locally in the web server folder with _www user and _www group.

I'm unable to edit those files with my local user, who is part of the group admin.

jini

Posted 2012-02-07T15:17:12.353

Reputation: 128

This one sounds familiar: Unable to edit files on Macbook pro. Permission denied

– slhck – 2012-02-07T15:29:59.497

So is the one above your question? – slhck – 2012-02-07T15:50:48.287

no I commented on it because it was very similar to mine. – jini – 2012-02-07T16:03:25.230

Answers

5

The best option is to add your local user to the _www group ; that's what groups are there for. Being administrator doesn't mean you own other user's files. You could of course override this using sudo, but this is bad.

Bottom line: add your local user to the _www group and make the files in the web server folder group-writeable ( chmod -R g+w /path/to/we/server/folder/ )

See this answer on how to add your local user to the _www group.

Karolos

Posted 2012-02-07T15:17:12.353

Reputation: 2 304

this doesn't work for files added in the future. If the default umask of _www is set to 022 all the future files will get 0644 permissions and the user will not be able to write the files even he is added to _www. Still looking for a way to set umask of _www to 002. On Linux there seem to be an easy way to achieve this: https://serverfault.com/questions/444867/linux-setfacl-set-all-current-future-files-directories-in-parent-directory-to

But it's not working on Mac :(

– Tech Nomad – 2019-12-16T01:54:57.117