InfraGuard

Interactive SSH PTY terminal

A real browser shell (top/vi/sudo work): xterm.js ⇄ WebSocket ⇄ a Node ssh2 bridge ⇄ the remote sshd.

Overview — what it does

The [ssh] action on an Instance card opens a real interactive terminal in the browser. It is a PTY console: xterm.js ⇄ WebSocket ⇄ a Node bridge (scripts/infr_ssh_bridge.cjs, using ssh2) ⇄ the remote sshd. Because ssh2 allocates a remote PTY, interactive programs like top, vi, sudo and less work (verified tty = /dev/pts).

This is not Reverb (pub/sub is unsuitable for a PTY stream) and not node-pty (ssh2 is pure JS, cross-platform, no local PTY needed).

How to use

Two-stage auth:

  1. Laravel /asset/instances/ssh/session issues an signed ticket (level≥2 · 20s TTL · audited).
  2. The bridge verifies the ticket. For a password instance the browser relays the password over the first WS frame (never stored); for a key instance the bridge uses the stored private key (Crypt) or ~/.ssh/agent.
xterm.js  ⇄  WebSocket  ⇄  ssh2 bridge  ⇄  remote sshd (PTY)

Data sources

Access

level≥2 + audit. In prod the bridge runs supervised with wss + host-key pinning.

Related

The [ssh] button on the card
The [ssh] button on the card