Enable SSH
curl --request POST \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"proxy_pubkey": "<string>",
"backend_user": "<string>"
}
'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable"
payload = {
"proxy_pubkey": "<string>",
"backend_user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({proxy_pubkey: '<string>', backend_user: '<string>'})
};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'proxy_pubkey' => '<string>',
'backend_user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable"
payload := strings.NewReader("{\n \"proxy_pubkey\": \"<string>\",\n \"backend_user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"proxy_pubkey\": \"<string>\",\n \"backend_user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"proxy_pubkey\": \"<string>\",\n \"backend_user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"pid": 123,
"host_key_fingerprint": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}SSH Lifecycle
Enable SSH
Enable the sandbox’s internal SSH daemon for sandbox-proxy backend connections.
POST
/
api
/
v1
/
ssh
/
enable
Enable SSH
curl --request POST \
--url https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"proxy_pubkey": "<string>",
"backend_user": "<string>"
}
'import requests
url = "https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable"
payload = {
"proxy_pubkey": "<string>",
"backend_user": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({proxy_pubkey: '<string>', backend_user: '<string>'})
};
fetch('https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'proxy_pubkey' => '<string>',
'backend_user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable"
payload := strings.NewReader("{\n \"proxy_pubkey\": \"<string>\",\n \"backend_user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"proxy_pubkey\": \"<string>\",\n \"backend_user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{identifier}.sandbox.tensorlake.ai/api/v1/ssh/enable")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"proxy_pubkey\": \"<string>\",\n \"backend_user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"pid": 123,
"host_key_fingerprint": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Enable the sandbox’s internal SSH server for authenticated sandbox-proxy connections.
The public sandbox proxy authenticates your API key and injects the internal forwarded-auth headers required by the daemon.
Use this endpoint on the sandbox proxy host:
This endpoint is normally called by Tensorlake’s SSH proxy. Most users should use SSH and PTY Sessions or
tl sbx ssh instead of calling this endpoint directly.Endpoint
POST /api/v1/ssh/enable
https://<sandbox-id-or-name>.sandbox.tensorlake.ai/api/v1/ssh/enable
Example Request
curl -X POST https://<sandbox-id>.sandbox.tensorlake.ai/api/v1/ssh/enable \
-H "Authorization: Bearer $TENSORLAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"proxy_pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...",
"backend_user": "tl-user"
}'
Request Body
{
"proxy_pubkey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA...",
"backend_user": "tl-user"
}
proxy_pubkeyis required. It is the sandbox proxy’s backend public key.backend_useris optional and defaults totl-user.
Response
Tensorlake returns200 OK with SSH daemon status:
{
"enabled": true,
"pid": 123,
"host_key_fingerprint": "SHA256:..."
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Was this page helpful?