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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
deletesshkey \
file='/root/.ssh/test'{ "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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
generatesshkeypair{ "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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
importsshkey \
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TYcdBoRnKW2yEqbzOQb9Fdt7EjgMohT/bdS pM6nRWFNdmWoihLzLbSi3bnc9iDwXZA8KyE3mpVi4QFfijR4dfrVWxEz5Ln2l9HC SZA6VPGzEOwOVVND98/HTu3oViJUV1gyDIWlyggSUDTyhfo/Z+c3tTHa+cv0f7xY oL63hWLgZQD2m/g6rKpsN3NhC77tCyCNZavdKy7usvZyCsoH/mPR2129LcwAwbJ3 u2Ec7qLncztSePHOmfmCTTED00a0YzFhKIQoJf7GrgLCMapYN/YPu0vgTDMPSi11 RH0rdyzd6MuPVDZwLnWO+SltjX85yz1ba/Q199HZwQOw6ZyejDaPSWJHOndD3k+r Q0T38gci9k4D87EwmfpK7zOaCoaiGiRQ6+DdYOv6hlzQ6Fdb2FOtlGQZharQ9WTC jOJBEj2oGUruc6P3fqhfUVllWi4cck0GgWZwcsmG1dDr8W6K9lrGA1dPbXoOns1B l58ghMGtHG7D0VlHs6SIqFmHr5kUgSQ4jJ2KZkVU8CrPBZ2HRtHQJJyjZWW2AbrE -----END RSA PRIVATE KEY-----'{ "metadata": { "command": "importsshkey", "reason": "OK", "result": 1, "version": 1 } }