Creating and using tunnels

Discussion

One reason to use a tunnel is to access some service across the internet. One way to do that is via a SSH tunnel. Assume you have ptop running on a remote server on port 3000. ptop produces html graphs and data which you want to access locally. You can access the data securely in two easy steps.

  1. ssh -L 1234:localhost:3000 ip.of.remote.server
  2. browse to http://localhost:1234

The command is

	ssh -L bind_address:port:host:hostport

which specifies that the given port (1234) on the local (client) host is to be forwarded to the given host and port (3000) on the remote side. Whenever a connection is made to port 1234, the connection is forwarded over the secure channel, and a connection is made to host hostport on the remote machine. The bind_address of "localhost" indicates that the listening port be bound for local use only.

A SSH tunnel requires no additional software to be installed on either the server or the client, unlike openvpn.


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site
Many thanks to Debra and Ian Murdock for making Debian possible
First created Apr 22, 2008 ~ Last revised February 03, 2010

Valid XHTML 1.0 Strict Valid CSS!