How to Configure Email Access Through an SSH Tunnel

When using public hot spots and other open, public Internet sources, remember that any data you send or receive that is unencrypted can be monitored easily and captured by attackers. Using encrypted SSH tunnels, you can create an encrypted path to a secure, trusted server that you can use as a relay for your data. This is a good practice for frequent travelers and a useful way to quickly secure everyday communication such as email and instant messaging.

Things You'll Need

  • Shell account
Show More

Instructions

  1. OpenSSH

    • 1

      Download and install OpenSSH for your operating system (see Resources).

    • 2

      Launch a terminal window or command prompt, depending on your operating system. To do this on Windows, press the "CTRL+R" key combination, type "cmd" into the box, and press "Enter" to launch the command prompt. In other operating systems, simply run the Terminal from your applications list.

    • 3

      Type "ssh -f user@safeserver.com -L 3000:emailserver.com:25 -L 3001:emailserver.com:143 -N," but do not press "Enter" yet.

    • 4

      Replace "emailserver.com" in both instances with the email server to use to connect. The "3000" and "3001" at the beginning are the ports you are going to connect to when you want to securely access your email. "-L" indicates that this is a local port forward. "25" and "143" are the ports of SMTP, the outgoing mail server, and IMAP, the incoming mail server. If your email uses a POP3 server for incoming mail, you will want to change "143" to "110."

    • 5

      Replace "user" with your user name on the shell you will be connecting to and replace "safeserver.com" with the domain name or IP address of that shell server. The "-N" option tells OpenSSH to keep from executing any commands on the remote server. Finally, press "Enter" to execute the command. Type in your password when requested to complete the connection and establish the tunnels.

    • 6

      Launch your email client and open your account preferences dialog. Change the outgoing mail settings so the domain name reads "localhost" and the port number reads "3000." Change the incoming mail settings to do the same, but with the port as "3001" instead. You will now receive mail over those secure tunnels.

    PuTTY

    • 7

      Download PuTTY from the developer's website (see Resources). Launch the application once the download is complete.

    • 8

      Enter the domain name of the shell server you will be relaying your data off of in the text-box labeled "Server." Select the "SSH" radial option and enter your account details for the remote server, including the password if you wish to save it for ease later.

    • 9

      Open the "Tunnels" dialog from the settings list on the left-hand side of the PuTTY window. Select the "Local" radial option and enter "3000" as the source port. Under "Destination," type in the name of your outgoing mail server and the port number, separated by a colon. For example, if your server was "emailserver.com," the "Destination" box would read "emailserver.com:25." Click "Add" to create the tunnel.

    • 10

      Select the "Local" radial option again and enter "3001" as the source port. Under "Destination," type in the name of your incoming mail server and the port number, separated by a colon. For example, if your server was "emailserver.com," the "Destination" box would read "emailserver.com:143." Replace "143" with "110" if you use a POP3 server instead of an IMAP server to receive your mail. Click "Add" to create the tunnel.

    • 11

      Move back to the main screen of PuTTY and click "Connect" to initiate a connection to the SSH server and create your local tunnels. Enter any account details required to complete your log in. Launch your email client and open your account preferences dialog. Change the outgoing mail settings so the domain name reads "localhost" and the port number reads "3000." Change the incoming mail settings to do the same, but with the port as "3001" instead. You will now receive mail over those secure tunnels.

Tips & Warnings

  • You can use local port forwarding to reroute your connections and circumvent restrictive firewalls.

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured