latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

SSH Keys and Connections

Return SSH keys list

This function lists the server's SSH keys.

Warning:

Only the root account can use this function, and it only affects the root keys. To perform this function on a regular user account, call the cPanel API 2 SSH::listkeys function through the WHM API.

get/listsshkeys

Query parameters

filesstring
Example:TestKey

A filename, to limit the results to keys that have that filename.

private0 | 1

Whether to display only private keys.

  • 1 — Display only private keys.
  • 0 — Display all keys.
private_texts0 | 1

Whether to include private key text.

  • 1 — Include private key text.
  • 0 — Do not include private key text.
public0 | 1

Whether to display only public keys.

  • 1 — Display only public keys.
  • 0 — Display all keys.
public_texts0 | 1

Whether to include public key text.

  • 1 — Include public key text.
  • 0 — Do not include public key text.
sync_authorized0 | 1

Whether to synchronize the keys that can access the server.

  • 1 — Synchronize the keys.
  • 0 — Do not synchronize the keys.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "keys": [
      {
        "comment": "REPO username@example.com",
        "ctime": 1416596824,
        "file": "TestKey",
        "mtime": 1416596824,
        "private": 1,
        "text": "ssh-rsaXXXXX3XXXX1XX2XXXXXXXXXXXXXXxXXXX6XXXXX90X41X7XXXXX02XXXXX8XXXX54XXXXXXXXXXX2X07XXXXXXXXXXX7XXXX4XXX2X98XXXX98X80XXXXXXX7X/X4XXXXxX1XXXXXXXXXXXxXXXXXXXXX6+4XXXX36XXXXX3XXXXXX1XXXXXXX/X7+XX1XX6XXXX0XXXXXXX0XXXXXXXX+XxX99X7X2XXXXXX03xXXXXX0XXXXXXXXXX9XXXXXXX9XXXXXXXXXXXX/XXXXX07XXXXX3XXXXXX5XXX+/XXXXXXXXXXXXX3XxXXXXXXXXXXXX6XXXXXXXXXXXX2XXXXXXXXXXXXXXXXX3XX+XXXX3XXXXXXX== REPO username@example.com"
      }
    ]
  },
  "metadata": {
    "command": "listsshkeys",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}