In one sentence: a profile is one SSH connection plus its own rule table, its own tabs and its own credentials; switching closes the old environment as a whole and brings up the new one, and a failed switch rolls everything back.

The hard part is never the connecting

Two lines on dev, a look at staging, then a config check on prod. Every hop means retyping the host, reselecting the key, and remembering which port the dev server uses over there.

Worse, ports and tabs leak between environments: you forward the old machine's ports on the new one, and the page shows things from the environment you just left.

Multi-environment management fixes that by making each machine a complete profile and switching only which one is in effect.

What a profile holds

Part What it is
Connection Host, port, username, password or private key (optionally with a passphrase)
Channel SSH, this computer, or just a URL
Forwarding rules Automatic and hand-written rules belonging to this profile; identical ids across profiles do not collide
Tabs What you had open comes back when you switch back
Credentials One ciphertext per profile, in the OS key store

Because rules and tabs travel with the profile, switching back restores things rather than making you set them up again.

Adding and switching

Add: Settings → SSH connections → New. The form opens centred with its buttons pinned to the bottom; fill host, port, username, then choose a password or a key.

Each list row shows the name, user@host, a status dot and whether credentials are saved. Per row you can edit, duplicate (handy for two accounts on one host), re-probe (read-only — installs nothing), or delete (with confirmation).

Switch: three ways, depending on where your hands are.

  • The floating strip lists one row per environment; click a row.
  • Ctrl/Cmd+Shift+P from anywhere, including while focus is inside the embedded page. The panel supports typing to filter, ↑↓, Enter, Esc.
  • Click the row in Settings → SSH connections.

Single-active: what actually happens on a switch

Exactly one environment is live at a time. That is a deliberate decision, not laziness: parallel connections sound convenient, but in practice ports, tabs and "which machine am I on" all fight each other, and you end up with sessions running remotely that nobody is looking at.

A switch is "close the old one as a whole (connection, tunnels, pages), then attach the new one". Three behaviours are built around that:

1. The local port stays, so the page origin stays. Tunnel entries reuse the same local port where possible, which keeps the origin stable — the remote DSH keeps its login state, localStorage and session list. The page reloads once; you are not bounced back to a sign-in screen.

2. The machine you left keeps running. The agent never runs inside the client; switching just changes which machine the window is looking at. Before switching away, you are told how many services are still running over there.

3. A failed switch rolls back as a whole. Config, tunnel and page return to the machine you came from, with the reason stated. No half-state where the connection is new but the rules are old.

Credentials and host keys

Passwords and keys go through the OS key store: DPAPI on Windows, Keychain on macOS, libsecret on Linux.

  • One ciphertext per profile, so one corrupt file does not take every machine down with it.
  • Platforms without a usable key store refuse to save (for example Linux without a keyring) instead of falling back to plaintext. A silent downgrade is far more dangerous than not saving.
  • There is no IPC to read a password back. If you forget it, you retype it once.

Host keys use TOFU — trust on first use. The first connection to a machine asks you to confirm its SHA256 fingerprint; if it changes later, you get a red warning.

This is not ceremony. An encrypted tunnel does not stop a man in the middle, who can build a separate encrypted link on each side; verifying the host key is the part that does. The fingerprint matches what ssh-keyscan and OpenSSH's first-connection prompt print, so you can cross-check with system tools.

After a drop: retries, but not for everything

Network drops reconnect automatically with backoff of 1s → 2s → 4s → 8s → 15s, and the UI shows "retry N". The count has no cap, but it is always visible — "retry 7" is useful information that maybe you should check the network.

Four kinds of error are never retried:

  • Authentication failure (wrong password or key).
  • A changed host key.
  • A key that cannot be read or parsed.
  • Permission denied or disk full.

The reason is practical: hammering a failed authentication gets fail2ban to ban your IP, so the user experiences "the more it reconnects, the less it connects" after one typo. A local problem will not fix itself on the ten-thousandth attempt either.

Separately, connecting or disconnecting never disturbs the page you are reading: no address change, no reload, no dialog. If the page reports a network interruption, that is the page talking, not the client.

Three channels: what we can do on that machine

A channel is not network topology; it is how many levers we have on the machine where DSH lives:

Channel Run commands Read files Forward Typical use
ssh over SSH over SSH required A remote dev machine
local locally locally not needed DSH runs on this computer
none no no no Just a URL, just the page

Three consequences follow:

  • The local channel has no forwarding step. The service is already here, so the page opens 127.0.0.1:<real port> directly.
  • Lifecycle management needs ssh or local. With none there is no runtime to read, so nothing can be installed or started.
  • Changing the channel is in-place: automatic rules are dropped, hand-written ones are kept but marked as not in effect.

cf-ssh: still SSH, just routed through Cloudflare

cf-ssh is not a fourth channel and not a new connection type: it is still SSH, except the TCP hop to sshd goes over wss://<tunnel domain> instead of a direct host:port.

What you do not need is the interesting part:

  • No cloudflared binary on your machine.
  • No local port.
  • No child process.

The remote half is provided by the plugin's remote access, which exposes sshd as a domain through a Cloudflare Quick Tunnel. Remember the v1 boundary: only tunnels without Cloudflare Access protection are supported, and Quick Tunnels have no SLA and rotate their domains.

Boundaries

  • No parallel connections. Single-active is a deliberate model, described above.
  • Credentials are never plaintext. Linux without a keyring refuses to save — a security trade-off on purpose.
  • Tunnel entries bind 127.0.0.1 only, so other machines on your LAN cannot reach them.
  • The server must allow forwarding. With AllowTcpForwarding no, rules fail with administratively prohibited.
  • The local channel does not take over your processes. It reads state and opens no listeners.

FAQ

Can I watch two machines at once? No — one environment is live at a time. Switch over and back; config and tabs are preserved.

Does the remote service stop when I switch away? No. The agent and the services keep running remotely; the client simply stops looking at them.

Where are passwords stored? In the OS key store (DPAPI / Keychain / libsecret), one ciphertext per profile. They cannot be read back and are never written to the settings file.

Why does it stop retrying when it cannot connect? Authentication failures, changed fingerprints, unreadable keys and full disks only make things worse on retry (an IP ban, for instance). Network errors keep retrying with backoff and a visible count.