Skywalker13

Diary of an ex-GeeXboX developer…

Reverse SSH tips

Posted at — Apr 4, 2013

Today I will share some tips with SSH. It is very useful every time even with crappy OS like Windows. One of the most funny feature is the TCP forwarding by Reverse SSH. For example in the case where you must connect to a SSH server and this one is behind a firewall. You have no access to the firewall because you are at work.

First one

You must connect the computer (behind the firewall) to a server available on Internet (at home).

ssh -R 8888:localhost:22 homeuser@homeip -p 8888

It will create an SSH tunnel with your computer at home. You can choose an other port; 8888 is just for the example.

Second one

At home, you can connect to your computer at work by this way :

ssh workuser@localhost -p 8888

Easy, isn’t it? Note that is possible to forward every things with SSH. All local servers in your company…

But, with Windows it’s a pain

Not really, just use Cygwin. You can install openssh-server with the packages manager. Just use ssh-host-config -y from the Cygwin terminal. Start the terminal with admin rights if necessary. A service will be installed in order to start openssh. Start the service and enjoy.

You should search on the web for more examples and tips. Here you will found the essential.