This Question is Answered
1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
3 Replies
Last post:
Jul 18, 2008 6:53 AM by
jpmm
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,add_file,search,add_subdirectory,delete_child,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.
---
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,add_file,search,add_subdirectory,delete_child,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.
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
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
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)
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.
- PCW Network
- MacUser
- Mac OS X Hints
- iPhone Central
- PC World
- PCW Business Center
- About Macworld
- Advertise
- Macworld Expo
- MacMania
- Terms of Service Agreement
- Privacy Policy
© Jive Software


