Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010

    How to mass chmod public_html?

    How can I change permissions of all public_html direcotries in bulk?

    Also what permission you recommend for public_html ?
    I heared that 755 is not secure for public_html and 750 prevents apache to read files!

    I'm using suphp.

    note that, I said public_html, not public_html contents

  2. #2
    Join Date
    May 2008
    For mass chmod'ing, you can use a command like the following one:

    find public_html -type d -print0 | xargs -0 chmod 755
    Please make sure to understand what it's doing instead of just copying and pasting it though.

    Which permissions to choose depends on the group ownership of the directories. For a typical SuPHP setup, it's usually a good idea to grant access to public_html to only the account owner and to the web server's group (resulting in mode 750). The directories below then usually have 755 permissions, so that the web server can access the directories although the group ownership of the files and directories is typically that of the account owner.

    Depending on the web application you're using, it can be somewhat tricky to choose permissions that are both secure and permissive enough so that everything works properly.
    CoderJosh | Web Application Developer and Linux Server Admin
    █ Web & Mobile App Coding | Troubleshooting | Tuning | Hardening | SysAdmin Services

Similar Threads

  1. "chmod() [function.chmod]: Operation not permitted"
    By gavshouse in forum Hosting Security and Technology
    Replies: 5
    Last Post: 08-07-2009, 12:51 PM
  2. ideal chmod for public_html and other folders
    By Leaptopz in forum Hosting Security and Technology
    Replies: 15
    Last Post: 07-25-2009, 11:55 AM
  3. is it safe to chmod your public_html folder to 777?
    By strato in forum Web Hosting Lounge
    Replies: 18
    Last Post: 10-21-2006, 06:13 PM
  4. Mass CHMOD?
    By Tree NC in forum Hosting Security and Technology
    Replies: 2
    Last Post: 12-14-2005, 08:43 PM
  5. A way to chmod public_html's to 755 in one hit via ssh?
    By nogi in forum Hosting Security and Technology
    Replies: 10
    Last Post: 10-03-2003, 08:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts