How to access your Mac remotely without port forwarding
The textbook way to reach your home computer from outside is to forward a port on your router. It's also the option most likely to be impossible on your connection and the one most likely to get you attacked. Here's why, and the four alternatives that work without opening anything on your router.
Why port forwarding is a problem
Port forwarding tells your router: "send anything that arrives on this port to my Mac." Two things go wrong:
- It's often impossible. Many internet providers, and nearly all mobile and many fiber providers, put customers behind carrier-grade NAT (CGNAT): your router doesn't have a public IP address of its own, it shares one with other customers. Forwarding a port on your router does nothing, because traffic from the internet never reaches it.
- It's exposed to everyone. A forwarded port is reachable by the whole internet. Automated scanners find an open SSH or remote-desktop port within minutes and start guessing passwords. One weak password or unpatched service is all it takes.
Are you behind CGNAT?
Compare two addresses. First, the address the internet sees:
curl -s https://ifconfig.me; echo
Then the WAN or Internet address on your router's status page. If they're different, or the router's address starts with 100.64 to 100.127 (the range reserved for CGNAT), incoming connections can't reach you however you configure the router.
The trick all the alternatives use
Your Mac can't receive connections from the internet, but it can make them, just as it does when it loads a website. Every option below has the Mac connect out to something reachable, then carries your traffic back over that connection. Nothing listens on your router, and CGNAT doesn't matter.
1. A mesh VPN
Tools like Tailscale, ZeroTier or Netbird (most built on WireGuard) put your devices on a private network that works across the internet. Install the app on your Mac and your phone, sign in, and each device gets a private address that reaches the others from anywhere. The devices try to connect directly, and fall back to the vendor's relay servers when a direct path isn't possible.
- Good: reaches everything on the Mac (SSH, screen sharing, a dev server), encrypted end to end, quick to set up.
- Consider: it's an account with a networking provider, a VPN profile on your phone, and access to all your devices is only as safe as that account.
2. A reverse SSH tunnel
If you already rent a small server with a public address, your Mac can open a tunnel to it:
ssh -N -R 2222:localhost:22 you@your-server.example.com
Now port 2222 on the server leads to your Mac's SSH. From your phone, connect to the server and jump through:
ssh -J you@your-server.example.com -p 2222 macuser@localhost
- Good: no third-party service, just SSH, which you already trust.
- Consider: you run and secure a server; the tunnel needs something like
autosshor a launchd job to reconnect after sleep or network changes; and it only carries what you tunnel.
3. A tunnel service
Services like Cloudflare Tunnel or ngrok run a small agent on your Mac that connects out to their network and publishes a service through it. They're built mainly for sharing web apps: a quick way to show a dev server to someone is
cloudflared tunnel --url http://localhost:3000
which prints a temporary public https:// address. For SSH, they usually need their own client or configuration on the connecting side too.
- Good: great for web apps and webhooks; the service handles HTTPS.
- Consider: anything published is reachable by whoever has the address unless you add their access controls. Their servers terminate the tunnel, so for plain web traffic they can see it.
4. An app with its own relay
Some apps build the "connect out" trick in for one job, so you don't set up networking at all. Remote desktop and file sync tools have worked this way for years. The question to ask is whether the relay can read what it carries.
That's how PandaSend Terminal reaches your Mac's terminal sessions from a phone. The Mac connects out to PandaSend's relay, and so does your phone's browser. The relay passes traffic between them, but it's encrypted end to end with keys only your phone and your Mac hold, so the relay sees ciphertext, not your commands or output. Nothing is opened on your router, it works behind CGNAT, and there's no VPN to install on the phone. The details are in how an end-to-end encrypted terminal relay works.
- Good: nothing to configure, and nothing exposed.
- Consider: it reaches that app's feature (here, terminal sessions), not your whole Mac.
Choosing
| Option | Works behind CGNAT | Setup | Reaches |
|---|---|---|---|
| Port forwarding | No | Router settings, then hardening | The forwarded service |
| Mesh VPN | Yes | An app and account on each device | Everything on the Mac |
| Reverse SSH tunnel | Yes | Your own server, plus a reconnect job | What you tunnel |
| Tunnel service | Yes | An agent on the Mac, plus access rules | What you publish |
| App with a relay | Yes | Install the app | That app's feature |
Whatever you choose, remember that a sleeping Mac answers nothing: see how to keep your Mac awake from the terminal. And if SSH is your route, set it up with keys: SSH into your Mac from your iPhone, step by step.