Amateur Topologist

Politics, programming, math, and science.

tsocks: Make any application SOCKS-compatible

Most applications that require Internet access have at least some form of SOCKS compatibility to allow the usage of proxies, but not all of them do. That’s where tsocks comes in; it overrides certain internal functions of the programs you tell it to load and redirects them through its own versions, which are SOCKS-aware and hence can be used through ssh tunnels, etc. tsocks is dead simple to set up and install; Ubuntu users can just grab it from repositories, or get the raw source files here. Then create a file named /etc/tsocks.conf by running

gksu gedit /etc/tsocks.conf

and adding a line

server = myserver.com

; that’s it! If your SOCKS server runs on a non-standard port, or requires a username and password, add lines assigning to server_port, default_user, or default_pass respectively.

Using tsocks is easy; if you want to run a single command using tsocks, just add tsocks to the beginning, like

tsocks pidgin

. To make all programs use tsocks until further notice, just run

tsocks

with no arguments; it’ll create a shell within your shell. To exit back out and stop using tsocks, just type

exit

to exit the subshell.

« Previous post
Next post »

Leave a Reply