I'd like to use tsocks + ssh as a simple way to reach
servers in a private network through a firewall. This
turns out to work well, with one small exception:
tsocks.conf provides no way to make local connections
by default. That is to say, most connections don't
need to go through the socks server.
My solution is to make local connections when no server
is specified. My tsocks.conf looks like this:
path {
reaches = 10.0.0.0/255.255.255.0
server = 127.0.0.1
}
Note that there is no default server nor any 'local'
directives. Next, I run a socks server using simple ssh:
ssh -D 1080 firewall.example.com
To connect to boxes inside the corporate firewall, all
I have to do is:
tsocks ssh private.example.com
However, if I try to use "tsocks ssh" to connect to
anything outside 10.0.0.x, tsocks complains that no
default server is specified. In this case, I want to
make a local connection.
I've attached a patch that seems to solve the problem
well. Please let me know what you think.
Patch to default to a local connection