I want to tunnel all the traffic in my machine , now I do this :

ssh -D 1080 root@myserver.com 

Then , change Mac OS SOCKS proxy to localhost:1080 ,

But is it possible to tunnel the traffic without SOCKS5 ?

Extra Info:

I'm trying to use just SSH commands , so it should work with most of operating systems , since I cannot configure SOCKS5 correctly in Ubuntu , so I hate it.

  • what about SOCKS4? – Lucas Kauffman May 7 '12 at 17:26
  • @LucasKauffman it does not matter , what I'm trying to do is using just a simple command (e.g. ssh commands) , so I use the same syntax over any Operating Systems. – Abdullah May 7 '12 at 17:39
  • 1
    What about OpenVPN? There is no magic way to tunnel traffic. But you can build a simple VPN with OpenVPN and then add some routes to redirect the traffic. – Diego Woitasen May 7 '12 at 20:26
  • @diegows thanks , but I don't know much about OpenVPN ? I think I have to read about it , even if it seems a little bit difficult. – Abdullah May 13 '12 at 7:26

You can use SSH to tunnel specific local ports to specific remote ports, but it will not have the flexibility of using the -D (socks) option. To forward a single port do this:

ssh -L 1080:www.google.com:80 root@myserver.com

Then any connection made to port 1080 on the machine running ssh will be forwarded to port 80 on www.google.com. But that's it. You can't surf the Web this way, but you can when you use the -D (socks) option.

Also, you can specify multiple -L localport:remotehost:remoteport options to a single ssh command.

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.