Monday, February 7, 2011

Cygwin: Making a ssh connection with tunnels to your server

To make a ssh connection to a linux server, do the following:
Start by loading Cygwin: Start a cmd prompt and load Cygwin:
C:\folder>loadcygwin (the script is described here).

the run the ssh connect command:

This will prompt for your password before allowing the connecntion. Voilá!

If you want to take advantage of one of the strengths of ssh, namely the tunnels run the command as:
C:\folder>ssh -L 123:remotehost:456

which will open port 123 locally (on your computer/localhost) which is tunneled to port 456 on the server remotehost.

You can with benefit put this command into a batch (.cmd) file, such as the following ssh_server_com.cmd.


@echo off
echo Connecting ...
call loadcygwin.cmd

ssh -L1125:localhost:25

No comments:

Post a Comment