List virtual machine SSH keys
Retrieve SSH public keys currently configured on a specified virtual machine.
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
virtualMachineIdintegerRequiredExample:
Virtual Machine ID
1268054Responses
200
Success response
application/json
Array of VPS.V1.SshKey.SshKeyResource
keystringOptionalExample:
SSH public key in OpenSSH format
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.comtypestringOptionalExample:
SSH key type
ssh-rsadatastringOptionalExample:
SSH key data (base64 encoded public key)
AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g...namestringOptionalExample:
SSH key comment/name
user@example.com401
Unauthenticated response
application/json
500
Error response
application/json
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?