Pages

Friday, October 4, 2013

script to correct the ownership + cPanel


----------------------------------------------------------------------
#!/bin/sh
echo -e "Checking ownership of /home/user \n"
for i in `cat /root/rem1`
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
--------------------------------------------------------------------------
The file /root/rem1 should contain the list of users

0 comments:

Post a Comment