1

I want to create an ssh tunnel between 2 computers. This is my current setup:

Fig. 1
---------     SSH     -----------     SSH    ---------
|   A   |  ---------> | Gateway | <--------- |   B   |
---------             -----------            ---------

Fig. 2
----------  :7575       Tunnel        :7575  ----------
| Server | <-------------------------------- | Client |
----------                                   ----------

A and B can SSH to the Gateway, but the Gateway cannot SSH to either A or B.

A runs on Linux and B runs on Windows and connects the gateway via PuTTY.

How can I create an tunnel (seen in Fig. 2) so that the client software on B can connect to the Server on A?

2
  • Is there a problem with installing and configuring a sshd on the server?
    – Hannu
    Jul 12, 2020 at 16:36
  • No, I don't how to "connect" those two ssh session to create a tunnel from B to A. A and B are behind a NAT, that's why the gateway server can't connect to A or B.
    – Ptrk25
    Jul 12, 2020 at 17:14

1 Answer 1

1

Like this:

  • At B with putty: ssh to gateway. Right click window top, under connection ssh/tunnels add tunnel: localport 7575, destination 127.0.0.1:7575 - don't forget to click Apply before close.
  • At S with OS ssh command: ssh -R7575:127.0.0.1:7575 gateway This reverse tunnel connects the end of the A-initiated tunnel to your port 7575 on B.
1
  • Thank you this worked perfectly!
    – Ptrk25
    Jul 12, 2020 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .