This shows you the differences between two versions of the page.

Link to this comparison view

cpanel-create-temporary-whm-session [2019-01-23 16:19:51] (current)
shaun.reitan created
Line 1: Line 1:
 +====== Create a temporary WHM session using the command line ======
 +It's a common security practice to install the SSH key of a user who you want to allow ssh access to your server. On a cPanel server where you may need to access the WHM this becomes an issue since logging into the WHM usually requires you to know the root password. Luckily there is a simple solution to this issue! ​ You can create a temporary session using the command line that will allow you to log into the WHM without knowing the root password.
 +===== Generating a temporary WHM session =====
 +We will use the whmapi1 command line utility to create a temporary WHM session that we can use to access the WebHostManager without knowing the root password.
 +==== Command ====
 +root@host [~]# /​usr/​local/​cpanel/​bin/​whmapi1 create_user_session user=root service=whostmgrd
 +==== Response ====
 +  cp_security_token:​ /​cpsess5781906767
 +  expires: '​1548288309'​
 +  service: whostmgrd
 +  session: root:​ZnPGau2SgcjS5C9v:​create_user_session,​5b6ce9a7d0d7b3c53e5ef3f3545189c7
 +  url: https://​host.domain.tld:​2087/​cpsess5781906767/​login/?​session=root%3aZnPGau2SgcjS5C9v%3acreate_user_session%2c5b6ce9a7d0d7b3c53e5ef3f3545189c7
 +  command: create_user_session
 +  reason: Created session
 +  result: 1
 +  version: 1
 +  ​
 +The important part of the response is <code inline> url: https://​host.domain.tld.tld:​2087/​cpsess5781906767/​login/?​session=root%3aZnPGau2SgcjS5C9v%3acreate_user_session%2c5b6ce9a7d0d7b3c53e5ef3f3545189c7</​code>​
 +Copy the URL and paste it into your browser and you will be automatically logged into the WHM without needing the root password.