Attach an org SSH key to a VM
Adds one of the org's SSH keys to the VM's allowed set, so the gateway accepts that key for SSH into the guest. Attaching a key already attached answers 204. The key must be a live key of the VM's organization, and a terminated VM answers 400.
Required permission
Requires the compute.operate permission. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
orl vms ssh-key attach <id> --ssh-key-id <ssh-key-id>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
id*stringapplication/json- body
sshKeyId*stringAttached
curl -X POST 'https://api.openrelay.inc/v1/vms/string/ssh-keys' \ -H 'Content-Type: application/json' \ -d '{ "sshKeyId": "string"}'SSH keys attached to a VM + the org's keys GET
Lists every SSH key of the VM's organization with its name and fingerprint, each flagged attached when it is in this VM's allowed set of SSH keys.
Detach an org SSH key from a VM DELETE
Removes the key from the VM's allowed set, so the gateway stops accepting it for SSH into the guest, and answers 204, also when the key was not attached. The last attached key cannot be detached: the guest would have no way in over SSH, so that returns 400.