-3

On my Pc i got a service which runs on port 51069. I want that this service is reachable with port 80. I tried this comand

ssh -L 51069:localhost:80 localhost

But it not works, when i ask with my browser for localhost i get not the web service behind 51069.

Marius Illmann
  • 143
  • 1
  • 11
  • Perhaps [this](https://unix.stackexchange.com/a/46271/13377), or [this](https://superuser.com/a/591963/113356) will help. – ghoti Apr 26 '19 at 14:17

1 Answers1

-1

You have the ports the wrong way round. You want to forward traffic on port 80 to 51069 so it should be

ssh -L 80:localhost:51069 localhost

HOWEVER, you need root to be able to forward privileged ports (<= 1024) so you would have to ssh locally as root which might not be a great idea.

I'd personally use iptables for this: How to do local port forwarding with iptables

darrend
  • 713
  • 1
  • 6
  • 13