Virtual Machines
Add an SSH key to a server
Changed onAdd a key to root's authorized_keys on a running Linux server, at once and without a restart. ssh_key is the ID of a saved key or a public key (the same rule as saved keys); with save_as, a public key is also saved to your account under that name. A key the server already has changes nothing (changed: 0). The key also goes into the server's settings, so a factory reset keeps it. Every change is emailed to the account owner and written to the audit log. Needs vm.ssh_keys; in the dashboard it also asks for a two-factor code.
post/api/v1/vms/{id}/ssh-keys
Request
- Base URLhttps://api.rafftechnologies.com
- URLhttps://api.rafftechnologies.com/api/v1/vms/{id}/ssh-keys
- AuthAPI key in header X-API-Key
Path parameters
idstring uuid required
VM ID (UUID)
Request body
Example request
{
"ssh_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... you@laptop"
}Response
The server's keys after the add
Example response
{
"data": {
"keys": [
{
"fingerprint": "SHA256:KH7zm92O0/dbuPCSkvuS9zdDvBneuFaHt+qwZbp8OYU",
"type": "ssh-ed25519",
"comment": "you@laptop"
}
]
}
}Changes
- info
endpoint added
- info