Change permission of all files and folders in cpanel

change permission of all files and folders

How to change permission of all files and folders in Cpanel together. Its little tricky. We can do this job easily using cpanel cron jobs function.

  1. Login to your cpanel and click on cron jobs
  2. Then select ‘common settings’ as ‘Once per minute(*****)’
  3. Now add one of the following command into command input box
  4. Wait for a couple of minutes and enjoy to fix the permission issues
  5. All folders are 755 and files are 644

Command

cd /home/username/public_html ; find -type f | xargs chmod 644 ; find -type d | xargs chmod 755 ; chmod 750 . -c

or

cd /home/username/public_html ; find ./ -type f -not -perm 644 -not -name “.ftpquota” -exec chmod 644 -c {} \;; find ./ -type d -not -perm 755 -not -group nobody -exec chmod 755 -c {} \;

Leave a Comment