Skip to content

SSH into servers behind NAT without port forwarding

Manage servers inside your own or your customers’ private networks without a VPN, public IP, or an incoming SSH port on their router.

You need Node.js 26.7 or later and a Tubu API key on the publisher machine. Follow the Quick start to get your key. Replace YOUR_API_KEY and choose an available Tubu domain in the examples. The publisher must reach the target service and connect outward to Tubu. Keep it running while access is needed.

The server is only reachable inside a private network

You need a terminal session for maintenance, deployment, or debugging, but the server has no public IP. Run a Tubu publisher on the server or another authorized machine that can reach its SSH port. Your computer also needs Node.js 26.7 or later and an SSH client.

Publish SSH from inside the customer network

Replace the private IP with your SSH server’s address:

npx tubu-cli tcp tcp://192.168.1.50:22 --domain customer-ssh.tubu.dev --authtoken YOUR_API_KEY

Wait for Tunnel ready. The publisher reaches the internal SSH service through the LAN and connects outward to Tubu. No incoming router port is needed.

Connect from your computer with your SSH client

npx tubu-cli forward 2222 --domain customer-ssh.tubu.dev

After Listening, open another terminal and replace alice with your SSH user:

ssh -p 2222 alice@127.0.0.1

Verify the SSH host key against the target server before authenticating. Expect a shell on the internal server. SSH keeps its own encryption and authentication; the caller does not need a Tubu API key.

Keep both Tubu processes running. If local port 2222 is occupied, choose another port in both commands. If SSH fails, check the target from the publisher machine. Stop both Tubu processes when finished.

Get started with Tubu