Not Just Paranoid

Another site by Pete Maynard

Webserver File Permissions

I often forget what the best permission masks are for web data.

From what I have found out, the standard permissions should go along the lines of

Also make sure that all files and folder are owned by the correct users/group.

find . -exec chown www-data:www-data  {} \;
find . -type d -exec chmod 755 {} \;
find . -iname \*.php -exec chmod 600 {} \;
find . -type f -exec chmod 644 {} \;

Yeah I know you should use xargs, due to performance but there are not huge number of files evolved here.

6 Aug 2012 | Tags ( apache bash permissions web server )

Website Last Updated on 15 Sep 2023 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by jsdelivr.net
for the Flickr photo feed and GoatCounter for user insights.