Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

how to get reseller list in ssh?

Discussion in 'cPanel Developers' started by niceboy, Aug 29, 2013.

  1. niceboy

    niceboy Active Member

    Joined:
    Sep 29, 2011
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    56
    cPanel Access Level:
    Root Administrator
    Hi,

    any one knows how to list only users with reseller preveledge in ssh?

    thanks.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,401
    Likes Received:
    1,953
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    You could view the following file:

    Code:
    /var/cpanel/resellers
    Each reseller has a single line in /var/cpanel/resellers, starting with the username of the reseller account.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    68
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    Here's a quick code snippet to pull the usernames from the file into an array:

    Code:
    RESELLERS=$(grep -o '^[a-z][a-z0-9]\{0,7\}' /var/cpanel/resellers)
    
    Test on the command line with with:
    Code:
    #RESELLERS=$(grep -o '^[a-z][a-z0-9]\{0,7\}' /var/cpanel/resellers)
    #echo $RESELLERS
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    If you simply need the resellers one per line rather than an array, you could just run this command:

    Code:
    cat /var/cpanel/resellers | cut -d: -f1
    It will only print the resellers into a list of one per line. To input it into a file, you can add >> /pathtofile at the end:

    Code:
    cat /var/cpanel/resellers | cut -d: -f1 >> /root/resellers.txt
    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. niceboy

    niceboy Active Member

    Joined:
    Sep 29, 2011
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    56
    cPanel Access Level:
    Root Administrator
    Great. thanks for all the help. :)
     
  6. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    66
    Hi.

    When I run your command I take:

    root@server [~]# /var/cpanel/resellers
    -bash: /var/cpanel/resellers: Permission denied
    root@server [~]#

    I need list ALL ACCOUNTS in server.

    Is possible?

    Thanks
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,401
    Likes Received:
    1,953
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please keep in mind that content in the CODE tags in not always indicative of a bash command. In this case, you would have to view the file with a command such as "cat". EX:

    Code:
    cat /var/cpanel/resellers
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    66
    Thanks.

    This show:


    Code:
    root@hn [~]# cat /var/cpanel/resellers
    RESELLER#1: add-pkg,allow-parkedcreate,create-acct,create-dns,disallow-shell,edit-dns,edit-pkg,kill-acct,kill-dns,list-accts,park-dns,passwd,show-bandwidth,suspend-acct,upgrade-account
    RESELLER#2: add-pkg,create-acct,edit-pkg,kill-acct,limit-bandwidth,list-accts,passwd,quota,show-bandwidth,suspend-acct,upgrade-account
    root@hn [~]#
    ...this only show the config.

    But no list accounts with cPanel.
     
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,401
    Likes Received:
    1,953
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    This thread is about listing resellers. Are you attempting to list all accounts? If so, please note you should open new threads for questions not related to the original request.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice