Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007

    changing ownership of multiple accounts in cPanel using SSH, how? help pls.

    I have to mass change the ownership of accounts and I find "Change Owner of Multiple Accounts" tedious.

    I found a bash script but I'm not sure if this works


    cd /var/cpanel/users

    if [ $# = 2 ]; then
    replace "OWNER=${1}" "OWNER=${2}" -- /var/cpanel/users/*
    echo "USAGE: ./${0} <old reseller login> <new reseller login>"
    If that works, how can I tweak it so that the change in ownership of accounts will be based in the hosting package and not in the old reseller account?

    I hope someone can help me. thank you.
    All things work together for the good of those who love God - Romans 8:28

  2. #2
    Join Date
    Oct 2009
    You change the ownership of /home/users to user:user using the following steps.

    Step 1 : Create a file that contain the usernames

    cd /home
    cat /etc/trueuserowners | cut -d -f1 > users.txt
    Step 2 : Changing the ownership

    for i in `cat users.txt`; do chown -R $i: /home/$i ; chown -R $i:mail /home/$i/etc; done
    chown -R $i:mail /home/$i/etc will change the group to "mail" , otherwise the mail service didn't work for the users .

  3. #3

    Nice Command RAMSH. thanks

  4. #4
    Join Date
    Mar 2007

    If you want to change the permission

    cd /home
    ls -al|grep root

    for i in `ls /var/cpanel/users/`; do chown $i:$i /home/$i ; done
    for i in `ls /var/cpanel/users/`; do chown -R $i:$i /home/$i/* ; done

    Then run;

    for i in `ls /var/cpanel/users/`; do chown $i:nobody /home/$i/public_html ; done
    for i in `ls /var/cpanel/users/`; do chmod 750 /home/$i/public_html ; done

    Then run;


    chown root.root /home
    LENOVOhost Network Solutions, designs the technology of Tomorrow
    RVSkins, Fantastico, 24/7 Support, FFMPEG, SLA Uptime, Daily Backups, End-User Support & More
    Support Desk Software | Sales, Billing & Tech End-user Support | Hosting Templates

Similar Threads

  1. Email Addresses When Changing Ownership Of Site
    By Trax07 in forum Web Hosting
    Replies: 1
    Last Post: 12-10-2007, 01:37 PM
  2. Changing cPanel packages on multiple servers at the same time
    By thefast in forum Hosting Software and Control Panels
    Replies: 8
    Last Post: 04-23-2007, 07:24 AM
  3. cPanel/WHM Multiple Reseller Accounts
    By Daniel_G in forum Reseller Hosting
    Replies: 10
    Last Post: 01-23-2007, 12:54 PM
  4. [PLESK]Changing domain ownership
    By riquelme in forum Dedicated Server
    Replies: 11
    Last Post: 04-05-2006, 11:25 AM
  5. sftp and changing file ownership
    By roliver in forum Hosting Security and Technology
    Replies: 2
    Last Post: 02-19-2004, 10:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts