Skip to content

Authorize an SSH key

View .md
POST

Authorize your public key on the running machine and get the command to connect. You log in as its user, which has passwordless sudo. The address changes after a stop and resume: call this again then. Not available with test-mode keys.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • sandboxIdstringrequired

    Sandbox ID.

Body

application/json

  • publicKeystringrequired

    An OpenSSH public key: the one line in your .pub file. A private key is refused with 400.

Responses

200Authorized.
  • sshobjectrequired
    3 properties
    • hoststringrequired

      The machine's address. It changes after a stop and resume: authorize the key again then.

    • userstringrequired
    • commandstringrequired

      Ready to paste.

400Not an OpenSSH public key (a private key is refused), or a test-mode key.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
404Sandbox not found, or it belongs to another project.
  • codestringrequired
  • messagestringrequired
  • detailsobject
409`sandbox_not_running`: the sandbox must be running for this. Resume it first.
  • codestringrequired
  • messagestringrequired
  • detailsobject