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

    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

    #!/bin/bash
    IFS="$"

    cd /var/cpanel/users

    if [ $# = 2 ]; then
    replace "OWNER=${1}" "OWNER=${2}" -- /var/cpanel/users/*
    else
    echo "USAGE: ./${0} <old reseller login> <new reseller login>"
    fi
    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
    Location
    India
    Posts
    85
    You change the ownership of /home/users to user:user using the following steps.

    Step 1 : Create a file that contain the usernames

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

    Code:
    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 .
    Ramshad..!##

  3. #3
    Hello,

    Nice Command RAMSH. thanks

  4. #4
    Join Date
    Mar 2007
    Location
    India
    Posts
    115
    HI

    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;

    /scripts/mailperm

    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
  •