0

I have 3 machines A, B and C. I can ssh from B to A and also from B to C. B will not accept any incoming connections. There is no direct connection between A and C possible.
Is there a way to ssh from A to C and from C to A reusing the ssh connections I created from B?

+---+  SSH +---+  SSH  +---+
| A | <--- | B | ----> | C |
+---+      +---+       +---+
lgnom
  • 13
  • 3

1 Answers1

2

If the existing ssh connections from B are like this:

ssh -R 2201:localhost:2202 A
ssh -L 2202:localhost:22 C

You can connect from A to C with:

ssh localhost -p 2201

It is possible to do the same with the RemoteForward and LocalForward config directives.

n3ko
  • 176
  • 3