Port forward through gateway server

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I need to be able to connect to a database on a remote server from my desktop and for security want the connection ssh encrypted. The only way to connect to this server is to go via a gateway (bastion) server.

I can connect with putty using plink but would like to use plink on it's own so that I can script this connection.

The command I feel should work is something like the below but I can't get logged into the destinationserver.com this way.

plink user@mygatewayserver.com:222 -nc differentuser@destinationserver.com:222 -L 3396:localhost:3306 -a -v

Any thoughts would be much appreciated.



Re: Port forward through gateway server

On Thursday, August 1, 2013 at 2:08:58 AM UTC+10, Alan Morris wrote:
Quoted text here. Click to load it

I don't think you can specify the username after "-nc".  Instead I think you need to create a session in PuTTY that works, then use "plink -load sessname" to pull in the correct username.

Site Timeline