Skip to content
NimbusNexus

SSH keys

SSH keys are how you log into Linux VMs after they boot. Register a key under your user, then name it in sshs when you create a VM; cloud-init writes it into the default user's ~/.ssh/authorized_keys.

How it works

There are two ways to register a key:

  • POST /api/v1/ssh/add_public with a name and your ssh_public_key. You send the public key only; the private key stays with you.
  • POST /api/v1/ssh/ with a name generates a key pair and returns its private_key once. Save it then: the API never shows it again.

A VM gets the one key you name in sshs when you create it. At boot, the metadata service exposes that public key to cloud-init, which writes it into the default user's authorized_keys file.

Keys added after a VM boots are not automatically pushed to running VMs. A VM keeps the key it was created with, so add a new key inside the VM with your usual config management.

Supported formats

The key string must be in OpenSSH format — the single line starting with ssh-ed25519, ecdsa-sha2-nistp..., or ssh-rsa, followed by the base64-encoded key material, optionally followed by a comment. That's what ~/.ssh/id_*.pub files contain by default.

Fingerprints + duplicates

Each key has a stable SHA256 fingerprint. GET /api/v1/ssh/ lists your keys with their fingerprint and public key. Key names must be unique among your keys: registering a second key under a name you already use answers 409.

Removing a key

DELETE /api/v1/ssh/ with the key's id in ssh_keys deletes it, so new VMs can't use it. Already-booted VMs keep the key in their authorized_keys file — cloud-init isn't a state-reconciler, it's a first-boot installer. To revoke a key from running VMs, either:

  1. Recreate the VMs with a different key in sshs, or
  2. Edit ~/.ssh/authorized_keys inside the VM directly (or via your config management).

What's next

  • Virtual machines — VMs use these keys at boot.
  • Authentication — API keys are for the management API, not VM login. The SSH-key endpoints take a signed-in session, not an API key.

Reference

GET/api/v1/ssh/

Ssh List

List the SSH keypairs registered for the calling user, including SHA-256 fingerprints.

Responses

  • 200Successful Response
  • 401Unauthorized
  • 403Forbidden
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/ssh/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/ssh/

Ssh Generate

Generate a new SSH keypair on the server and return the private key (returned only once).

Request body

FieldTypeDescription
name*string—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/ssh/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example"
  }'
DELETE/api/v1/ssh/

Ssh Delete

Delete one or more SSH keypairs by ID; reports any IDs that were not found.

Request body

FieldTypeDescription
ssh_keys*array of string—

Responses

  • 204Successful Response
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/ssh/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ssh_keys": [
      "example"
    ]
  }'
POST/api/v1/ssh/add_public

Ssh Add Public

Register an existing SSH public key under the calling user's account.

Request body

FieldTypeDescription
name*string—
ssh_public_key*string—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/ssh/add_public" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example",
    "ssh_public_key": "example"
  }'

Need to make a real call? Try these endpoints in the live Swagger UI →