Best and Proper Permissions Settings for Directory
- by Dr. DOT
I am interested in knowing the proper, yet security-conscious settings for a directory. Here's my scenario:
I have a username for FTP access to my server called "user".
For the purpose of the scenario, PHP runs as "nobody" on my server.
I have a directory off the document root called "sample".
The "sample" directory is chmod'd at 0755 (drwxr-xr-x)
"Sample" is owned by "user" and the group is set to "user"
The above is all very straight forward and standard.
So I want to have a script be able to create (mkdir) and delete (rmdir) directories under "sample". Yet, I don't want to obviously overly expose my server by opening up the permissions (I could easily chmod sample to 0777 and make it world write-able).
What is the best combination of permissions, owner settings and/or group settings to allow my script to create and delete directories under "sample" while retaining the ability for "user" to continue to FTP into the directory?
Thanks.