The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

reseller ownerships

Discussion in 'General Discussion' started by Sheldon, Aug 13, 2004.

  1. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    Hi all,

    is there any possible way I can do a mass ownership move from one owner to another

    like from root to a reseller account.

    thanks
    sheldon
     
  2. zentity

    zentity Well-Known Member

    Joined:
    Jun 16, 2004
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Yep for sure with a shell script or command line.

    All you need to do is change the owner of the account in /var/cpanel/users/user to the new owner.
    You can also copy the resellers accounts /var/cpanel/reseller.accts into /var/cpanel/newreseller.accts (being the old and new resellers user name, if you look in /var/cpanel you will see each reseller has a list of accounts user.accts file. If you have root.accts however, that is a tad more tricky, but in experience that change hasn't been required, only changing the owner in /var/cpanel/users/user for each account is needed.

    Grab a list of all accounts user names that you need to change - You could script that too, and place it in a file in the pwd (present working directory) say we call it user_list - to change all those users from root to newuser

    Command line

    # for user in `cat user_list`;do /usr/bin/replace 'OWNER=root' 'OWNER=newuser' -- /var/cpanel/users/$user;done
     
    #2 zentity, Aug 13, 2004
    Last edited: Aug 13, 2004
  3. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    # for user in `cat user_list`;do /usr/bin/replace 'OWNER=root' 'OWNER=newuser' -- /var/cpanel/users/$user;done

    will that accomplish the task and thats it?

    Sheldon
     
  4. zentity

    zentity Well-Known Member

    Joined:
    Jun 16, 2004
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Code:
    #!/bin/sh
    for user in `cat user_list`
    do 
    /usr/bin/replace 'OWNER=root' 'OWNER=newuser' -- /var/cpanel/users/$user
    done
    /scripts/updateuserdomains
    or command line

    # for user in `cat user_list`;do /usr/bin/replace 'OWNER=root' 'OWNER=newuser' -- /var/cpanel/users/$user;done;/scripts/updateuserdomains

    Thats all thats needed, I forgot that /scripts/updateuserdomains was needed - that script will also populate the /var/cpanel/newuser.accts file with the details of the domains that they own (as determined by OWNER=newuser in all the /var/cpanel/users/* files), so copying the info from the *.accts manually isn't needed.
     
    #4 zentity, Aug 17, 2004
    Last edited: Aug 17, 2004
  5. Sheldon

    Sheldon Well-Known Member

    Joined:
    Jun 7, 2004
    Messages:
    378
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    thanks very much
     
  6. supportbytes

    supportbytes Member

    Joined:
    Jul 11, 2004
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    This might be simpler if you want to change the ownership for ALL root accounts:

    replace OWNER=oldowner OWNER=newowner -- /var/cpanel/users/*
     
    #6 supportbytes, Aug 17, 2004
    Last edited: Aug 17, 2004
  7. zentity

    zentity Well-Known Member

    Joined:
    Jun 16, 2004
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Only do that if you want to change ALL the accounts ownerships - It sounds as though he wanted to change only some accounts to the newuser from root - So doing that might not be what he needed :)

    You need to run /scripts/updateuserdomains afterwards too ;)
     
Loading...

Share This Page