ssh tunnel without SOCKS5 , is it possible?

0

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.

Abdullah

Posted 2012-05-07T17:25:16.270

Reputation: 101

what about SOCKS4? – Lucas Kauffman – 2012-05-07T17:26:27.780

@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 – 2012-05-07T17:39:30.480

1What 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 – 2012-05-07T20:26:49.493

@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 – 2012-05-13T07:26:18.500

Answers

1

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.

Fran

Posted 2012-05-07T17:25:16.270

Reputation: 4 774