(Useless) cPanel Tips & Tricks

(Useless) cPanel Tips & Tricks

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/

image 19 - (Useless) cPanel Tips & Tricks

So to set an unlimited quota for an email account simply remove the numbers from this file:

image 18 - (Useless) cPanel Tips & Tricks

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

2023 12 20 11 06 - (Useless) cPanel Tips & Tricks

Then create new email accounts:

2023 12 20 11 07 - (Useless) cPanel Tips & Tricks

Create Unlimited MySQL or PostgreSQL databases in cPanel

cPanel stores the number of total databases that user has in files:

  • .cpanel/datastore/mysql-db-count
  • .cpanel/datastore/postgres-db-count

By simply setting lower number in these files, you can create new MySQL and PostgreSQL databases allowing you to bypass the package limits.

2023 12 20 11 27 1 - (Useless) cPanel Tips & Tricks
2023 12 20 11 27 - (Useless) cPanel Tips & Tricks

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:

cat .cpanel/datastore/ports_GETSSHPORT
2023 12 20 11 21 - (Useless) cPanel Tips & Tricks

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
2023 12 20 11 33 - (Useless) cPanel Tips & Tricks

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:

cat .cpanel/datastore/all_iplist.db
2023 12 20 11 23 - (Useless) cPanel Tips & Tricks

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.

image 40 - (Useless) cPanel Tips & Tricks

env.cgi file

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.

image 41 - (Useless) cPanel Tips & Tricks

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:

cat .cpanel/datastore/ssl_FETCHINSTALLEDHOSTS
2023 12 20 11 52 - (Useless) cPanel Tips & Tricks

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.

image 42 - (Useless) cPanel Tips & Tricks

Add your password at the end and the script will simply output the strength in the range from 0 to 100.


whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.