Socks server, easy way: ssh

Short article:
I love ssh (really, what a nice piece of software, tunnels, reverse tunnels… and sock servers!):
ssh -D 1080 user@server
Setup your favourite application to use the socks server on localhost, port 1080. ssh will send to “server” the communications, cyphered. And from there to the world.
If your favourite application doesn’t have socks support: install tsocks and wrap your application with a tsocks call:
tsocks application
(you need to setup the server in /etc/tsocks.conf)

Long article:
I wanted to watch from London a basketball match that was broadcasted in the Catalan TV (and Spanish one) but only for Spanish residents.

I have a computer in Spain with not very good connection but I thought that maybe good enough. I thought to use ssh and port redirection, but this is per connection and is not a very clean solution for that problem, since usually the multimedia streams jumps from one server to another. to be redirected, load balanced, etc.

I thought I should use iptables to redirect some packets, but it’s not very nice either…

Then I thought I should use a socks server. I think that I haven’t setup any socks server before, so I searched a bit and I found some nice articles like Debian and Dante, but sadly I didn’t succeed in (some problems with the server configuration, even when it looks easy).

As soon as the basketball match was over, I’d found a very easy way to do it:
ssh -D 1080 user@server
You don’t need to install new servers, new ports, setup new software on the server side… easy, secure, fast to setup!
Yes, nobody will setup a real socks server for a company in this way, but it’s handy to have it.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>