Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2007
    Posts
    77

    How do you avoid using cmod 777?

    Hi, I know you're not supposed to use 777 but it seems some scripts just simply won't work without it, what steps needs to be taken to avoid using 777?

    as far as i understand we're only supposed to use 775 for folders and 644 for files correct?

  2. #2
    Join Date
    Oct 2007
    Posts
    4,033
    Well if your server is running on suPHP/suEXEC, you will not need to use the permission 777 at all.
    The only permissions that you will need to use is 644 for files and 755 for directories.
    Aspiration Hosting [US UK SG AU] - Cloud Web Hosting | Managed Cloud Server
    LiteMage / LiteSpeed Cache for Magento, WordPress, Joomla, Drupal & XenForo

    Web Development Support Unmetered Bandwidth Aspiration CDN Magento Optimized

  3. #3
    Join Date
    Aug 2009
    Location
    England
    Posts
    197
    777 is normally set on folders used to upload items such as files, most scripts should run fine with settings 644/755 though
    Kind Regards
    Christopher Smith

  4. #4
    I don't know why 644/755 is recommended... The problem is 644 isn't secure as you're still giving global "read" access to other users on your server.. Permissions for all files/folders should be 640 for files and 750 for folders if you're using SuPHP...

  5. #5
    Global read needs to be there else we will have forbidden error, won't we?

  6. #6
    Yea so it should be:

    640 for PHP/CGI files
    750 for Directories

    and

    644 for other images and js or anything that needs to be run by Apache (not SuPHP)

    Am I right guys?

  7. #7
    Quote Originally Posted by dakman View Post
    Yea so it should be:

    640 for PHP/CGI files
    750 for Directories

    and

    644 for other images and js or anything that needs to be run by Apache (not SuPHP)

    Am I right guys?
    As said earlier by couple of people, you need 644 for files and 755 for directories, else others won't be able to view the website and will receive the "ForBidden" error message.

    BTW, when PhpSuExec is enabled your PHP scripts execute under your UID/GID level and not nobody/nobody. Files or directories that you require your PHP scripts to write to no longer need to have 777 permissions. Having 777 permissions will result in an "Internal Server Error", so you have to keep 755 permissions once phpsuexec is enabled.
    | LinuxHostingSupport.net
    | Server Setup | Security | Optimization | Troubleshooting | Server Migration
    | Monthly and Task basis services.
    | MSN : madaboutlinux[at]hotmail.com | Skype : madaboutlinux

  8. #8
    The problem is 644 still allows other users to access your files on that server so if you use 640 and SuPHP this prevents "world" read access to your scripts which could have db or other important info

Similar Threads

  1. Replies: 13
    Last Post: 10-13-2009, 12:53 PM
  2. Replies: 6
    Last Post: 09-16-2008, 04:24 PM
  3. How to cmod an entire folder and it's content in ssh?
    By azn_romeo_4u in forum Hosting Security and Technology
    Replies: 3
    Last Post: 11-09-2007, 04:46 PM
  4. Question about cmod
    By MrVega$$ in forum Hosting Security and Technology
    Replies: 1
    Last Post: 07-27-2006, 04:56 AM
  5. Site Turn Networks - Avoid! Avoid! Avoid!
    By Wraith333 in forum Web Hosting
    Replies: 1
    Last Post: 04-01-2004, 10:37 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
  •