Your web hosting partners since 2004.
Buy now »

How to Make an Access Key for cPanel via Command Line

In WHM, it's called "Remote Access Key".

You can use this to generate an access key, which is also known as an access hash. You can use this access key for automatic account creation scripts, external billing software, and to allow servers in your DNS or configuration clusters to exchange records.

Generate a new access key

To generate a new access key, run the following command:

# /usr/local/cpanel/bin/mkaccesshash

You may get the message:

We deprecated this script and plan to remove it in a future release. We strongly suggest that you use the api_token_create API call.
  • Note: You can (for now) ignore this, as it'll still generate a new access key.

Alternatively, you'll want to use the api_token_create API call from command line:

whmapi1 --output=jsonpretty api_token_create token_name='example'

You can view the access hash via the command line:

# cat /root/.accesshash

Last updated: 2022-03-08

« Go Back

Order now »

Amazing as usual no problems, just what you'd expect from a top class provider.