apps/ssh-gateway/README.md
A standalone SSH gateway application that authenticates users using tokens and proxies connections to Daytona runners.
ssh -p 2222 <TOKEN>@<GATEWAY_HOST>
Example:
ssh -p 2222 Fg8Jx2nPtWAVY5pVN0TlUcbCDNPF-ePB@localhost
Where:
Fg8Jx2nPtWAVY5pVN0TlUcbCDNPF-ePB is the SSH access tokenlocalhost is the SSH gateway host2222 is the SSH gateway port| Variable | Description | Default | Required |
|---|---|---|---|
SSH_GATEWAY_PORT | Port for the SSH gateway to listen on | 2222 | No |
API_URL | Daytona API base URL | http://localhost:3000 | No |
API_KEY | Daytona API authentication key | - | Yes |
export SSH_GATEWAY_PORT=2222
export API_URL=https://api.daytona.example.com
export API_KEY=your-api-key-here
go mod tidy
go build -o ssh-gateway .
docker build -t ssh-gateway .
./ssh-gateway
docker run -p 2222:2222 \
-e API_URL=https://api.daytona.example.com \
-e API_KEY=your-api-key-here \
ssh-gateway
SSH Client → SSH Gateway → Daytona API → Runner SSH Gateway
↓ ↓ ↓ ↓
Token Auth Validate Get Keypair SSH Session
GET /sandbox/ssh-access/validate?token={token} - Validate SSH access tokenGET /runners/{id}/ssh-keypair - Get runner SSH keypairThe gateway provides clear error messages for common failure scenarios:
The application logs all connection attempts and errors for debugging and monitoring purposes.