Tuesday, 15 April 2014

How to FIX Ownership issues under cPanel based server ?

Here is a simple script to solve the ownership issue under cPanel based server,


# echo -e “Checking ownership”
for i in `ls /var/cpanel/users/`
do

if [ "$i" != "root" ]; then
chown -R $i:$i /home/$i
chown $i:nobody /home/$i/public_html /home/$i/.htpasswds
chown $i:mail /home/$i/etc /home/$i/etc/*/shadow /home/$i/etc/*/passwd
echo $i
fi

done


Yeah !!!