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/deletesshkey
- A server running WHM.
https://whm-server.tld:2087/json-api/deletesshkey
- 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/deletesshkey?file=%2Froot%2F.ssh%2Ftest&leave_authorized=0'{ "data": { "file": "/root/.ssh/test" }, "metadata": { "command": "deletesshkey", "reason": "OK", "result": 1, "version": 1 } }
Whether to abort the function if the user already has a key with the same name.
1— Abort.0— Continue.
The key's encryption algorithm. The parameter defaults to the system's default algorithm.
The key's bits:
1024— The DSA algorithm's default value.20484096— The RSA algorithm's default value.
The key's filename.
This parameter defaults to id_rsa if the algorithm is RSA, and id_dsa if the algorithm is DSA.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/generatesshkeypair
- A server running WHM.
https://whm-server.tld:2087/json-api/generatesshkeypair
- 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/generatesshkeypair?abort_on_existing_key=1&algorithm=dsa&bits=2048&comment=NoComment&name=KeyFile&passphrase=123456luggage'{ "data": { "fingerprint": null, "name": "KeyFile" }, "metadata": { "command": "generatesshkeypair", "reason": "OK", "result": 1, "version": 1 } }
The key's contents.
Whether to extract and save only the private key.
1— Private key only.0— All data.
Note:
This parameter defaults to 1 for PPK (PuTTY Key Generator) files and 0 for all other imports.
Whether to extract and save only the public key.
1— Public key only.0— All data.
Note:
This parameter defaults to 1 for PPK (PuTTY Key Generator) files and 0 for all other imports.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/importsshkey
- A server running WHM.
https://whm-server.tld:2087/json-api/importsshkey
- 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/importsshkey?key=-----BEGIN+RSA+PRIVATE+KEY-----+hPH%2Bo4NgZrky7iGBb5iUg8R4aQzLPexpYfet25bLESvHOtutsBkbN7UWAaoM0pgM+hytunlM8UU4BArJWlJyY6AD59aluZowBbuowKeU%2Bf%2BTRaeJNJvkxTCOAipzp6LyG+nrSVJ5hxSN%2FRPfntho1MEsdWYewVI4eLayuiZJyD%2BVONCYJh%2FvPLaZ9AVUJuMerl+s%2FZJ24AwCW8cILG%2BC3TWJRCjl4Ji%2BsJ9A5P29p%2Fad18cyJc1F%2BwmAzMULWitCaB7+mmE0i1nkiZRygQzzKjqdBYWCjujxfoE2%2BnPufAJg8ZdIEI1xSVBe5jKnj8DRX67w+NAnNjXANMRePo39%2FRbDOSEXsD62h1qH93SnPsAhYT1JE6xHKV85AVIVOe8ktTA8t+jMBBioCudBFngqPHknUrIJZ2QfUm0fkKBZaoKW4yr3JjGk%2B5y6kg02gSDIA7%2FjGc+8rs3iKN%2BQJ%2Fug2x%2Fv7Xe0OozVqpl5QTltEMGJzJ1jFh9WnqgsgLTiJWlE7x5VSv8+fV8A5WTafOhBHnKuOpmpjAel1GD5DT1jNx3LhWXMHOayawC0WY04lT5kkLLWhuN2+pNqY6UBk6Z3m1ifPINq85RdnHriJiD3H%2F%2B6P%2BcUyGSOznni8yqU764LId4nNClWd+Xc%2BVvM1Udw0Sm7xF7err9CKHYUg3HfFYQPBQOfI0ib9wqOi7zWq2vhH21B5OgcTg+Bsw%2FHJUQ%2FIVnTbsqgZSn0sckaRguv%2FifmwbISO1aQ4Yxcohe%2F4miOw05r6ihbYGW+LO5kP0I8SBMCibkGFh5AxVnNgoGAW0l33hOPPSIVUTkE%2B8d3zYXLzupTFXCvmohl+jq0it7uIGOxSglf7XH3eXlNKaZjK7pBJgS5HeXM80JI8FCfifqnkaik8XTE66Ll0+s1ySaGevGkPpX5Rhbgsm4IqddAeFvlmKIND8Zvh%2FwfT%2B%2BbbD7bbFwFlrWCU3chce+8KaNVUP%2BwhCAlaS7oGcs38ygaRFXIE3vug4Ra8Xiy%2Fqfyp4YR67sMg46avHyoVky+uFbVv2n7HphZb7g3WS3ns3%2FgCQQv9TYcdBoRnKW2yEqbzOQb9Fdt7EjgMohT%2FbdS+pM6nRWFNdmWoihLzLbSi3bnc9iDwXZA8KyE3mpVi4QFfijR4dfrVWxEz5Ln2l9HC+SZA6VPGzEOwOVVND98%2FHTu3oViJUV1gyDIWlyggSUDTyhfo%2FZ%2Bc3tTHa%2Bcv0f7xY+oL63hWLgZQD2m%2Fg6rKpsN3NhC77tCyCNZavdKy7usvZyCsoH%2FmPR2129LcwAwbJ3+u2Ec7qLncztSePHOmfmCTTED00a0YzFhKIQoJf7GrgLCMapYN%2FYPu0vgTDMPSi11+RH0rdyzd6MuPVDZwLnWO%2BSltjX85yz1ba%2FQ199HZwQOw6ZyejDaPSWJHOndD3k%2Br+Q0T38gci9k4D87EwmfpK7zOaCoaiGiRQ6%2BDdYOv6hlzQ6Fdb2FOtlGQZharQ9WTC+jOJBEj2oGUruc6P3fqhfUVllWi4cck0GgWZwcsmG1dDr8W6K9lrGA1dPbXoOns1B+l58ghMGtHG7D0VlHs6SIqFmHr5kUgSQ4jJ2KZkVU8CrPBZ2HRtHQJJyjZWW2AbrE+-----END+RSA+PRIVATE+KEY-----&name=TestKey&extract_private=0&extract_public=0&passphrase=123456luggage'{ "metadata": { "command": "importsshkey", "reason": "OK", "result": 1, "version": 1 } }