0

I has a machine named A(doesn't have private IP) in my LAN, and I want to connect the machine A via SSH, but my host is not in the LAN. I have a machine B(it has private IP), I want to set the machine B as the proxy machine so that I can connect the machine A from my localhost via the machine B(proxy machine) anywhere.

How can I make it by using SSH?

1 Answer 1

0

I found autossh is very helpful,

In machine A, type the following commands to create reverse connection

$ autossh -f -N -R port_num:localhost:22 username@proxy_machine

Now, you can connect machine A anywhere

$ ssh -t username@proxy_machine "ssh user@machine_A -p 38935"

You must log in to answer this question.

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