1

I am trying to chain two PuTTY sessions together, if possible. I was trying to setup a multihop SSH session to a Linux machine that is behind my router.

I have two PuTTY sessions saved. The first establishes an SSH tunnel to my router and creates a local tunnel to the Linux machine that is located on the network. The second session is a SSH session to localhost using the tunnel that was previously brought up with the first session. This works, however it requires me to launch the first session, and then the second to reach my machine.

Is there a way I can chain the two sessions together? Can I execute the first that calls the second automatically?

1 Answers1

0

Your router accepts SSH connections. I guess it can also initiate them, it provides a shell etc. Instead of digging the tunnel maybe you can ssh again from the router. The manual way (to get the concept) is:

  • Use PuTTY to SSH to the router.
  • From within the router shell use ssh to reach your target machine.

You can configure PuTTY to execute a command (on the remote side) automatically after the connection is made (the command will be ssh … in your case). I don't use PuTTY so I cannot give you all the details. You should probably read this and this.