SSH Port Forwarding Explained: Local, Remote and Dynamic Tunnels With Examples
The article explains the three SSH port forwarding modes, -L, -R and -D, and notes that the direction of each tunnel depends on which side opens the listening socket. Local forwarding (-L) lets a laptop reach a service behind a bastion host, with hostname resolution happening on the server. Remote forwarding (-R) exposes a local service on the remote machine, though public binding requires enabling GatewayPorts on the server. Dynamic forwarding (-D) creates a SOCKS5 proxy that routes traffic for many internal hosts through the bastion. The piece also covers ProxyJump for multi-hop connections and keepalive settings or autossh to keep tunnels from dropping.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in