0

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

Kaltresian
  • 961
  • 3
  • 14
  • 32

1 Answers1

1

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.

dave4420
  • 46,404
  • 6
  • 118
  • 152