WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/allow_all_whm_root_access
- A server running WHM.
https://whm-server.tld:2087/json-api/allow_all_whm_root_access
- 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/allow_all_whm_root_access{ "metadata": { "command": "allow_all_whm_root_access", "reason": "OK", "result": 1, "version": 1 } }
Request
This function restricts root login to cPanel & WHM based on a list of CIDR addresses.
Note:
This API manipulates /var/cpanel/authorized_whm_root_ips. We HIGHLY recommend you not modify this file directly. Improper formatting of the file can lead to loss of all access to cPanel & WHM using the root password.
Use of this API replaces any previous restrictions so be sure to include previous CIDR patterns when adding new ones.
As this API only restricts logins, please be aware that existing root logins are not terminated when these restrictions are asserted.
This API DOES NOT restrict root resellers.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restrict_whm_root_access
- A server running WHM.
https://whm-server.tld:2087/json-api/restrict_whm_root_access
- 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/restrict_whm_root_access?cidr=string'{ "data": { "cidr": [ … ] }, "metadata": { "command": "restrict_whm_root_access", "reason": "OK", "result": 1, "version": 1 } }