curl --request POST \
--url https://api.compute.anonalabs.com/v1/sandboxes/{sandboxID}/ssh-certs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop"
}
'import requests
url = "https://api.compute.anonalabs.com/v1/sandboxes/{sandboxID}/ssh-certs"
payload = { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop'})
};
fetch('https://api.compute.anonalabs.com/v1/sandboxes/{sandboxID}/ssh-certs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"certificate": "<string>",
"user": "user",
"host": "<string>",
"proxyCommand": "anona-compute ssh --proxy sbx_123",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Sign an SSH certificate
Signs an OpenSSH user certificate for the given public key. It is valid
for 10 minutes, for this sandbox only, and logs in as user. It permits a
PTY and port forwarding, so ssh -L/-R, scp, rsync and editor remote
extensions work. Connect through the stream relay with
ProxyCommand anona-compute ssh --proxy <sandbox id>.
Needs an API key or a dashboard role of member or above, with the
sandboxes:use scope.
curl --request POST \
--url https://api.compute.anonalabs.com/v1/sandboxes/{sandboxID}/ssh-certs \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop"
}
'import requests
url = "https://api.compute.anonalabs.com/v1/sandboxes/{sandboxID}/ssh-certs"
payload = { "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop'})
};
fetch('https://api.compute.anonalabs.com/v1/sandboxes/{sandboxID}/ssh-certs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"certificate": "<string>",
"user": "user",
"host": "<string>",
"proxyCommand": "anona-compute ssh --proxy sbx_123",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Authorizations
An Anona Compute API key (e2b_ followed by lowercase hex).
Path Parameters
Body
OpenSSH public key (ssh-ed25519, ecdsa-sha2-nistp256 or ssh-rsa).
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA... you@laptop"
Response
The signed certificate and how to connect.
OpenSSH certificate (ssh-ed25519-cert-v01@openssh.com ...); save it as <key>-cert.pub.
"user"
The sandbox ID, used as the SSH host name.
"anona-compute ssh --proxy sbx_123"