Creating cPanel/WHM user session

blog background image

cPanel is the most commonly used panel for Linux servers which provides an easy-to-use user interface. The Web Host Manager (WHM) is a powerful program that allows us to administer the server. cPanel is the site management panel where each individual account can be controlled by the owner of that particular account.

The WHM portal is mainly accessible through http://IP-address:2086 or https://IP-address:2087 with “root” as username and password as the server root Password. cPanel is accessible through http://IP-address:2082 or https://IP-address:2083 with the exact account username and password. You can access WHM/cPanel without knowing the actual password if you have shell access to the server. This can be done by executing the command “whmapi1” via the Linux shell terminal. WHMAPI1 is the utility to execute WHM API calls, to perform server administration tasks, manage cPanel and WHM services and administrate cPanel and WHM reseller accounts.

You can create cPanel/WHM user sessions from the backend without the need for asking passwords when they aren't working. You can get the URL for logging in automatically to the respective account's cPanel or WHM using the commands below:

Requirement: You need to log in to the root shell of the WHM server.

For cPanel Session:

Run the below command as root from the WHM server.

whmapi1 create_user_session user=cPaneluser service=cpaneld

Sample response:
---
data:
cp_security_token: /cpsess1822304624
expires: '1492729114'
service: cpaneld
session: directi:GCejhetfUa5nDicg:create_user_session,1f2e6846d166a8183adbc03b0402b4c3
url: https://server.toshost.com:2083/cpsess1822304624/login/?session=directi%3aGCejhetfUa5nDicg%3acreate_user_session%2c1f2e6846d166a8183adbc03b0402b4c3
metadata:
command: create_user_session
reason: Created session
result: 1
version: 1
---

Cpanel user is the username of the cPanel account

For WHM Session:

Run the below command as root from the WHM server.

whmapi1 create_user_session user=WHMuser service=whostmgrd
---
data:
cp_security_token: /cpsess8795722054
expires: '1492729134'
service: whostmgrd
session: directi:TuSVY3K_vRkhkxxh:create_user_session,55fb9b9eeb98d047bd7bb61d946cc7ca
url: https://server.toshost.com:2087/cpsess8795722054/login/?session=directi%3aTuSVY3K_vRkhkxxh%3acreate_user_session%2c55fb9b9eeb98d047bd7bb61d946cc7ca
metadata:
command: create_user_session
reason: Created session
result: 1
version: 1
---

WHMuser is the root or reseller user of the WHM account

Related Blog Post

Create, collaborate, and turn your ideas into incredible products with the definitive platform for digital design.

How to create cPanel backup from command line

12 December 2022

How to create cPanel backup from command line

This article explains how you can create cPanel backup from the command line, using your own username and password.

Read More
How to install Webuzo Panel on linux Server

12 December 2022

How to install Webuzo Panel on linux Server

Webuzo is a popular alternative to cPanel, a widely used web hosting control panel developed by cPanel, Inc.

Read More
What are NFT Domains?

02 February 2022

What are NFT Domains?

NFT domains are new web extensions that are deployed using ERC 721 and Polygon Network, except .zil which uses Zilliqa.

Read More
How to Delete a MySQL® Database

01 January 2022

How to Delete a MySQL® Database

This document describes how to manually delete a MySQL® database from a cPanel & WHM server. This is useful if, for exa

Read More
How to get Transfer Authorization Code from GoDaddy

11 November 2021

How to get Transfer Authorization Code from GoDaddy

To transfer your domain with us then must need EPP Code.

Read More

Got a question!

Contact us at