Secure Shell Tunneling (SSH Tunneling)
A Secure Shell (SSH) tunnel is a service that allows users to transfer unencrypted data through an encrypted channel. When you are, for instance, at home and want to send sensitive information via your email, an SSH client will forward this information securely. To set up an SSH tunnel the port of one machine needs to be forwarded to the port of the remoted machine at the end of the tunnel. You can follow the guide below to set up your SSH Tunneling to DTU's SMTP.
Connecting to a SMTP with SSH Tunnelling
This is how you set up your SSH Tunnelling to DTU's SMTP. For Linux and Mac (and other flavors of Unix), you can set this up using the terminal, and the following command:
ssh -f sXXXXXX@login.gbar.dtu.dk -L 25:smtp.wireless.dtu.dk:25 -N
You're now able to use localhost as the SMTP server (port 25), and can send emails using the above SMTP server. The following shows how to do this using PuTTY for Windows. In PuTTY, go to Connection -> SSH -> Tunnels. Set the source port to an open port in your firewall (example: 25, which is the standard for SMTP, or 587, which is the standard for MSA). Set the destination to smtp.wireless.dtu.dk:25 Keep the settings to local and auto. Add the tunnel.
Now go to Session and type in login.gbar.dtu.dk as host name, keep port 22 and connection type SSH. You can save your session for easier access next time you have to use it. Simply add a name to "Saved Sessions" and click save.
Press Open and you'll get a terminal. Log in using your student number and password.
Now you can just minimize the terminal, you don't have to do anything in it - just be connected to it.
That being done, you have to set up your mail application.
We're keeping the example of Thunderbird in Windows here. You go to the Account Settings, under tools, and add a new SMTP.
- Here you make a description (name) of your connection.
- Set the server name to: localhost
- Set the port to the port set as source port in putty. (Example given was 25 or 587).
- Security: No connection security and no password send, and no username given.
While you're logged into the terminal from PuTTY you can now send mails by DTU's SMTP!