TCP & SSH Tunneling Core

Forward any TCP protocol — SSH, databases, RDP, custom protocols — through a secure gRPC tunnel. Access remote machines via native SSH, or forward any port to your machine.

Tutorials: SSH to a machine behind NAT · Reach a private LAN · Diagnose connection problems


How TCP Tunneling Works

TCP tunneling wraps raw TCP connections inside NFLTR's encrypted gRPC transport. The agent connects to a local TCP port (e.g., SSH port 22) and relays all traffic through the tunnel. The machine that has the service runs nfltr cat serve, which names the service; the other side runs nfltr cat forward to establish a local listener that forwards to it.

REMOTE MACHINE nfltr cat serve (ssh) SSH daemon (sshd) PostgreSQL (:5432) NFLTR SERVER Encrypted gRPC Tunnel TCP Stream Multiplexing YOUR LAPTOP ssh user@remote rdp localhost:3389 psql -h localhost

SSH Tunneling — Two Ways

⚠️ Prerequisite

With --forward localhost:22 the target machine needs its own SSH server (e.g. sshd) on that port; the NFLTR agent proxies its traffic. nfltr cat serve ssh --ssh serves an embedded SSH server instead (keys only; the machine enrolled with nfltr org join).

1. Native SSH Proxy

Use NFLTR as an SSH ProxyCommand. This integrates seamlessly with your existing SSH configuration — agent forwarding, keys, configs all work normally:

# On the remote machine
nfltr cat serve ssh --forward localhost:22 --agent raspberry-pi   # SSH encrypts end to end itself

# On your laptop — connect via native SSH
ssh -o ProxyCommand="nfltr cat pipe --plain %h/ssh" pi@raspberry-pi

2. Port Forwarding

Forward any remote TCP port to a local port on your machine:

# On the remote server
nfltr cat serve pg --forward localhost:5432 --agent db-server --allow-group ops

# On your laptop — PostgreSQL appears on localhost:5432
nfltr cat forward db-server/pg --listen :5432
psql -h localhost -p 5432 -U myuser mydb

Supported Protocols

ProtocolRemote CommandLocal Access
SSHnfltr cat serve ssh --forward localhost:22 --agent myhostnfltr cat ssh user@myhost/ssh
PostgreSQLnfltr cat serve pg --forward localhost:5432 --agent db --allow-group opsnfltr cat forward db/pg --listen :5432
MySQLnfltr cat serve mysql --forward localhost:3306 --agent mysql --allow-group opsnfltr cat forward mysql/mysql --listen :3306
Redisnfltr cat serve redis --forward localhost:6379 --agent redis --allow-group opsnfltr cat forward redis/redis --listen :6379
RDPnfltr cat serve rdp --forward localhost:3389 --agent desktop --allow-group opsnfltr cat forward desktop/rdp --listen :3389
Kubernetes APInfltr cat serve api --forward localhost:6443 --agent k8s --allow-group opsnfltr cat forward k8s/api --listen :6443
Any TCPnfltr cat serve svc --forward localhost:<port> --allow-group opsnfltr cat forward <where>/svc --listen :<port>

SSH Config Integration

Add NFLTR as a permanent SSH proxy for specific hosts in ~/.ssh/config:

# ~/.ssh/config
Host raspberry-pi
    HostName raspberry-pi
    User pi
    ProxyCommand nfltr cat pipe --plain %h/ssh

Host office-server
    HostName office-server
    User admin
    ProxyCommand nfltr cat pipe --plain %h/ssh

Now ssh raspberry-pi works from anywhere — no VPN, no port forwarding.

End-to-End Encryption (E2EE)

A service served with --allow-group is end-to-end encrypted in organisation mode: the NFLTR server only relays opaque ciphertext and never sees your plaintext traffic. Without --allow-group the sessions are plain to the relay.

CLIENT TLS handshake with agent NFLTR SERVER Relays opaque ciphertext — zero plaintext visibility AGENT Terminates TLS, forwards plaintext

Default Behaviour

E2EE works in organisation mode: both machines are enrolled in your organisation (nfltr org join, see the organisation enrolment guide), the agent names the groups whose machines may connect with --allow-group, and each side checks the other's organisation certificate. The relay holds neither key. An enrolled client opens organisation-mode sessions by default; a machine that is not enrolled is refused (exit 4, ERROR_REASON_E2EE_REQUIRED), and a machine outside the allowed groups gets exit 10 (e2ee_client_refused).

# Agent side (an enrolled machine named my-db)
nfltr cat serve pg --forward localhost:5432 --agent my-db --allow-group ops

# Client side (an enrolled machine in group ops)
nfltr cat forward my-db/pg --listen :5432
psql -h localhost -p 5432 -U myuser mydb

Plain services

If your protocol already handles its own encryption (e.g., SSH), serve it without --allow-group; the sessions are then plain to the relay, and clients reach the service with --plain:

nfltr cat serve ssh --forward localhost:22 --agent my-ssh

Security

💡 SCP & SFTP work too

Since NFLTR acts as a transparent TCP proxy, scp and sftp work with the same ProxyCommand. The dashboard also generates ready-to-use SCP commands for each connected agent.

Ready to tunnel TCP?

Forward SSH, databases, or any TCP protocol in seconds.

Install the CLI Dashboard →