Best and Proper Permissions Settings for Directory

Posted by Dr. DOT on Server Fault See other posts from Server Fault or by Dr. DOT
Published on 2009-12-15T14:34:42Z Indexed on 2010/04/21 5:03 UTC
Read the original article Hit count: 340

Filed under:
|

I am interested in knowing the proper, yet security-conscious settings for a directory. Here's my scenario:

  1. I have a username for FTP access to my server called "user".
  2. For the purpose of the scenario, PHP runs as "nobody" on my server.
  3. I have a directory off the document root called "sample".
  4. The "sample" directory is chmod'd at 0755 (drwxr-xr-x)
  5. "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.

© Server Fault or respective owner

Related posts about permissions

Related posts about group