Ternux
Terminal

SSH Sessions

How Ternux establishes and manages SSH connections inside terminal tabs.

Connection flow

When you open an SSH connection, the Rust backend performs the following steps:

  1. TCP connect — 10-second timeout to host:port.
  2. SSH handshake — negotiates algorithms and verifies the server fingerprint.
  3. Authentication — password, public key, or Vault-backed secret.
  4. Channel open — requests an interactive PTY with xterm-256color.
  5. Output streaming — a background thread emits terminal-output events to the frontend.

The frontend writes those events directly to the xterm.js viewport.

Authentication methods

MethodDescription
PasswordEntered at connect time or stored in Vault
SSH keyKey pair registered in the Keychain
Vault secretEncrypted credential retrieved at connect time

Keepalive

Ternux sends an SSH keepalive every 15 seconds to prevent the connection from being dropped by idle-timeout rules on the server.

Fingerprint verification

The first time you connect to a host, Ternux shows the server's SHA-256 fingerprint. You must accept it before the connection proceeds. Accepted fingerprints are stored in the Known Hosts list.

Reconnecting

If the connection drops (network interruption, server restart), the tab displays a disconnected state. Press Cmd+Shift+R / Ctrl+Shift+R to reconnect without losing the tab context.

Cancelling an in-progress connection

If the connection is taking too long, close the tab (Cmd+W) while it is still connecting. Ternux aborts the TCP/SSH handshake immediately.

Multiple sessions

Each tab is an independent SSH session with its own channel. You can have the same host open in multiple tabs simultaneously.

On this page