Ownership wrong for cPanel users.

Sometime when we migrate the servers by using rsync we face ownership problems for cPanel users files/directories. At that time we can use following command from shell to resolve issue within few minutes.

——

for i  in `cat /etc/trueuserdomains   | awk ‘{print $2}’`
do
chown $i.$i /home/$i -R;
chown $i.mail /home/$i/etc -R;
chown $i.nobody /home/$i/public_html;
done;


—–

Make sure that you are using root login details to run above command.

About Anant 386 Articles
Senior technical writer