RemoteForward — expose a local service to the remote
The mirror image of LocalForward. -R remote-port:host:port opens a port on the remote machine that tunnels back to a target reachable from your machine. Use case: your dev server is running locally, and you want a colleague (on the remote machine) to reach it without you exposing it to the public internet.
DynamicForward — a SOCKS proxy through SSH
-D local-port opens a SOCKS proxy on your local port. Anything that uses that proxy — your browser, curl with --socks5-hostname, system-wide proxy settings — gets tunneled through the SSH connection and exits to the wider network from the SSH server's vantage point. This is essentially a quick-and-dirty VPN that requires no extra software.
The three forwards in one table
| Type | Flag | Direction | Use case |
|---|---|---|---|
| Local | -L | local → remote | Reach a remote service privately from your laptop |
| Remote | -R | remote → local | Expose a local service to a remote host |
| Dynamic | -D | SOCKS proxy | Route arbitrary traffic through the SSH connection |