1

I have an instance of webmin running inside our office. Within the building I can access via the browser using the ip and port 10000 (as is standard)

Outside the building, the router is not set up to forward port 10000, and I would rather not. However, port 80, 443, and an ssh port (not 22, but another "secret" port) are forwarded.

I am trying to tunnel over SSH with no luck. Is it possible to forward "temporarily" port 10000 from my local browser over SSH to port 10000 on the remote server?

I have tried

ssh -p 1234 -D 10000 user@public.url
ssh -p 1234 -L 10000:public.url:10000 user@public.url
ssh -p 1234 -L 10000:localhost:10000 user@public.url

maybe more combinations of localhost, ip addresses, and urls to no avail.

Is it possible? What command am I looking for? I have used this trick to "browse" port 80 of remote dev computers, but can't figure out how to get port 10000 of webmin.

Chad
  • 163
  • 1
  • 5

1 Answers1

0

The correct tunnelling command is ssh -p 1234 -L 10000:localhost:10000 user@public.url (note the -p 1234 is only required because ssh is not on the standard port 22, also localhost can be swapped with the local/internal IP address of the server)

The problem was the URL I was putting into my local browser. I don't know why, but the only URL that worked to connect to webmin was https://localhost:10000

hope this helps someone else. I tried this a dozen times and only today figured it out.

Chad
  • 163
  • 1
  • 5
  • Why is because the local port is bound on `localhost`, i.e. your machine, thus that is where your web browser must connect to. – Michael Hampton Jul 16 '20 at 19:40
  • @MichaelHampton not sure I follow, any url I enter with port 10000 should go through or to the remote server. On the remote server the hosts file contains 3 different "url" that point to 127.0.0.1 and it's own local ip should all work to reach itself. – Chad Jul 16 '20 at 20:03
  • Yes, but you are not on the remote server, you are on your local computer! – Michael Hampton Jul 16 '20 at 20:04