Permission error in /home directory running WHM/Cpanel Print

  • 0

 

1.Command run as root:

find /home/*/public_html/* -type f -exec chmod 644 {} \;

find /home/*/public_html/* -type d -exec chmod 755 {} \;

for i in $(ls /var/cpanel/users) ;

do chown -R $i.$i /home/$i/public_html/* ; done

2.A script to fix permissions & ownership, on files & directories, for cPanel accounts.

To get the fixperms script, simply wget the file from GitHub and make sure it’s executable:

wget https://raw.githubusercontent.com/PeachFlame/cPanel-fixperms/master/fixperms.sh chmod +x fixperms.sh

Fixing one single user/account

Then, run it (with ROOT permissions) while using the ‘a’ flag to specify a particular cPanel user:

sh ./fixperms.sh -a USER-NAME

It does not matter which directory you are in when you run fixperms. You can be in the user’s home directory, the server root, etc… The script will not affect anything outside of the particular user’s home folder.

Fixperms - for all of the users

If you would like fix the permissions for every user on your cPanel server, simply use the ‘-all’ option:

sh ./fixperms.sh -all

 

Thanks goto NC 

 


Was this answer helpful?

« Back