You probably already know how to use SSH to securely log in toremote hosts over the Web. In this article, take things a little further byusing SSH to encrypt connections to other ports as well. Scenarios coveredinclude securing your mail server connection so that your mail password isalways protected and creating secure pathways through firewalls for trustedhosts.
SSH also allows you to do the reverse - forward connections made to a port on the remote host to the local host, or some other host.
In order to better understand this, let's look at another example. Suppose I wanted all connections made to port 9000 on the remote host "brutus" to be forwarded to port 80 (the Web server port) on my local machine "olympus". Here's how:
Once SSH connects and logs me in, it will automatically set up a listener on port 9000 on the host named "brutus". All connections to this port will then get forwarded to port 80 on the host named "olympus" (my local host).
You can verify this by logging in to "brutus" and attempting a telnet connection to port 9000:
[me@brutus] $ telnet localhost 9000
Trying 127.0.0.1...Connected to localhostEscape character is '^]'.GET /some.file.html HTTP/1.0HTTP/1.1 404 Not FoundDate: Fri, 28 Mar 2003 06:11:36 GMTServer: Apache/1.3.20 (Unix) PHP/4.0.6Connection: closeContent-Type: text/html; charset=iso-8859-1