Architecture — 10 min read

The agent's reverse tunnel: managing a server without opening a port to it

Servor manages your servers over a connection the agent dials out, not a port you open. What rides that tunnel, why there is no SSH fallback, and how it lets you close inbound 22 to the world and still run commands.

Published
November 23, 2026
Reading time
10 min read
Servor Team
Engineering
Tags
Agent · Networking
Lire cet article en français

Every management channel is a door

The conventional way to manage a server is to open something on it and connect in: inbound SSH on port 22, or an agent that listens on a port of its own. It works, and it has a cost that is easy to stop noticing — every open port is attack surface. It is a door, and a door is only as safe as the lock, the credential behind it, and the patch level of whatever is answering on the other side. The public internet scans those doors relentlessly; a management port is exactly the one you least want facing it.

Servor inverts the direction. Nothing on your server listens for us. The agent dials out — it opens an outbound connection to the control plane and holds it — and all management work rides back down that connection. This piece is about how that reverse tunnel works, what travels over it, and the security property that falls out of pointing the connection the other way.

The inbound-port problem, stated plainly

An inbound management port has three standing liabilities, and none of them depend on you making a mistake. It is discoverable: a scan finds an open 22 in seconds. It is a credential target: every exposed SSH endpoint is a login someone somewhere is trying to brute-force, which is why hardening it is a whole discipline of its own. And it is a software target: the daemon answering the port is code that can have a vulnerability, and a pre-auth flaw in an exposed service is the worst kind. You can mitigate all three — key-only auth, a firewall, fail2ban — but you cannot make a listening port stop being a door. The cheapest door to defend is the one that was never opened.

How the reverse tunnel works

The mechanics are deliberately dull, because dull is what you want holding your production fleet together. When the agent starts, it initiates an outbound connectionto the control plane and keeps it open. From the network's point of view this looks like any client reaching out to a service — the same shape as a browser talking to a website — and it needs no inbound rule, no port-forward, no public IP on the server. The control plane then multiplexes work back over that single held-open connection: when there is a command to run or a check to perform, it is sent down the tunnel the agent already established, rather than by reaching in from outside.

The direction of the initial handshake is the whole trick. Because the server is always the one reaching out, it never has to accept an unsolicited inbound connection for management at all.

What rides the tunnel

Once the connection is up, it is the single road for everything Servor does on the box:

  • Command execution. The signed grant for a command travels down the tunnel to the agent, which runs it after checking it. This is the same path for every origin — copilot, runbook, manual, terminal.
  • Metric ingestion. The agent pushes system metrics up the tunnel rather than exposing a metrics endpoint for something to scrape from outside.
  • Monitoring checks. Checks the agent performs on the box report back the same way.
  • The terminal and live exec. Even an interactive shell session is transported over the tunnel — there is no separate SSH connection opened from our side for it.

Rate limiting applies to the tunnel and to agent ingestion, so a single agent cannot flood the control plane, whether by fault or by compromise.

SSH is bootstrap, and there is no fallback

SSH does have a role, and it is small and finite: bootstrap only. When you first add a server, SSH is used to probe the connection, run the initial discovery, and install the agent. That is the entire job. Once the agent is enrolled and the tunnel is up, SSH is done — execution goes through the tunnel.

The part that matters is what happens when the tunnel is not up. Execution does not quietly fall back to SSH. runCommand fails outright with an “agent unavailable” error. That is a design choice, not a gap: a fallback is a second door, and a second door is a second thing to secure, to monitor, and to be surprised by. One execution path is easier to reason about and harder to abuse than two, so there is exactly one.

The agent binary itself is compiled ahead of time with bun build --compile across seven OS and architecture targets, served by the API, and it auto-updates. So the thing holding the tunnel open is a single self-contained executable that keeps itself current — not a runtime you have to install, patch, and remember to upgrade on every box.

The payoff: close the door and keep the keys

Point the connection outward and a concrete operational win follows: you can close inbound 22 to the world and still manage the machine. Nothing management-related is listening on a public interface, so there is nothing on that front for a scan to find, a brute-force to hammer, or a pre-auth exploit to hit. Because the agent only ever makes outbound connections, it is friendly to restrictive firewalls and to boxes behind NAT with no public IP at all — the cases where opening an inbound port is painful or impossible are exactly the cases an outbound tunnel handles without ceremony.

And tightening the network never cuts your management path, because your management path was never an inbound port. You can harden the very ports an inbound tool would have depended on, and the tunnel keeps working.

The honest boundary

A reverse tunnel is not a magic wand, and pretending otherwise would undercut the point of the design. Three things are true and worth saying:

  • Outbound has to be allowed. The agent needs to reach the control plane. In a network that blocks all egress you have to permit that one destination — you have traded an inbound rule for a narrow outbound one, which is a better trade, but it is still a rule.
  • No tunnel, no management. If the connection drops, there is no way in until the agent re-establishes it — the flip side of having no back door is having no back door for you either.
  • It does not make the control plane omnipotent or harmless. An attacker who owned the control plane could still deny availability and see connection metadata; what they could not do — forge a command your key never signed — is the subject of the signed- execution piece, and it holds independently of the tunnel.

Where this sits in Servor

The tunnel is the road; the signature is what makes the cargo trustworthy. A grant that rides the tunnel is still verified locally by the agent, which is why the control plane carrying it cannot forge it — the mechanism is in the piece on why our servers cannot execute. That the tunnel lets you close inbound SSH complements the work of hardening SSH in the first place, and the broader zero-knowledge design it fits into is in the zero-knowledge implementation piece. For the product view, start at the AI copilot page or the server operations guide. Questions about the architecture? Write to hello@servor.app — we always answer.

Next step

Run it, don't just read it.

Free for two servers, no card. Every command is signed in your browser before it runs — our servers relay it, they cannot forge it.

Continue reading

Archive →