Question

I need to know if is possible to put a local port in a remote machine via ssh tunneling

Example

Machine A: port 80 
Machine B: Nothing

Inside Machine A (important, because A can see B, but B can't see A)

A>  ssh -f -N -? 80:B:8585 user@B

result

Machine A: port 80 
Machine B: port 8585 (really A:80)

Thanks in Advance

Was it helpful?

Solution

You need the -R switch

ssh -f -N -R 8585:localhost:80 user@B

localhost is from A's perspective, so it means to forward port 8585 on B to port 80 on A.

See also the RemoteForward setting in your ~/.ssh/config.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top