latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

SSH Keys and Connections

Create SSH key pair

This function generates an SSH key pair.

get/generatesshkeypair

Query parameters

abort_on_existing_key0 | 1
Example:1

Whether to abort the function if the user already has a key with the same name.

  • 1 — Abort.
  • 0 — Continue.
algorithm'rsa2' | 'dsa'
Example:dsa

The key's encryption algorithm. The parameter defaults to the system's default algorithm.

bits1024 | 2048 | 4096
Example:2048

The key's bits:

  • 1024 — The DSA algorithm's default value.
  • 2048
  • 4096 — The RSA algorithm's default value.
commentstring
Example:NoComment

A comment.

namestring
Example:KeyFile

The key's filename.

This parameter defaults to id_rsa if the algorithm is RSA, and id_dsa if the algorithm is DSA.

passphrasestring
Example:123456luggage

The key's secure passphrase.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "name": "KeyFile"
  },
  "metadata": {
    "command": "generatesshkeypair",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}