- chmod 644 for files and 755 for directories
- chmod 644 for all files including files in subdirectories
- chmod 755 for all directories including all directories
A quick way to reset public_html data to 755 for directories and 644 for files:
cd /home/user/domains/domain.com/public_html find . -type d -exec chmod 0755 {} \; find . -type f -exec chmod 0644 {} \;
additionally, if you know php runs as the user and not as “apache”, then you can set php files to 600, for an extra level of security, eg:
find . -type f -name '*.php' -exec chmod 600 {} \;
Leave a Reply