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.

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:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi,

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

    thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,694
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    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
    
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    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!
     
  5. niceboy

    niceboy Active Member

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

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,694
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  8. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,694
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page