VPS: SSH Keys
Add virtual machine SSH keys
Changed onAdd one or more SSH public keys to a specified virtual machine.
Keys are added to the root user and can be used for passwordless SSH authentication. Returns the complete list of SSH keys currently configured on the virtual machine.
Use this endpoint to enable SSH key authentication for VPS instances.
post/api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys
Request
- Base URL: https://developers.hostinger.com
- URL: https://developers.hostinger.com/api/vps/v1/virtual-machines/{virtualMachineId}/ssh-keys
- Auth: HTTP bearer
Path parameters
virtualMachineIdinteger required
Example:1268054
Virtual Machine ID
Request body
Example request
{
"keys": [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.com"
]
}Response
Success response
Example response
[
{
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.com",
"type": "ssh-rsa",
"data": "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g...",
"name": "user@example.com"
}
]Changes
- info
endpoint added
- info