Tunnelling on the fly

I’ve just been tweaking with SSH. One of the common things that I have to do is reconfigure my SSH tunnels while I’m working remotely to gain access to desktops and the like.

In this situation, the cumbersome but easiest way always seemed to be to disconnect and change the command line. However, having used Putty I was fairly sure that there must be an easier way.

AND THERE IS!

Changing the port forwarding in ssh is as easy, if not easier, than in Putty.

While you’re connected to the host, type a tilde (~) and an uppercase C.This will open the ssh shell. Just type in your port forwarding command like you would when you are typing in the command line option. eg:

<code>-L 3389:localhost:3389</code>

to tunnel an RDP socket to the machine that you are connected to.

And that’s it! If you’re stuck, type a question mark (?) and press ‘Enter’. This will show you the options available.