Correcting ownership of all cPanel Users
If you have messed up with the ownership of all the users on a cPanel server, following script will help you to correct the ownership:
====================================
# Login to server as a root
# create a shell script and enter the code below :
# vi permissions.sh
Code to be entered :
====================
for i in `cat /etc/trueuserdomains | awk β{print $2}β`
do
/bin/chown $i.$i /home/$i -R;
/bin/chown $i.mail /home/$i/etc -R;
/bin/chown $i.nobody /home/$i/public_html;
done;
====================
Save the file and change the permission for the file permissions.
# chmod 755 permissions.sh
Then run the script.
# ./permissions.sh
It will take some time according to the amount of users and The ownership of the home directory of a user, etc and public_tml will be corrected in a one go.
π π π
This entry was posted on April 5, 2012 at 2:51 am and is filed under Cpanel/WHM with tags script permissions. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply