Friday, July 12, 2019

ssh - how to tunnel SOCKS proxy?

I have a distant server, that is not accessible from the outside world. I would like to turn it into a proxy nonetheless. I was thinking I could use server (that I fully own) to achieve my goal.



Apologies if the following is not clear enough, for I have very little knowledge about networking.



What I can do:





  • I know I can open a reverse ssh connexion from distant to server, and use it to access distant from the local computer. For instance, from local I can ssh server, then when logged in, use ssh localhost -p 12345 to finally access distant via ssh.

  • I also know about ssh -D 1080 server, that will allow me to use server as a SOCKS proxy from my computer



network figure



What I would like to do



I would like to open a SOCKS proxy from local, that uses the ip of distant. I have no idea wether this is possible, but in naive words, I'd say I'm trying to open a socks connexion to the server, while telling the server to use its own localhost:12345 to access internet.




In other words, I'm trying to funnel a SOCKS proxy from localto distant, thanks to server that is accessible via a public IP address.



Any idea/direction on how to do this, provided it is even possible ?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...