tsocks provides a way to tunnel individual tty sessions or everything on a linux box through a SOCKS 4/5 proxy. What this enables you to do is use a SSH tunnel to proxy programs and applications through etc..

What do you need?

apt-get install tsocks

edit /etc/tsocks.conf

local = 192.168.0.0/255.255.255.0 server = 127.0.0.1 servertype = 5 serverport = 12345

Here, we assume we have created a dynamic ssh tunnel using lets say the following command:

ssh -D 12345 [email protected]

and we are telling tsocks to pass any traffic destined for the local network normally but anything else, will be ported through our proxy server (ssh tunnel).

To use this on an individual shell session run:

export LD_PRELOAD=/usr/lib/libtsocks.so

To use this system wide (be careful with this) create a file “/etc/ld.so.preload” with the contents:

/usr/lib/libtsocks.so

Super kewl!!

Ohh and heres more on the man page.

Blog Logo

Mario Loria


Published

Image

./scriptthe.net

Because 127.0.0.1 gets old after a while.

Back to Overview