Command Line Putty for SSH Tunnel

I am trying to translate the GUI settings in Putty for establishing SSH tunnel to command line in Windows batch script. The first batch script establishes the port forwarding and tunnel ...

start putty -ssh [email protected] -pw my_secure_pw -L 5555:10.54.22.104:5432 -L 2222:10.54.22.104:22

and the second batch script uses the tunnel ...

start putty -ssh localhost 5555

While the first script runs without error, I keep getting Putty Fatal Error: Server unexpectedly closed network connection for the second one.

However, if I establish the tunnel using GUI as per snapshot below, and run the second script, there was no error and I can run the application accordingly.

Is there any missing configuration or option from the first script, if compare to the GUI?

enter image description here


From the command line, the local ports tunnel to the remote IP 10.54.22.104 while the GUI variant uses 10.54.22.102 as destination.

Additionally, the destination's SSH daemon is probably listening on port 22, so you'd need to use the local port 2222 instead.