SSH Tunnel

Create a local port forward with ssh -L to reach a service on a remote network.

1 min read Updated

A local port forward created with ssh -L: traffic sent to localhost:80 is tunnelled through the SSH server to example.com:80. This is the quickest way to reach a service that is exposed only on a remote network. The command is below.

Reference: https://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html

tunnel.sh

bash
ssh -nNT -L 80:example.com:80 user@example.com

Search articles

Type to filter articles. Use the arrow keys to move through results and Enter to open one. Press Escape to close.