NEWAI chat: ask your fleet anything, in plain language. Chat with your fleet Read more →

Remote access to robots behind NAT, firewalls and cellular

How to reach robots behind NAT, customer firewalls and cellular without opening a port: outbound-only relays, port forwarding, audit and customer controls.

Illustration for "Remote access behind NAT": a field rover, with the label "terminal · no public IP"

In the lab, remote access is ssh robot.local. Nobody thinks about it.

Then the robot ships. It sits on a customer's network, behind their firewall, which their IT team owns. Or it's a mobile base on an LTE modem, behind carrier-grade NAT, with no inbound address at all. Something goes wrong at 6 in the morning their time, and the only person who can look at it is you, two time zones away.

At Upswift we saw this on every kind of device, from casino machines to coffee roasters. With robots it matters more. The machines used to run fixed programs, so a bug you could reproduce on your desk was usually the same bug in the field. Now they run learned models that decide many times a second from what the cameras see. The input is the world at that site: that floor, that light, that conveyor. Often you can't reproduce the problem in the lab. You have to go look at the robot where it is, while it's doing the thing.

For a robot fleet, remote access is how you debug. This post is about how to do it without opening ports, without a VPN per customer, and without turning your robots into a way into someone else's factory.

The short answer: Have the robot connect out to a relay over TLS and never listen for inbound management connections. An engineer asks for a session in the cloud, the robot gets a signed command and dials the relay, and the relay joins the two. That works through NAT, customer firewalls and carrier-grade NAT, with no open port and no VPN per site.

Why the usual approaches break

Most teams try at least two of these. They all work for the first five robots.

  • Port forwarding on the site router. You don't own the router, and IT will say no, correctly. On cellular there is often nothing to forward: the carrier's NAT means the robot has no public address. And when it does work, you've put SSH on the internet. Bots will find it within hours.
  • A VPN per site. One customer uses one VPN product, the next uses another, each with its own client, credentials and approval process. Half of them use 192.168.1.0/24, so the subnets collide on your laptop. The VPN gives you network access to the whole site, which the customer is right to worry about. And it breaks quietly when the site changes something.
  • Reverse SSH tunnels with autossh. The robot dials out to a jump host and opens a port there. It's the first thing most teams build. Then you have a spreadsheet of which robot owns port 20014, the same private key on every robot, and a jump host that is now the most valuable machine you own. Tunnels die silently and come back on a different port. There is no record of who connected to what.
  • A mesh VPN agent on every robot. Better. It traverses NAT and the keys are per machine. But it puts your robots on a flat network with your engineers' laptops, it gives you IP access rather than a scoped session, and some corporate networks block the UDP it prefers. You still need to bolt on audit and customer controls yourself.

The common problem: all of these think in terms of networks. What you actually want is a session. One engineer, one robot, one purpose, for a limited time, recorded.

The pattern that works: outbound only, through a relay

Here is the design I recommend, whether you build it or buy it.

  1. The robot only connects out. It holds one long-lived outbound connection over TLS, on ports that look like any other HTTPS or MQTT client. NAT, carrier NAT and almost every corporate firewall allow that. Nothing listens on the robot for management. There is no port to scan.
  2. A session starts in the cloud, not on the robot. An engineer asks the platform for a terminal or a forward to robot 14. The platform checks who they are and whether that's allowed, then sends the robot a signed command bound to that robot.
  3. The robot dials the relay. On that command, the robot opens a new outbound WebSocket to a relay. The engineer's browser or CLI connects to the same session on the relay. The relay joins the two. Both sides are clients. Neither accepts an inbound connection.
  4. The session has limits. A short-lived token, an idle timeout, a maximum length, a cap on parallel sessions per robot. When any of those runs out, the relay closes it.
  5. Everything is recorded. Who opened it, which robot, what target, how long, how many bytes, why it ended.

The conversation with customer IT changes completely. You're no longer asking for a VPN project. You're asking them to allow outbound TLS from these machines to a few host names. That is one email, and most networks already allow it. Ask for every port you need up front, including the MQTT one, so you don't discover a blocked port on install day.

What you need through the tunnel

A shell is where you start. In practice I use four things.

A terminal

For the obvious: look at a process, read a file, run journalctl, restart a service. Run it in the browser so the engineer on call doesn't need a key on their laptop for each robot.

Port forwarding to web UIs on the robot

