Relay & sharing

How relay connections work

Understand how LeapTerm connects your device to servers behind firewalls while preserving zero-knowledge security even if cloud relays are breached.

5 min read User guide

How the Zero-Knowledge Vault, Relay, and leap-agent work together

Normally, connecting to a server requires a public IP address or an open inbound firewall port. When your server is at home behind a router, on a private office network, or behind a strict firewall, leap-agent and a Relay bridge the connection without exposing any listening ports on the server.

In a native relayed session, traffic flows as Your Device → Relay → leap-agent → Local sshd (or enrolled service).

VNC desktop session connected through a Cloudflare Relay route

Instead of trusting the relay with access to your server, four independent security layers protect every connection:

  1. Zero-Knowledge Vault stays on your device. Your SSH private keys, server passwords, and passphrases are encrypted locally using two-tier DEK/KEK key wrapping inside your Vault. Cloud servers store ciphertext only—they never possess your Master Passphrase, DEK, or SSH keys.
  2. Outbound-only leap-agent with strict target allowlists. leap-agent opens zero inbound ports; it connects outbound over verified TLS (wss://) to its single configured relay endpoint. Every dial frame (DialScoped / DialPipe) is checked locally against the host's operator-enrolled target allowlist (hostname, port, and non-loopback/metadata destination rules) before any local socket is opened.
  3. End-to-end cryptographic peer authorization (outer SSH tunnel + target proof). When using a native LeapTerm app, the outer SSH tunnel terminates inside leap-agent and verifies your device's enrolled client SSH public key via cryptographic signature—or requires signed customer/coordinator hardware/root proof for desktop and task control. A relay token alone never opens a shell or target socket.
  4. Inner server login (sshd & pinned host keys). Once the agent connects the encrypted stream to your local sshd (or desktop runtime), your LeapTerm app verifies the target server's pinned SSH host-key fingerprint and authenticates using the SSH private key or password unlocked inside your Vault on your device.

Because each layer checks its own cryptographic proof independently, compromise of a relay routing token never substitutes for your client key or server login.

What happens if LeapTerm's cloud or relay servers are completely breached?

Under a full cloud-breach threat model—assuming attackers gain full control over the relay Workers, coordination databases, or OCI relay nodes—your infrastructure security guarantees depend cleanly on which client mode you use:

Security guarantee Under a total cloud / relay breach Why it holds
Vault secrets (SSH keys, passwords) Protected — attackers get opaque ciphertext only Encrypted client-side with your 256-bit DEK wrapped by your Master Passphrase / Recovery Kit / local hardware KEKs; servers never see plaintext secrets.
Native SSH / SFTP / Mosh traffic Protected (E2E encrypted) — attackers see timing & byte counts only Outer and inner SSH handshakes terminate strictly between your native device, leap-agent, and sshd; the relay forwards opaque frames without your keys.
Forcing SSH login to your server Blocked Attackers lack your Vault-protected SSH private key / password and your enrolled outer client key; leap-agent and sshd both reject unauthenticated peers before opening a session.
Injecting shell / task / desktop commands via relay Blocked (fail-closed) Task and control frames outside an enrolled, signed SSH subsystem (leapterm-control-v3 with offline root key pins) and unsigned desktop offers without client Ed25519 signatures are rejected.
Pivoting to unapproved local ports or cloud metadata Blocked Dial v1 is rejected; scoped dials check exact configured targets and block loopback (::ffff:127.0.0.1, [::1], hex/octal/integer encodings) and cloud metadata IPs unless explicitly enrolled.
Reading server health via Disconnected Telemetry Scoped to resource counters only Paired leap-agent reads bounded /proc & statvfs counters with zero shell execution; cannot unlock your Vault, run commands, or access files.
Availability & traffic metadata Not guaranteed Anyone operating relay network infrastructure can drop connections, log connection timestamps/byte volume, or disconnect active relay streams.

Where encryption ends matters

Be explicit about which client you use for sensitive work:

  • Native apps (macOS, Windows, Linux, iOS, Android) — Full Zero-Trust E2E: Your native app runs the SSH/Mosh cryptography directly on your own device and verifies server fingerprints locally. Even a completely compromised relay only forwards encrypted ciphertext and cannot read your keystrokes, inspect files, or steal credentials.
  • Hosted Web Browser Gateway — Ephemeral RAM Termination: A web browser cannot open raw TCP sockets or run native SSH directly to every backend target cleanly without a protocol proxy. When you use a Hosted Web Gateway, the Gateway service must run the SSH/desktop protocol client in ephemeral server RAM on your behalf while the session is active, decrypting traffic and holding that session's login credential in Gateway memory until the session closes or expires.
    • Because an operator (or attacker) with root access to a Hosted Web Gateway host can inspect active Gateway process memory, always use the native LeapTerm desktop or mobile apps—or deploy the Gateway/Relay infrastructure on infrastructure you control—when handling high-sensitivity credentials or servers.
Part of the route Native app + Relay Hosted Web Browser Gateway
Forwarding relay Sees timing, routing IDs, and byte counts only; cannot decrypt traffic. Passes traffic between browser/Gateway and leap-agent.
Web Gateway process Not in the data path. Holds active SSH session plaintext & that session's credentials in ephemeral RAM while connected.
Enrolled leap-agent & server Opens zero inbound ports; verifies enrolled target scope, client keys, and host sshd login. Enforces the same target allowlist and sshd login checks against the Gateway's connection.

Disconnected Telemetry vs. direct SSH probes

LeapTerm supports live server metrics cleanly without compromising security boundaries:

  1. Disconnected Telemetry (leap-agent): Paired servers report CPU, memory, disk, and network byte counters over the agent's existing outbound relay link when a dashboard is actively viewing health (demand-gated with a bounded TTL of 1s–300s). leap-agent reads kernel/OS counters directly (such as bounded /proc files on Linux) with zero shell command execution, no Vault unlock needed, and monotonic replay-protected sequence numbers. Optional disruption diagnostic uploads default strictly to OFF, require signed per-account opt-in, and cannot be silently enabled by a relay WebSocket push.
  2. Background Direct SSH Telemetry Probes (local agentless servers): When monitoring an agentless host over direct SSH from the native app, probes run only if your Vault is already unlocked and the server's pinned SSH host-key fingerprint is already trusted. Direct background probes force agent_forwarding = false, refuse external askpass prompts or uncached passphrases (never prompting silently), and execute a fixed read-only telemetry command—never passing unvalidated user strings.

What happens when you disconnect

Closing a relay session or revoking a connector stops new streams and disconnects active relay pipes immediately, though any long-running background script already launched inside an interactive shell keeps running on the host unless terminated locally.

Continue with managed relay and self-hosting, transport selection, or the privacy and trust guide.

Features vary by release, platform and connection route. Check availability before planning your setup.

Search the guides

Search runs in your browser.

Your search stays here. No account or external search service.