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 fixowner.sh

Copy below script in Editor and Save it

#!/bin/bash
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

Assign 755 executable permission to your Script with below command

# chmod 755 fixowner.sh

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

# ./fixowner.sh

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.

    Reply
    • 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 !

      Reply

Leave a Reply