llemarie’s weblog

Programming, tinkering – Lionel Lemarié

Programming: ezTunnel SSH – Port Forwarding Made Easy

Posted by llemarie on November 25, 2007

Update: Windows and Linux binaries, as well as open-source code under GPL are available here.

The freeware “ezTunnel SSH” is a GUI application for Windows and Linux that makes it easy to manage multiple SSH tunnels in the background. The interface is simple: creating a tunnel takes a few seconds, connecting to an existing tunnel is instant!

“Why would I want to do that?” you might ask… To make a secure connection to your home or to your office of course! If you wanted to control your home computer via Remote Desktop from work for example, you certainly don’t want to open port 3389 on your home firewall! Instead you set-up an SSH server at home (with a Linux box, or using cygwin under Windows, it’s easy either way) then you “tunnel” your connection via the port 22 (default for SSH) and you don’t have to open any other ports on your firewall. With one SSH server on your home network, you can access any computer on your network simply by creating a tunnel to it.

Now imagine you want to securely control your home PC from anywhere in the world, stream your home MP3s (using Jinzora, it’s brilliant), occasionally connect to a secure server at work, punch a hole through a local firewall administrated by somebody else, etc… That will take a few tunnels to set-up. No worries: with ezTunnel SSH it only take minutes and it all sits in one icon in the system tray.

Simply put, a tunnel works this way:

  • Tell it where the SSH server is (this is your home address, probably a static IP from your ISP or a dyndns address).
  • Tell it which computer you want to access on your home network (this is the internal IP, probably 192.168.0… ).
  • Specify the remote port (for remote desktop that’s 3389, for a web server it’s 80, etc…).
  • Choose a local port (that’s your choice, I tend to use ports in the 5000-6000 range).
  • Start the tunnel and connect to “localhost:5000” (if you chose 5000 as the local port).

That’s it, now you can access all your home computers from anywhere completely securely!

Get “ezTunnelSSH” for free here.

8 Responses to “Programming: ezTunnel SSH – Port Forwarding Made Easy”

  1. James Burns said

    Bonjour Lionel!

    Now would Steve appreciate you and your little side project 😉
    Next feature to add would be Instant Messenger support :p


  2. Hans O. Martinsen said

    Is it possible to do only Dynamic forwarding?
    Another question. Would you be able to start it in “minimized to systray mode”?

  3. llemarie said

    Hi Hans,

    You can add dynamic port forwarding parameters in “Extra Arguments”, those will be appended as is on the plink command-line.
    You can leave the local port, remote host and port fields empty. You’ll get an error when you connect because it tries to open port 0, but you can ignore that.

    To start minimized in the system tray, create a shortcut of the application, edit the Windows properties of the shortcut and choose “Run: minimized”.

    Hope this helps,

    • Hans O. Martinsen said

      Thanks for a promt and very helpfull answer. I was a vouple of hours into your sourcecode for 0.7.4, and looking into the run_as_minimized option. But I have litte knowledge of C++ and I should of course have tested the minimized option on shortcuts, and relized you have mapped that to “trayification”. 😉

      Another question. Is there a way to make sure that it does not remember my password and keeps it in memory, but only gives it to plink, and then removes it from memory?

      – HansO

      • llemarie said

        Hi HansO,

        There is no option to forget the password after passing it to plink. Currently it keeps it in memory until the application quits.


  4. Kishore said

    Its simple but very useful, thanks!. Is there any way I can list the local port numbers as I need to setup atleast 100 tunnels with unique port numbers.


    • llemarie said

      Hi Kishore,

      Glad you’re finding it useful. The tool doesn’t support multiple tunnels in the GUI, but you can add additional tunnel parameters in “Extra Arguments”. I would recommend typing all the tunnels into a text file and pasting the line into the Extra Arguments.

      I’ve not tried 100 tunnels, so I don’t know if plink supports that many at a time. Windows also has a limitation on the number of characters passed on the command line, so you may be limited this way as well.

      If you have so many tunnels to maintain, have you considered the SOCKS proxy feature of ssh? With -D you can open ports dynamically without specifying them all in advance. See the plink (or ssh) documentation for details.

      Best regards,

  5. Kishore said

    Thanks so much Lionel for such a prompt response. I have many servers and I need to set tunnel for each one. Is there anyway to list all saved local port numbers of servers so that I can set a unique port for a new server.

    I am a newbie to SSH, will definitely go through SOCKS proxy feature.

    Thanks again!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: