SSH, SFTP, and databases behind NAT
SSH into a server behind NAT, share an internal database with your team, or transfer files to an IP-allowlisted partner SFTP server — without setting up a VPN or opening router ports.
On this page13
Prontaro splits inbound and outbound TCP into two dedicated commands: prontaro tcp accepts incoming connections to your machine, while prontaro forward routes your outbound connections from your dedicated static IPv4.
Which command to choose
| Goal | Command | Minimum plan |
|---|---|---|
Connect via SSH, SFTP, or psql to your machine behind NAT |
prontaro tcp |
Tunnels (persistent port on shared IP) or Dedicated/Pro (port on your own IP) |
| Connect to an IP-allowlisted partner SFTP, SSH, or DB | prontaro forward |
Dedicated or Pro (dedicated IPv4) |
In both modes Prontaro forwards TCP traffic directly without decryption — end-to-end SSH and database TLS encryption stay intact between client and server.
Scenario 1. Inbound SSH and internal databases behind NAT (prontaro tcp)
prontaro tcp maintains an outbound TLS connection from your machine to a Prontaro node and exposes a port either on the shared Prontaro address (<entry>.tcp.prontaro.run:41283) or directly on your dedicated IP (<your-IP>:22, <your-IP>:5432).
Every new TCP tunnel starts closed to everyone. Packets from unlisted IPs are dropped by the node’s kernel filter before the TCP handshake completes and never count toward your monthly traffic allowance.
Step 1. Start the TCP tunnel on the target machine
Expose port 22 on your dedicated IPv4 (or pass --to shared on Tunnels for a fixed port on the shared address):
prontaro tcp 22 --name office-ssh --to 203.0.113.10
Tunnel office-ssh ● connected
Address 203.0.113.10:22 → 127.0.0.1:22
Access closed (as of launch)
Server <server> · <region> · 18 msThe same pattern works for internal databases or another host on your LAN:
# Local PostgreSQL on port 5432 of your dedicated IP
prontaro tcp 5432 --name office-pg --to 203.0.113.10
# SSH to another LAN machine (10.0.0.15:22), published on port 2222
prontaro tcp 10.0.0.15:22 --name lan-ssh --to 203.0.113.10:2222Step 2. Allow only trusted IPs
In an interactive terminal, the CLI prompts to open the port for your current IP right away. You can update the allowlist at any time from the CLI or dashboard:
- Open Tunnels, select
office-ssh, and switch to the Access tab. - Add the allowed IPv4 addresses or CIDRs and click Save.
# Open the port for a single public IPv4 address
prontaro access office-ssh allow 198.51.100.7
# Or for a static office CIDR
prontaro access office-ssh allow 198.51.100.0/24
# Close the port immediately when you finish
prontaro access office-ssh closeStep 3. Connect via SSH, SFTP, and psql
# On your dedicated IPv4
ssh admin@203.0.113.10
sftp admin@203.0.113.10
# On a shared TCP port (Tunnels plan)
ssh -p 41283 admin@<entry>.tcp.prontaro.run
# To an internal PostgreSQL database
psql "postgresql://app@203.0.113.10:5432/prod?sslmode=require"Step 4. Run the tunnel as a system service
Install the tunnel as a background service (systemd on Linux or launchd on macOS) so it comes back automatically after reboots:
prontaro service install -- tcp 22 --name office-ssh --to 203.0.113.10For SSH access, also disable password logins in /etc/ssh/sshd_config (PasswordAuthentication no, SSH keys only) and keep the IP allowlist as narrow as possible.
Scenario 2. Outbound SFTP, SSH, and database connections to an IP-allowlisted partner (prontaro forward)
When a partner SFTP server, bastion host, or cloud database only accepts connections from your static IP (/32) and you are connecting from a laptop, dynamic-IP office, or CI runner, use prontaro forward.
It opens a local listener (on 127.0.0.1 by default) and forwards traffic over TLS (port 443) to your Prontaro entry node, where the connection exits to the partner from your static IP.
Step 1. Add your static IP to the partner allowlist
Give the partner your dedicated IPv4 (/32) from IP addresses in the dashboard.
Step 2. Forward the partner port to 127.0.0.1
prontaro forward 2222 sftp.partner.example.com:22 --ip 203.0.113.10
prontaro forward 2222 sftp.partner.example.com:22
127.0.0.1:2222 → sftp.partner.example.com:22 from your IP 203.0.113.10(You can omit --ip if your account has a single dedicated IP.)
Step 3. Connect with HostKeyAlias
Pass -o HostKeyAlias=sftp.partner.example.com so OpenSSH records and verifies the partner’s real host key in ~/.ssh/known_hosts instead of binding it to 127.0.0.1:
sftp -P 2222 -o HostKeyAlias=sftp.partner.example.com partner-user@127.0.0.1
ssh -p 2222 -o HostKeyAlias=sftp.partner.example.com partner-user@127.0.0.1To skip repeating flags — and let rsync, scp, and SFTP clients work out of the box — add an entry to ~/.ssh/config:
Host partner-sftp
HostName 127.0.0.1
Port 2222
User partner-user
HostKeyAlias sftp.partner.example.com
IdentityFile ~/.ssh/id_ed25519_partnerThen run sftp partner-sftp or rsync -avz ./export/ partner-sftp:/incoming/.
Remote databases behind an IP allowlist work the same way:
prontaro forward 15432 db.partner.example.com:5432 --ip 203.0.113.10
psql "postgresql://app@127.0.0.1:15432/prod?sslmode=require"Limits and notes
- TCP and IPv4 only. UDP and IPv6 are not supported by
prontaro tcporprontaro forward. - Up to 100 TCP ports per dedicated IP. Port
443on a dedicated IP can serve either one TCP tunnel or HTTPS tunnels, not both at the same time. - Active sessions during failover. A server reboot or outage with BGP failover preserves your IP, but existing SSH and database TCP sessions drop and must reconnect to the standby node. Routine Prontaro server updates do not drop them.
- Database TLS hostname check (
verify-full). When connecting to127.0.0.1:15432overprontaro forward, the certificate matchesdb.partner.example.com, not127.0.0.1— set the expected hostname in your driver.
Common errors
| Symptom | Cause | Fix |
|---|---|---|
Connection to prontaro tcp times out |
New TCP tunnels start closed to everyone by default. | Run prontaro access <name> allow 198.51.100.7 (replace with the required IP or CIDR), or open access in the dashboard (Tunnels → Access). |
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED on 127.0.0.1 |
Another SSH host previously used the same local forwarded port. | Always pass -o HostKeyAlias=<real_host> or configure ~/.ssh/config. |
| SSH or DB connection drops immediately | Local service is not listening or --proxy-protocol is enabled. |
Check the local listener (ss -tlnp) and remove --proxy-protocol for sshd/DBs. |
403 destination_denied in prontaro forward |
Destination belongs to a private range (RFC 1918, loopback) or uses a blocked mail port (25, 465, 587). |
Point forward to a public partner IPv4/domain and allowed port. |
Next steps
- TCP tunnels — full reference for inbound TCP tunnels and ports.
- Access control & firewalls — configure IP allowlists for TCP ports.
- Local port forwarding (prontaro forward) — full reference for outbound port forwarding from a static IP.
- Background services (Linux & macOS) — run tunnels as a system service with auto-start.
- Security, TLS, and production checklist — encryption best practices and production hardening.
Something wrong on this page? Contact us