how to get reseller list in ssh?

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
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
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.
 

000

Well-Known Member
Jun 3, 2008
535
29
78
Code:
cat /var/cpanel/resellers
Thanks.

This show:


Code:
[email protected] [~]# 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
[email protected] [~]#
...this only show the config.

But no list accounts with cPanel.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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.