LinuxDig.Com Technology Articles Your Linux News and Resource Site
LinuxDig.Com Linux Article: The Secret World of Putty and SSH Tunnels
Author: HumanX | Tuesday April 20, 2004
Your Linux box is sadly out of reach and you desperately want to spend some quiet time with your favorite Penguin. Privacy is key, you want encrypted communications and you are stuck on a windows box. Enter Putty.
Putty is a freeware SSH client for Microsoft Windows and supposedly *nix (though I have not used it). The SSH portion of Putty is a stable application which once connected will remain connected for weeks on end, assuming no network interruptions. Putty is probably one of the most reliable freeware applications for SSH and the Windows platform. Best of all, it comes with a horde of options and it is free!
One of the best options available for Putty if the ability to create secure SSH tunnels from your Windows box to your Linux box. It is a simple process that only requires a couple of changes on your Linux server and you are ready to go.
Download Putty from http://www.chiark.greenend.org.uk/~sgtatham/putty/ . In the session window type the IP address of the server you would like to connect to and then click the SSH radio button.
Now in the navigation window, click “Tunnels”. At the bottom of the screen you will see the “Add new forwarded port”. Add port “110” (pop) and in the destination type “:110” and then click add. Ensure the “Local” radio button is selected.
Example Destination: 192.168.1.2:110
In the navigation window click “Session” and then click “Open” which will then connect you to your server. Type in the Login information and finalize the connection.
Finally, open you mail client and modify the pop server for the connection. Set the server address to 127.0.0.1 and the port can be left at 110.
Check your mail in what is now an encrypted session. This also work with SMTP, IMAP, FTP, WEB and more.
Important Note 1: FTP session only encrypts the command stream, not the data stream. Your login and password are encrypted but not the data you upload or download.
Import Note 2: You must have port forwarding enabled on your Linux box in the sshd configuration file. This file depending on your distro could be found in /etc/sshd.conf. The config file should have information there to help you configure port forwarding which only requires a couple of changes. Do not forget to restart the sshd service.
Also, if you run a mail server on your windows box you obviously cannot configure the Putty source port to 110 or 25. The source port can be any number you like just as long as the destination port you connect to for the service is correct.
To close, putty is a fantastic Windows application which gives you the ability to connect to your *nix box in not only a secure shell but will also secure you internet applications. This free application is as commercial as any purchased program and comes with a variety of options that will meet your SSH needs. Putty is not only limited to the services presented in this article. Putty serves to fulfill a variety of needs and I strongly recommend you to read the documentation so you can take full advantage of Putty.