0

I have a simple client and a HTTP server (port 80). In some cases, the client and server can exist on different locations, NAT'ed behind a firewall (allowing only outbound connections to port 80).

I'm trying to use SSH tunneling (or anything else...NGINX?) in order to bypass the firewall using a 3rd server which is available to both sides and accepts inbound connections (80/22/else?).

Can it be achieved with SSH tunneling? Can I make it work with any kind of reverse proxy (I'll probably need additional proxy on the server side..my HTTP server)?

Thanks

0

The question is not clear, but I will try to address it anyway.

If you just want to be always able to get to the HTTP server through that intermediate host you can use reverse SSH tunneling from the HTTP server to the intermediate host and export HTTP server's port on a loopback interface of the intermediate server (you can expose it on the external interface also, but it would mean that anybody on the net then will be able to hit your HTTP server).

To do so, you need to use ssh -R 8080:127.0.0.1:80 joe@friendly.domain.tld from you HTTP server. This will expose port 80 as port 8080 on the loopback interface on friendly.domain.tld.

Next you need to portforward it to your local machine by running the following on your local machine: ssh -L 8080:127.0.0.1:8080 joe@friendly.domain.tld. From this point on the 8080 port on your loopback interface is connected to your HTTP server :)

You can get more information from an blog article I wrote some time ago: http://dmitry.khlebnikov.net/2010/12/ssh-port-forwarding-intermediate.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.