Quantcast
Channel: User Kamil Maciorowski - Super User
Viewing all articles
Browse latest Browse all 837

Answer by Kamil Maciorowski for Using E2C to connect two Linux computers behind NAT

$
0
0

ssh -R 7345:localhost:6345 … makes the SSH server listen on the loopback interface only, i.e. on localhost:7345 (where localhost means the machine with the SSH server). Your other tunnel, however, uses xx.xx.xx.xx:7345 as the endpoint.

There is a way to make ssh -R use xx.xx.xx.xx:7345; it would be useful if you wanted to connect to this address from the outside. You don't need to do this and it's better (security-wise) not to do this. The other tunnel ends "inside" and it can connect to localhost:7345 if only you tell it to.

On Box2 instead of ssh -L localhost:6345:xx.xx.xx.xx:7345 … run:

ssh -L localhost:6345:localhost:7345 …

Note in this case localhost:6345 gets resolved on the client side (where ssh runs), but localhost:7345 gets resolved on the server side. The two localhost strings denote different machines.


Viewing all articles
Browse latest Browse all 837

Trending Articles