change reseller ownership

How to change the reseller ownership from one reseller user to another reseller user by using SSH

If you want to change the reseller ownership means the old reseller is “test” and you have created new account with the user name “indian” and you want to move all the domains which is under the reseller “test” to “indian” then you need to change the ownership of all the accounts manually by using reseller center but you can easily change the reseller ownership by using following script.
Suppose :
Old Reseller Username = test
New Reseller Username = indian
1) First you need to find out the user name which is under the old reseller ( test) account by using following command
cd /var/cpanel/users
grep "OWNER=test" * -R | awk -F: '{print $1}' > user_name
cat /var/cpanel/users/user_name

It shows all the user name which is under the old reseller account.
2) Then create script file
vi /var/cpanel/users/
Then enter the follwoing code
for user in `cat user_name`
/usr/bin/replace 'OWNER=test' 'OWNER=indian' -- /var/cpanel/users/$user

Save the file
chmod 755 /var/cpanel/users/
sh /var/cpanel/users/
Now login to your new reseller account and check all the accounts.
Note : Please replace the “test”= Old reseller name and “indian”= New reseller username

2 Thoughts to “change reseller ownership”

  1. Nyoman [D]

    I got quick way to change owner/reseller, based on your how to
    cd /var/cpanel/users
    perl -pi -e ‘s/OWNER=test/OWNER=indian/g’ *
    Now all account on test will change under indian reseller

Leave a Comment