Docs
SSH ›

Disable ssh

DELETE/v1/sandboxes/{id}/ssh

Turns SSH off for the sandbox. Its port is closed, which cuts whoever is connected, and none is opened for it again. The keys in the sandbox are left as they are. It is done whatever state the sandbox is in.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. await sandbox.ssh.off();
Answer200 OK · SshState
  1. {
  2. "enabled": boolean,
  3. "enabledAt": string | null,
  4. "address": string | null,
  5. "host": string | null,
  6. "port": integer | null,
  7. "user": string | null,
  8. "hostKey": string | null,
  9. }

SSH is off.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 SSH is off.

SshState7 fields
enabled
boolean
Whether SSH is turned on for the sandbox.
More It stays so through a stop and a start, and a move to another server: the port is opened again by itself.
enabledAt
stringnull
Since when it is on.
More Null when it is off.
address
stringnull
Where to connect now, as host:port.
More Null while SSH is off, while the sandbox is not running, and in the moments after a start or a move before its port is open again. It is another address after a move, so read it again when a connection is lost.
host
stringnull
The host of address: the public address of the server the sandbox is on.
port
integernull
The port of address, which leads to this sandbox's SSH server and to nothing else.
user
stringnull
Who a key logs in as.
More Null with address.
hostKey
stringnull
The machine's public host key, as a type and the key in base64.
More It comes over this API and not over SSH, so a client can pin it and never be asked to trust one. Null with address.

Errors and other answers

404 Not found.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.