WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function checks the SSH credentials on the remote server.
There are several methods that you can use to authenticate a transfer session with the remote server.
The simplest authentication method is to use the root user and password. To do this, the sshd_config file on the remote server must contain the following value: PermitRootLogin=Yes
The following table displays the correct parameters and values for this authentication method:
| Parameter | Value |
|---|---|
user | root |
password | root's password. |
You can also use the SSH Public Key to authenticate the root user. If the SSH Public Key is encrypted, include the SSH Key's passphrase.
The following table displays the correct parameters and values for this authentication method:
| Parameter | Value if the SSH Key is not encrypted | Value if the SSH Key is encrypted |
|---|---|---|
user | root | root |
sshkey_name | root's SSH key name. | root's SSH key name. |
sshkey_passphrase | (none) | root's SSH key passphrase. |
Many server administrators do not permit direct root logins on their servers.
- If the remote server contains
PermitRootLogin=Noin thesshd_configfile, then you must use another user and their password on the remote server, and then escalate toroot. - If the system administrator used WHM's Manage Wheel Group Users interface (WHM >> Home >> Security Center >> Manage Wheel Group Users) to grant the user
suaccess, then you will need to specifysuand therootpassword. - If the user has
sudoaccess, you do not need therootpassword.
The following table displays the correct parameters and values for this authentication method:
| Parameter | Value if the user has sudo access | Value if the user has su access |
|---|---|---|
user | The user's username. | The user's username. |
password | The user's password. | The user's password. |
root_escalation_method | sudo | su |
root_password | (none) | root's password. |
You can also use an SSH Public Key instead of a password to authenticate that user. If the SSH Public Key is encrypted, include the SSH Key's passphrase.
The following table displays the correct parameters and values for this authentication method:
| Parameter | sudo | su |
|---|---|---|
user | The user's username. | The user's username. |
sshkey_name | The user's SSH key name. | The user's SSH key name. |
sshkey_passphrase (If encrypted) | The user's SSH key passphrase. | The user's SSH key passphrase. |
root_escalation_method | sudo | su |
root_password | (none) | root's password. |
The remote server's hostname or IP address.
A valid IP address.
A valid IP address.
The escalation method to use to connect to the remote server.
susudo
Note:
Use this parameter if PermitRootLogin=No in the remote server's sshd_config file.
root's password on the remote server.
Note:
Use this parameter if PermitRootLogin=No in the remote server's sshd_config file and the root_escalation_method value is set to su.
The SSH key's name.
Note:
SSH keys are available in WHM's Manage root's SSH Keys interface (WHM >> Home >> Security Center >> Manage root’s SSH Keys).
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/remote_basic_credential_check
- A server running WHM.
https://whm-server.tld:2087/json-api/remote_basic_credential_check
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/remote_basic_credential_check?host=192.168.0.0&user=root&password=123456luggage&port=22&root_escalation_method=sudo&root_password=123456luggage&sshkey_name=FrancisScott&sshkey_passphrase=kkwtoowoygidsa'{ "data": { "output": "Basic credential check…\nDone\n", "response": "basic credential check\n" }, "metadata": { "command": "remote_basic_credential_check", "reason": "Success", "result": 1, "version": 1 } }
Request
This function retrieves a transfer module's key structure.
Note:
For more information about how this function works with other functions in the transfer and restore process, read our Guide to Transfer and Restore API Functions documentation.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/transfer_module_schema
- A server running WHM.
https://whm-server.tld:2087/json-api/transfer_module_schema
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/transfer_module_schema?module=AccountRemoteRoot'{ "data": { "schema": { … } }, "metadata": { "command": "transfer_module_schema", "reason": "OK", "result": 1, "version": 1 } }
Request
This function validates a system user for use on the target server.
Note:
For more information about how this function works with other functions in the transfer and restore process, read our Guide to Transfer and Restore API Functions documentation.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/validate_system_user
- A server running WHM.
https://whm-server.tld:2087/json-api/validate_system_user
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/validate_system_user?user=username'{ "data": { "exists": 1, "reserved": 1, "valid_for_new": 1, "valid_for_transfer": 1 }, "metadata": { "command": "validate_system_user", "reason": "OK", "result": 1, "version": 1 } }