Skip to content

Terminal API

Browser-based SSH and Telnet sessions via xterm.js.

Required scope: ssh:use (SSH endpoints)

SSH Endpoints

POST/api/ssh/terminalConnect SSH session
GET/api/ssh/terminal/:session_id/streamOutput stream (SSE)
POST/api/ssh/terminal/:session_id/inputSend input
POST/api/ssh/terminal/:session_id/resizeResize terminal
DELETE/api/ssh/terminal/:session_idClose session

SSH Known Hosts

GET/api/ssh/known-hostsList known hosts (admin)
DELETE/api/ssh/known-hosts/:idRemove known host (admin)
POST/api/ssh/known-hosts/trustTrust host key (admin)

Telnet Endpoints

POST/api/telnet/terminalConnect Telnet session
GET/api/telnet/terminal/:session_id/streamOutput stream (SSE)
POST/api/telnet/terminal/:session_id/inputSend input
DELETE/api/telnet/terminal/:session_idClose session

Connect SSH

POST/api/ssh/terminal
json
{
  "host": "192.168.1.1",
  "port": 22,
  "username": "admin",
  "password": "secret"
}

Response: { "session_id": "abc123" }

Send Input

POST/api/ssh/terminal/:session_id/input
json
{ "input": "show ip route\n" }

Resize

POST/api/ssh/terminal/:session_id/resize
json
{ "rows": 24, "cols": 80 }

Released under the MIT License.