Search code examples
sshtunneling

ssh tunneling through a telnet server


Suppose the network is like:

A(192.68.0.1)--------------------B(192.68.0.2)------------------C(192.68.0.3)

A is my ssh server, C is a target ssh server, and I can telnet from A to B(my account is not root).

B is a server not allow ssh login from others, but B can login to C via ssh.

Is it possible to connect C from A through B via ssh?


Solution

  • If you can run programs on B, you can use something like simpleproxy to forward the TCP connection to C.

    Then you SSH from A to some port on B (not 22), which will forward your connection to C. Everything will still be encrypted since the SSH session is A<->C.