A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing context, a stack is an ordered pile. A server stack is one type of solution stack — an ordered selection of software that makes it possible to complete a particular task. Like in this post about Using Putty/plink to connect to remote MySQL from Windows machine using Port Forwarding and multi hop SSH tunnel was one problem in server stack that need for a solution. Below are some tips in manage your windows server when you find problem about windows, port-forwarding, ssh-tunnel, putty, plink.
I need to set up port forwarding from my local Windows machine Port 3307 to a remote MySQL server port 3306 but accessed via 2 Linux proxy servers and a Linux web server.
I need to use Putty or plink.exe on the Windows machine to set up the connnection.
I’ve found examples using Putty GUI or plink CLI to achieve similar with only 1 proxy server but not with multiple hops.
I can achieve the connection I need on a *nix machine using
ssh -N -L 127.0.0.1:3307:db-server:3306 -J user@proxy1 user@proxy2 user@web-server
Trying to do the same using Putty or plink.
I ended up using OpenSSH on Windows.
The final command was a little different to above.
ssh -L 127.0.0.1:3307:db-server:3306 -J user@proxy1,user@proxy2 user@web-server -p 31001 -i "C:pathtoprivate-key"
Note we were connecting to the final web server on port 31001, hence the
If there is no explicit requirement to use
plink, I would just use Windows built-in
ssh for the purpose. It is the same SSH as in Unix.