Reputation: 143
I changed by accident all files on 2 very big websites to be 755. Previous was 644, at least on some, what I do not know for sure is that all were 644 before. Unfortunately these files were uploaded to the cpanel hosting. I wonder if it's safe to have 755 permissions on files and I can just leave it that way, or should I change back to 644, am not fancy to do that incase some were not 644 before, suppose at least folders were not 644. Thanks for any help.
Upvotes: 0
Views: 2316
Reputation: 905
It's not safe to leave files in 0755, as you are turning on the execution bit.
The recommended file permission for WHM/cPanel hosting environment is 0644 for files and 0755 for directories.
Since you have accidentally made the changes, I would recommend running the below commands to fix the file and directory permissions.
find /path/to/your/public_html -type f ! -perm 644 -exec chmod 644 {} \;
find /path/to/your/public_html -type d ! -perm 755 -exec chmod 755 {} \;
Cheers!
Upvotes: 2