This is the one teams underestimate. A modern robot runs several small web servers: the inference server's status page, a visualization bridge over WebSocket, a Jupyter you use for calibration, Meshcat for a motion planner, the web page of a PLC or a camera on the same cell network. Being able to open any of those in a browser tab, as if you were standing next to the robot, saves more time than the shell does.

A few things matter here:

  • Bind those services to localhost on the robot. They don't need to listen on the customer's network. The forward reaches them on loopback, and there is nothing left for anyone on the site network to find.
  • Multiplex over one connection. A web UI opens many TCP connections. Doing a new tunnel per connection over a cellular link makes the page crawl. One WebSocket carrying many streams, with flow control per stream, is what makes it usable.
  • Support WebSockets through the forward. Visualization tools and notebooks depend on them. Plain HTTP proxying isn't enough.
  • Forward SSH too. Sometimes you want your own tools: rsync a log folder, scp a calibration file. Forward port 22 to a local port on your laptop and point your tools at it. Still no open port on the robot's network.

Scope: what the robot is allowed to reach

The robot sits inside someone else's network. A forwarding tool that can reach anything from the robot is a pivot into their factory. Decide the scope on the robot, not only in the cloud:

  • Default to loopback and the local network. That covers the robot's own services and the devices in its cell.
  • Never reach link-local and cloud metadata addresses by default. If a robot runs in a cloud VM or near one, 169.254.169.254 hands out credentials. A broad rule like "allow the internet" must not include it.
  • Prefer an allow list of `host:port` entries. "This robot may forward to its own 8000 and 9090, and to the camera at 10.0.4.21:80." Anything else is refused on the robot.
  • Resolve a host name once and dial that address. Otherwise DNS tricks can send the connection somewhere you didn't approve.

Live camera and snapshots

When a model misbehaves, the first question is "what is it seeing?" A snapshot on request answers it in seconds. Don't try to stream video through an SSH session over LTE. Ask for a frame, then another.

Cellular is its own world

Robots on cellular need a few extra rules.

  • Interactive access must work when the data budget is gone. Telemetry should throttle itself to stay inside a SIM plan. The terminal you open at 3 a.m. should not be the thing that gets cut. Design the budget so background data shrinks and requested sessions always go through.
  • Expect high and changing latency. Typing in a remote shell over a weak link is painful. Run commands that finish, not interactive tools that redraw the screen. Pull files instead of paging through them.
  • Expect the session to drop. Use tmux or screen on the robot for anything that takes more than a minute, so a dropped link doesn't kill a half-finished command. Never run a long package install in a bare session over cellular.
  • Reconnect without humans. The robot's outbound connection must come back by itself after the modem resets, the SIM roams or the robot drives through a dead zone. If someone has to power-cycle it, you don't have remote access.

Audit: the record you'll be asked for

Sooner or later a customer asks: "Did anyone from your team access robot 14 on Tuesday?" You should be able to answer in a minute, with names and times.

Record, for every session: who opened it, the robot, the kind (terminal, forward, camera), the target for a forward, start and end, bytes in each direction, and why it ended (closed, idle, max time, revoked). Keep it outside the robot, because a record on the robot can be edited by whoever is on the robot.

The audit also helps you. Pair it with a change timeline on the robot (packages, config files, containers) and you can see that /etc/robot/limits.yaml changed at 14:32, during a session someone on your team opened at 14:20. That's the fastest way I know to find the hand fix that made one robot different from the rest. Finding the robot that's different is a lot easier when you can see who touched it.

Let the customer say no, and mean it

Some customers won't allow a remote shell on machines in their plant. Some will allow it but not the camera, because the camera sees their people and their product. Respect that, and make it real:

  • Enforce it on the robot. A flag at install time like --no-terminal or --no-camera that the agent enforces locally, and that can't be switched back on from the cloud. A promise enforced only in your cloud is only as strong as your cloud and whoever has admin on it.
  • Have a separate switch for forwarding. Some customers are fine with you opening the inference server's status page but not a shell. Treat them as different permissions.
  • Give them the session log. Showing a customer exactly when you connected and for how long builds more trust than any security questionnaire.

When the customer has turned the terminal off, your observability has to carry you. Metrics, logs, ROS topics, flight recordings. If you can only debug with a shell, you will eventually be stuck. More on that in how to monitor a robot policy in production.

When something is wrong with the robot itself

