Do you wish to list all cPanel accounts under a specific reseller?
If so, it’s very simple to list all cPanel users’ name via command line interface (CLI). There is a file ‘/etc/trueuserowners‘ in your WHM server which has all cPanel username and it’s owner’s name details. We can simply grep out our requirement from this file 🙂
File which has user:owner details is:
/etc/trueuserowners
List all users under a reseller account
Please do follow the steps pasted below to list out all cPanel accounts a particular reseller account:
Step 1 : SSH to server as root user.
Step 2 : You can use the grep and cut command to list all users’ name from /etc/trueuserowners file.
Syntax
# grep $Re-seller's-name /etc/trueuserowners | cut -d : -f 1
$Re-seller’s : replace it with the re-seller acount name
Example
# grep crybit /etc/trueuserowners | cut -d : -f 1
tieuwn
sinwe8
crybit
dewan
That’s it 🙂
## Update ##
Is there any command to sort-out Resellers who created more cPanel accounts?
You can use the following command to list/sort reseller accounts with high cPanel accounts. Please do follow the steps pasted below:
Step 1 : SSH to server as root user.
Step 2 : Copy all reseller accounts name to a file.
grep -o '^[a-z][a-z0-9]\{0,7\}' /var/cpanel/resellers > resellers.txt
Step 3 : Execute the “for” loop to sort out reseller accounts with its cPanel count.
for i in `cat reseller.txt`; do grep $i /etc/trueuserowners|cut -d : -f 2;done |sort|uniq -c|sort -nr|less
That’s it!!
Related:
check the version of your WHM/cPanel from command line
Important cPanel service’s configuration file, path, service name, port – Command line view
How to terminate/delete a cPanel account through SSH
Something more about cPanel , See the category CPANEL
Is there any command to check Top 10 Resellers who created more cPanel accounts ?
Hi Vishal,
Post updated..
Hello,
You can use below command to get top 10 reseller who create more cPanel users.
for i in `cat resellers.txt`; do grep $i /etc/trueuserowners|cut -d : -f 2;done |sort|uniq -c|sort -rn | head
Thanks Pradeep!
I already updated the post.
Hello,
Is there a command to list accounts by packages ? I mean this can help to see which accounts have same package.
No direct commands. However, we can find it using a shell script.
If we De activated reseller account is this affected to reseller clients
If I remember correctly, you can select this which suspending from WHM.
list of user account according to their domain name with number.