coder1.com

  • home
  • drupal articles
  • contact
Home

Fixing file system permissions

Mike Milano — June 7, 2011 - 4:51pm

Have you ever shelled into a file system where a bunch of files were executable that should not be? Or maybe permissions are generally a mess?

Typically within a website file system, files should be 644 (owner read/write, group & all just read) and directories should be 755 (owner read/write/execute, group and all just read/execute).

If you don't have any special needs for individual files to be executable, or you just want to start fresh, you can use this method.

The following commands first changes directories to the web root of my website. Then I recursively sets all files and directories to 644. After that, the find command is used to set all directories executable for user/group/all.

  1. # cd /var/www/mywebsite/public_html
  2. # chmod -R 644 *
  3. # find . -type d -exec chmod uga+x {} \;

  • Linux

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <img> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <h4> <h5> <h6> <h7>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

Poll

Have you used any NoSQL Databases?:

User login

  • Request new password

Navigation

  • Recent posts

  • home
  • drupal articles
  • contact