Modern infrastructure rarely lives in one place. Some servers run in the cloud, others sit on an office LAN, and a few inevitably end up at home. They span Linux and Windows, different networks, different trust boundaries.
The traditional answers—opening SSH or RDP ports, managing VPNs, sharing keys—are functional but fragile. They add operational overhead, expand your attack surface, and age poorly as environments grow.
This article documents the approach I’ve standardized on: Cloudflare Zero Trust Tunnels using cloudflared. It’s the same model I now use across all my environments.
Each server establishes an outbound‑only connection to Cloudflare’s edge. There are no inbound firewall rules and no public IP exposure.
Access is enforced at Cloudflare’s Zero Trust layer:
If Cloudflare doesn’t explicitly allow the request, the service effectively does not exist.
This setup is currently running across 10+ servers distributed between cloud instances, office networks, and home infrastructure. It’s used both for administrative access (SSH, RDP) and for selectively exposing private services to trusted users.
This setup is designed with a specific threat model in mind.
Within these assumptions, Zero Trust Tunnels significantly reduce exposed attack surface while keeping operational complexity low.
cloudflaredLinux:
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.debWindows:
cloudflared tunnel loginThis associates the machine with your Cloudflare Zero Trust account.
I keep tunnels aligned with physical or logical locations:
cloudflared tunnel create colombo-lanThe same pattern applies for office networks or cloud environments.
Example /etc/cloudflared/config.yml:
tunnel: colombo-lan
credentials-file: /etc/cloudflared/colombo-lan.json
ingress: - hostname: ssh.home.pasindudissan.xyz service: ssh://localhost:22 - hostname: rdp.office.pasindudissan.xyz service: rdp://localhost:3389 - service: http_status:404
warp-routing: enabled: trueEach hostname maps cleanly to a private service. And if you aren't a non-technical person you can even use Cloudflare's dashboard and achieve a good enough setup without having to write maintain or manage config files. No port forwarding, no NAT gymnastics.
cloudflared as a servicecloudflared service install
systemctl start cloudflaredFrom the Cloudflare dashboard:
This is where authorization lives. The server itself remains unreachable from the public internet.
With the WARP client running on my laptop or workstation, access is transparent.
SSH:
ssh user@ssh.home.pasindudissan.xyzRDP:
rdp.office.pasindudissan.xyz as you would on a local network.Traffic is authenticated by identity, not IP addresses or shared secrets. The same configuration scales cleanly across AWS, on‑prem, and home networks without additional complexity.
VPNs solve connectivity by extending the network boundary. That works, but it introduces problems that compound over time.
Over-broad access
Once connected, clients typically gain visibility into far more of the network than intended.
Credential and key sprawl
Shared secrets, long-lived keys, and stale client configurations accumulate quickly.
Operational friction
Split tunneling, DNS inconsistencies, client compatibility issues, and routing conflicts are common.
Poor fit for mixed environments
Home networks, office LANs, and cloud VPCs behave differently, and VPNs tend to leak those differences.
Zero Trust Tunnels invert this approach. Instead of granting network access, they publish a single service behind identity- and device-aware policies. There is no concept of being “on the network”—only being authorized for an application.
This setup has been running continuously for months. Family members access private services like Nextcloud without a single router‑level port forward.
This article ties into my broader self‑hosting and infrastructure notes:
If you’re managing access across mixed environments, the biggest win here isn’t just security—it’s consistency. Every network behaves the same, regardless of where it lives.
If one part of your infrastructure still feels painful to access remotely, that’s usually the best place to start tightening things up.