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:
- Laravel
/asset/instances/ssh/sessionissues an signed ticket (level≥2 · 20s TTL · audited). - 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
- Optional stored key:
infr_instance.ssh_key_enc(Crypt; onlyhas_ssh_keyboolean is exposed)
Access
level≥2 + audit. In prod the bridge runs supervised with wss + host-key pinning.
Related
![The [ssh] button on the card](/manual-shots/en/instance-card.webp)