These are some tips that I picked up over the years working with cPanel & WHM.
Set Unlimited email quota in cPanel
In cPanel email quota is saved for each domain name in a quota file located inside /home/username/etc/domain.com/
So to set an unlimited quota for an email account simply remove the numbers from this file:
Create Unlimited email accounts in cPanel
cPanel stores the total number of email accounts that a cpanel account has in file .cpanel/email_accounts_count cpanel and if for example you have reached the package limit of 20/20 email accounts then simply change the number in the file to smaller and you will be able to create new email acocunts:
nano .cpanel/email_accounts_count cpanel
Then create new email accounts:
Create Unlimited MySQL or PostgreSQL databases in cPanel
cPanel stores the number of total databases that user has in files:
By simply setting lower number in these files, you can create new MySQL and PostgreSQL databases allowing you to bypass the package limits.
Get SSH port of the server
cPanel stores the SSH port in file .cpanel/datastore/ports_GETSSHPORT and by simply opening the file you can view the SSH port:
List all domains that have Dedicated IP addresses on the server
Inside file .cpanel/caches/config/_etc_domainips___default_colon_with_one_space cpanel stores a list of dedicated IP addresses and main domains that use them:
cat .cpanel/caches/config/_etc_domainips___default_colon_with_one_space cpanel
List all IP addresses on the server
cPanel stores all server IP addresses in a file .cpanel/datastore/all_iplist.db and by simply opening the file you can view the SSH port:
phpinfo.php file for default PHP version
Often when checking limits or extensions we find ourselves creating a phpinfo.php file inside the website directory. But did you know that there is also a pre-made phpinfo.php file visible to cpanel users? By navigating to phpinfo.php
NOTE: this file will output information only for the default PHP version set in WHM.
Another interesting file that is only accessible to logged-in cpanel users is the env.cgi file that displays all environmental variables such as IP, username, password, cp_session, etc.
For more information read: cPanel information disclosure via env.cgi file
Bulk export all cPanel SSL certificates
All SSL certificates are cached in JSON format in file: .cpanel/datastore/ssl_FETCHINSTALLEDHOSTS and to downlaod all certificates at once, simple download the file and then with a simple script extract them to separate files:
Password strength checker
Another script that is used by cpanel to check password strength is passwordstrength.cgi – by calling this script and adding password= parameter in the URL, a logged in user can check his password strength.
Add your password at the end and the script will simply output the strength in the range from 0 to 100.