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.
SSH Tunneling — Two Ways
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
| Protocol | Remote Command | Local Access |
|---|---|---|
| SSH | nfltr cat serve ssh --forward localhost:22 --agent myhost | nfltr cat ssh user@myhost/ssh |
| PostgreSQL | nfltr cat serve pg --forward localhost:5432 --agent db --allow-group ops | nfltr cat forward db/pg --listen :5432 |
| MySQL | nfltr cat serve mysql --forward localhost:3306 --agent mysql --allow-group ops | nfltr cat forward mysql/mysql --listen :3306 |
| Redis | nfltr cat serve redis --forward localhost:6379 --agent redis --allow-group ops | nfltr cat forward redis/redis --listen :6379 |
| RDP | nfltr cat serve rdp --forward localhost:3389 --agent desktop --allow-group ops | nfltr cat forward desktop/rdp --listen :3389 |
| Kubernetes API | nfltr cat serve api --forward localhost:6443 --agent k8s --allow-group ops | nfltr cat forward k8s/api --listen :6443 |
| Any TCP | nfltr cat serve svc --forward localhost:<port> --allow-group ops | nfltr 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.
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
- End-to-end encryption — A service served with
--allow-grouptakes only end-to-end encrypted sessions; the server never sees their plaintext - Encrypted transport — All TCP traffic is additionally wrapped in TLS via the gRPC tunnel
- Authentication required — Both sides must authenticate with their machine certificate
- No exposed ports — The agent connects outbound; no inbound ports are opened
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 →