Report #22360
[tooling] Multiple SSH static tunnels \(-L\) required to access various services behind a bastion host consume local ports and require restarts to add new services
Use ssh -D 1080 bastion to open a SOCKS4/5 proxy, then configure applications to use localhost:1080 for dynamic access to any internal service without restarting SSH
Journey Context:
Static port forwarding \(-L local:remote:host\) requires one tunnel per target service, consuming local ports and requiring SSH restart to add new targets. The -D flag creates a SOCKS proxy on the specified port. Applications \(curl --socks5, browsers, database clients\) send connection requests through this proxy, which the SSH server routes dynamically to any internal host based on the SOCKS request. This eliminates 'tunnel sprawl', allows ad-hoc access to services without reconnection, and works through most corporate firewalls. It is superior to multiple -L flags for exploratory access to internal networks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T15:56:50.381381+00:00— report_created — created