CAll Us: World: +1 541 678 7323 | India: +91 86686 23778

How to Fix Ownership of cPanel accounts Server wide?

In order to fix the ownership of all cPanel users server wide, you need to execute below Shell script

If you are having a Shared Hosting or Reseller Hosting account then you need to get in touch with your Hosting Provider to fix ownership issue as the below script will fix ownership of all cPanel accounts server wide.

If you have a shell access to your cPanel Server you can use below method to fix ownership issue server wide.

Login to Shell and execute below commands

# vi

Copy below script in Editor and Save it

echo -e “Checking ownership of /home/user n”
for i in `ls /var/cpanel/users/`
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

Assign 755 executable permission to your Script with below command

# chmod 755

Now run script to fix Ownership of user accounts server wide.

# ./

Now you will notice that Ownership issue of server wide cPanel accounts has been fixed

About the Author
Dreamz Hosting
Dreamz Hosting is a One Stop Web Hosting Solutions company offering wide variety of Web Hosting Solutions including Shared Hosting, Reseller Hosting, VPS Hosting, Dedicated Hosting, Email Hosting and Cloud Hosting services.

2 thoughts on “How to Fix Ownership of cPanel accounts Server wide?

  1. Jim - January 9, 2017 at 3:17 pm

    Hi there, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam feedback?
    If so how do you stop it, any plugin or anything you can suggest?
    I get so much lately it’s driving me crazy so any assistance is very
    much appreciated.

    • Atul Ingale - February 3, 2017 at 1:02 pm

      You can use Akismet Plugin to avoid Comment Spam, its most popular free plugin to stop spam !


Leave a Reply