Set Default Secure Files / Directories Permission on cPanel / Linux

In cPanel, if you accidentally alter the wrong files or directories' permission, you'll most likely get a 500 error. This is mainly due to the usage of SuPHP in your cPanel setup. Now, the below, snippets are pretty useful to reset or secure the permissions needed for both files and directories.

In order to reset your directories' permission. You'll need to fire the below command.

find . -type d -exec chmod 755 {} \;

where the above find all the directory on your current directory and exec permission 755 on it

In order to reset your files' permission. You'll need to fire the below command.

find . -type f -exec chmod 755 {} \;

where the above find all the files on your current directory and exec permission 755 on it.

In order to fix your cPanel account file permission issue. All you need to do is to fire the above 2 commands on the directory on your user account lets say hungred as shown below,

cd /home/hungred/public_html/

where hungred is your user account. Hope this helps.