Macworld Forums: _www user - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

_www user

#1 User is offline   jpmm Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 100
  • Joined: 24-November 05

Posted 16 July 2008 - 11:14 AM

How can I add the _www (hidden) user to my Sharing & Permissions?

I have a local Web server running to test Web development. Some folders need write access. I would rather not grant "Read & Write" to "Everyone" if possible, but I can't seem to get _www user added (which is the hidden user Leopard uses).

I am sure this can be done through Terminal, if someone could help me out with the syntax, that would be great!

Thanks,
Jim.
0

#2 User is offline   jpmm Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 100
  • Joined: 24-November 05

Posted 17 July 2008 - 06:31 AM

Ok, for the benefit of anyone else who wants to know... This is what I've found out. (If you try this, do so at your own risk. Playing around with file permissions and such can be dangerous, but you already knew that right?).

---

Add ACL user _www to all files in the current folder:

chmod +a "_www allow read,write,append,readattr,writeattr,readextattr,writeextattr,readsecurity" .
--

Add ACL user -www to specific file:

chmod +a "_www allow read,write,append,readattr,writeattr,readextattr,writeextattr,readsecurity" "File Name"

If the file name has a space, either put it in quotes or enter it as File Name
--

Add ACL user -www to specific folder:

chmod +a "www allow list,addfile,search,addsubdirectory,deletechild,readattr,writeattr,readextattr,writeextattr,readsecurity" "New folder"
--

Viewing ACL users:
ls -ela (e attribute shows info)

(FYI if viewing the file list, the + after file POSIX permissions means it has an ACL user)
--

Removing ACL user _www from any of the above: (You can also use "Get Info" on the file/folder and just click the - to remove the user)

(if only one ACL user, or to delete all ACL users:)
chmod -a file.txt

(if more than one ACL user, use the ACL ID # that precedes it when viewing ls -l)
chmod -a# 1 file.txt
(the pound-sign tells it to use id number, followed by a space and its number.)


===
The chmod attributes should be on one line. (For custom attributes, you can omit ones you may not need). If someone more instructions to add, please feel free. I woud like to see this as an Apple Script or application - maybe I will look into it someday, or if someone else has more time.....


I hope this helps someone!
..Jim.
0

#3 User is offline   jwk Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 44
  • Joined: 30-September 01

Posted 17 July 2008 - 07:34 PM

This is very easy to do with the freeware app BatChmod.

You can also just make the group of your file or folder _www using the terminal using:

sudo chgrp _www file/foldername
(you need sudo since you're not a member of that group)

You can then chmod or use the get info window to add write privileges.

jwk
0

#4 User is offline   jpmm Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 100
  • Joined: 24-November 05

Posted 18 July 2008 - 05:53 AM

Thanks JWK. That's a neat little program (Kind of like Bare Bone's Super Get Info).

It would be nice if it also allowed editing of ACLs. I found that if I change the owner of a folder to _www and then using the Get Info window, re-add myself, it allows me to have the dual-ownership. (For some reason BatChmod would set things as "custom" in the Get Info window - and I had to change them in the Get Info window to Read/Write)..

When I tried changing the group to www only read-write, PHP "is writable" function didn't see it as such. Maybe I did something wrong. But after adding the dual-ownership, or just making the ownership www of the folder, it was writable. I am not sure the most "secure" and accurate way to do it. The Web server is for local development only -- though the live server has screwy permissions set that I am in the processing of trying to fix.

Thanks again for your input. I will hang on to my info as well -- you can never have too many ways to do something, right?! :0)

- Jim.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users