cPanel – Fix Ownership of /home/user

I recently had an issue with incorrect ownership of all files under /home/user/ due to mismatched UIDs after a cPanel server restore. The following script took care of this in no time.

echo -e "Checking ownership of /home/user \n"
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

2 thoughts on “cPanel – Fix Ownership of /home/user”

  1. I’m impressed, I must say. Really rarely do I encounter a blog that’s each educative and entertaining, and let me let you know, you have hit the nail on the head. Your idea is excellent; the issue is something that not enough people are speaking intelligently about. I’m very happy that I stumbled across this in my search for something referring to this.

  2. Definitely believe that which you said. Your favorite justification seemed to be on the internet the easiest thing to be aware of. I say to you, I definitely get irked while people think about worries that they just don’t know about. You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people could take a signal. Will probably be back to get more. Thanks

  3. Wonderful site. Lots of useful info here. I am sending it to a few friends ans also sharing in delicious. And certainly, thanks for your effort!

  4. I’ve been exploring for a bit for any high quality articles or blog posts on this sort of area . Exploring in Yahoo I at last stumbled upon this website. Reading this information So i’m happy to convey that I’ve an incredibly good uncanny feeling I discovered exactly what I needed. I most certainly will make sure to don’t forget this web site and give it a look regularly.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>