Differences
This shows you the differences between two versions of the page.
— |
cpanel-create-temporary-whm-session [2019-01-24 00: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! | ||
+ | |||
+ | ===== 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 [~]# / | ||
+ | </ | ||
+ | |||
+ | ==== Response ==== | ||
+ | < | ||
+ | data: | ||
+ | cp_security_token: | ||
+ | expires: ' | ||
+ | service: whostmgrd | ||
+ | session: root: | ||
+ | url: https:// | ||
+ | metadata: | ||
+ | command: create_user_session | ||
+ | reason: Created session | ||
+ | result: 1 | ||
+ | version: 1 | ||
+ | </ | ||
+ | | ||
+ | The important part of the response is <code inline> url: https:// | ||
+ | Copy the URL and paste it into your browser and you will be automatically logged into the WHM without needing the root password. |