VPS: SSH Keys

Remove virtual machine SSH keys

Changed on

Remove one or more SSH public keys from a specified virtual machine.

Removed keys can no longer be used to authenticate via SSH as the root user. Returns the remaining list of SSH keys configured on the virtual machine.

Use this endpoint to revoke SSH key access to VPS instances.

delete/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

keysstring[] required

SSH public keys in OpenSSH format to remove

Example request

{
  "keys": [
    "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.com"
  ]
}

Response

Success response

keystring

SSH public key in OpenSSH format

typestring

SSH key type

datastring

SSH key data (base64 encoded public key)

namestring

SSH key comment/name

Example response

[
  {
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g... user@example.com",
    "type": "ssh-rsa",
    "data": "AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g...",
    "name": "user@example.com"
  }
]

Changes