termal.in

← Blog

SSH into a device behind 4G/LTE (CGNAT), with no public IP

· Termalin Team iotcellularcgnatconnectorremote-access

You have a device on a cellular link — an LTE gateway, a remote sensor box, a signage player on a 4G SIM, a vending terminal in the field — and you need to reach it over SSH. You try the usual port forward and there’s nothing to forward: the SIM has no public IP. Dynamic DNS doesn’t help either. This is almost always carrier-grade NAT, and the fix is to have the device dial out. Here’s how to reach a device behind a cellular link from a browser or an AI agent, with no public IP and no open port.

Why a SIM has no port you can forward

Mobile networks hand almost every device a private address behind carrier-grade NAT (CGNAT). Many subscribers share one public IP at the carrier, and you don’t control the device that holds it. So:

  • There’s no port on “your” address to forward — the router you can configure isn’t the one on the public internet.
  • A static IP add-on from the carrier is sometimes sold, often expensive, and still doesn’t solve the device being behind NAT without extra tunneling.
  • Dynamic DNS points a name at the shared carrier IP, which gets you nowhere.

Inbound simply isn’t available on cellular. The one direction that always works is outbound: the device opens a connection to something reachable and you ride it back in. That’s how every option below is shaped, and it’s the whole reason it works through CGNAT.

One outbound Connector

A Termalin Connector is a small static binary that dials out to Termalin over a single HTTPS/WebSocket connection (port 443, the one a locked-down APN still allows) and holds it open. It never listens on a port, so there’s nothing for the carrier’s NAT to block. On the device:

curl -fsSL https://termal.in/i/<token> | sudo sh

It enrolls the device, installs a service — systemd, OpenRC, runit, or procd on an OpenWrt-based gateway — and connects. On a thin gateway that only gives you a shell, the same line runs without root and a cron watchdog keeps it alive.

Two things make it a good fit for cellular specifically:

  • It’s tiny. 3.6–5.2 MB depending on the processor (arm64, ARMv7, MIPS, x86, RISC-V), a static musl binary with no dependencies — it won’t strain a low-power gateway or a constrained image.
  • It reconnects itself. Cellular links drop, towers hand off, modems reset. The Connector restarts after a crash and after a reboot, and re-dials when the link comes back — you don’t have to be there to restart anything.

No key on a device you can’t reach to wipe

A device in the field is one you can’t quickly re-image if it’s lost or tampered with. Enrollment makes the device’s sshd trust Termalin’s SSH certificate authority, and every login uses a short-lived certificate scoped to your account — there’s no long-lived private key stored on the device to extract. The Connector moves opaque SSH bytes between Termalin and the device’s own sshd; it never sees your credentials or session plaintext.

What you reach through it

  • A web terminal to a real SSH session — from a laptop or a phone, wherever you are. See the web SSH client.
  • The gateway’s own admin page, or a device on the network behind it, at a private address through internal sites — no port published to the mobile network.
  • An AI agent. Point Claude, ChatGPT or Cursor at the device through the hosted MCP endpoint to check status, pull logs or apply an update — keyless and audited. For many such devices at once, see managing an IoT fleet with AI over MCP.
  • Monitoring and alerts for a box with no open port — you find out a remote gateway’s disk is filling before it goes dark.

Honest about the edges

  • It’s through Termalin’s hosted side, not a raw ssh you@… from your laptop. You reach the device from the web terminal, the desktop/iOS apps, or an agent. If a plain local terminal is the requirement and you already rent a VPS, a reverse SSH tunnel fits — see SSH reverse tunnels explained.
  • Metered data. When idle the link is a single kept-alive WebSocket, which is light, but Termalin’s monitoring runs read-only checks about once a minute, and terminal or file traffic uses whatever it uses. On a tightly metered SIM that’s worth knowing; monitoring can be turned off per device if you want the link quiet.
  • The Connector needs Pro or the 14-day trial.

The one principle

Never try to open an inbound port on a device you can’t accept connections to — on cellular you can’t anyway. Let it reach out, and ride that connection back in. The same reversal reaches a server behind home NAT, a router, or a Pi; the full set of approaches, with trade-offs, is in SSH behind NAT or CGNAT without port forwarding, and the home-device version is Raspberry Pi remote access without port forwarding.


Termalin is a free, cross-platform SSH client with a web terminal and a keyless Connector for devices behind NAT, CGNAT and cellular links — download it, or read the security model.

Try it on one host.

Termalin is a fast SSH client for you — and your agents.

Free tier · 14-day Pro trial · pricing

Add Termalin as a preferred source on Google