PortForwarding

Basic SSH port forwarding creats a tunnel from your local machine to a remote machine (1) and out to another machine (2). This lets you connect to your own machine on a chosen port and have it appear as if you have connected directly to the remote machine (2). Machine 2 sees the connection as coming from machine 1.

The two important values are the local port and the remote host & port. The example used in the lesson was to open a tunnel to the skynet proxy from skynet.ie on port 3128.

On a unix based OS the command was: ssh -L 3128:proxy.skynet.ie:3128 skynet.ie -N

To break it down: ssh starts your ssh client. -L is the flag to create a tunnel. 3128 is the port to open on your own computer (this can be any port). proxy.skynet.ie is the remote host to connect to. 3128 is the port on the remote host, this is specific to the service you want to access (squid proxy in this case). skynet.ie is machine (1), the intermediary machine. SSH access is needed. -N tells ssh not to bother opening a login shell.

Once this is done, you can tell your browser to use localhost:3128 as your proxy server and the connection will be tunnelled through skynet.ie, proxy.skynet.ie and out onto the web.

last edited 2012-01-31 00:46:33 by 87-198-126-243