For the complete documentation index, see llms.txt. This page is also available as Markdown.

List virtual machine SSH keys

Retrieve SSH public keys currently configured on a specified virtual machine.

List virtual machine SSH keys

get

Retrieve SSH public keys currently configured on a specified virtual machine.

Only keys of the root user are listed.

Use this endpoint to view SSH keys that can be used for authentication on VPS instances.

Authorizations
AuthorizationstringRequired

API Token authentication

Path parameters
virtualMachineIdintegerRequired

Virtual Machine ID

Example: 1268054
Responses
200

Success response

application/json
keystringOptional

SSH public key in OpenSSH format

Example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.com
typestringOptional

SSH key type

Example: ssh-rsa
datastringOptional

SSH key data (base64 encoded public key)

Example: AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g...
namestringOptional

SSH key comment/name

Example: user@example.com
get/api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys
GET /api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.com",
    "type": "ssh-rsa",
    "data": "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g...",
    "name": "user@example.com"
  }
]

Last updated

Was this helpful?