Remote access is also where you act when a robot is lost, stolen or looks compromised.

  • Quarantine. Cut every open session, stop the agent's modules, and accept only a small set of commands. You keep the robot reachable enough to investigate and update it, without giving a possible intruder a working channel.
  • Decommission. When a robot is retired, returned or stolen, its identity should stop working everywhere within seconds, including live sessions. Not "next time the certificate expires."
  • Revoke per robot. Because every robot has its own identity, revoking one never touches the others. If your tunnels share one key, you can't do this. You'd have to rotate the whole fleet.

I go deeper on detection and response in how to secure robots at the edge.

Rules for the team

The tooling is half of it. The other half is habits.

  • No shared accounts. Every session belongs to a named person. "ops@" is not a person.
  • A hand fix is a debt. If you changed something over SSH to get a robot working, that change goes into the next release, or you undo it. Otherwise you have one robot that nobody can reproduce. Releases are where changes live; see the OTA checklist.
  • Look first, change second. Most sessions should be read-only: logs, rates, a snapshot. If you're about to change something on a robot that is moving, tell the site first and mark the robot busy.
  • Close the session when you're done. Don't leave it to the idle timeout.
  • Never paste secrets into a remote shell. Push them as secrets the app reads, so they don't end up in shell history on a machine anyone can walk up to.

Checklist

  • The robot only connects out, over TLS. No inbound ports for management, no public IP.
  • Sessions are requested in the cloud, authorized per person, and started with a signed command for that robot.
  • Terminal, port forwarding (HTTP and WebSockets, multiplexed) and camera snapshots all go through the same relay.
  • Services on the robot bind to localhost. Forwards reach them on loopback.
  • Forward scope is decided on the robot: loopback and LAN by default, metadata addresses never, allow list for the rest.
  • Sessions have idle and maximum timeouts, and a cap per robot.
  • Every session is recorded off the robot: who, what, when, how long, bytes, end reason.
  • Customers can disable terminal and camera on the robot itself, and the cloud can't override it.
  • Interactive sessions keep working when the telemetry data budget runs out.
  • Quarantine and decommission cut live sessions within seconds.
  • Each robot has its own identity, so revoking one never touches the rest.

How we do it at PhysicalFleet

The PhysicalFleet agent connects out only, over encrypted connections, and needs no public IP. The terminal, port forwarding to any web UI on or next to the robot, and live camera all go through our relay, with every session audited. --no-terminal and --no-camera are enforced on the device, and quarantine or decommission cuts live sessions within seconds. Details on the fleet management page.

If you're running robots on networks you don't own, I'd like to hear what made remote access hard for you.

Common questions

How do I SSH into a robot behind carrier-grade NAT?

You can't connect in, because the robot has no public address. Instead, the robot keeps an outbound connection, and when you ask for a session it dials a relay that joins it with your browser or CLI. You can forward port 22 through that session and use your usual SSH tools, with no open port on the robot's network.

Are reverse SSH tunnels safe for a robot fleet?

They're usually the first thing teams build, and they get riskier as the fleet grows. Often every robot holds the same private key, the jump host becomes the most valuable machine you own, tunnels die silently, and there's no record of who connected to what. Per-robot identity, scoped sessions and an audit log solve those problems.

What should I ask customer IT to allow for remote robot access?

Outbound TLS from the robots to a short list of host names, on the ports your system uses, including MQTT if you use it. Nothing inbound. Most corporate networks already allow that, so it's one email instead of a VPN project. Ask for every port up front so you don't find a blocked one on install day.

How do I open a web UI running on a remote robot?

Bind the service to localhost on the robot and reach it through port forwarding over the robot's outbound connection. The forward should carry many TCP connections over one link and support WebSockets, since visualization tools and notebooks depend on them. On the robot, limit what forwards can reach to an allow list, and never allow cloud metadata addresses.

How do I keep a remote command running if the cellular connection drops?

Run anything that takes more than a minute inside tmux or screen on the robot, so a dropped link doesn't kill it halfway. Prefer commands that finish over interactive tools that redraw the screen, and pull files instead of paging through them. Never run a long package install in a bare session over cellular.

#remote access#NAT traversal#port forwarding#robot fleet#cellular#SSH#security
Eitan ChudnovskyCo-founder, PhysicalFleet

From the lab bench. To the entire fleet.

Connect your first machine in minutes, develop it in the lab and run your whole fleet in production from one place.

Free for up to 3 machines · Then pay as you go