torsocks.conf
configuration file for torsocks(8)
- Provided by: torsocks (Version: 1.3-3)
- Report a bug
configuration file for torsocks(8)
By default, torsocks will assume that it should connect to the SOCKS proxy running at 127.0.0.1 on port 9050. This is the default address and port for Tor's socks server on most installations. If you are running a normal Tor installation and have no special requirements, then you should not need to create, edit or invoke a configuration file when using torsocks.
Your installation of torsocks includes a default configuration file that contains values sensible for use with most Tor installations. The installation location for your default configuration file is:
/etc/torsocks.conf
In order to use a configuration file, you must set the environment variable TORSOCKS_CONF_FILE with the location of the file.
If TORSOCKS_CONF_FILE is not set, torsocks will attempt to read the configuration file at /etc/torsocks.conf. If that file cannot be read, torsocks will use sensible defaults for most Tor installations, i.e. it will assume that you want to use a SOCKS proxy running at 127.0.0.1 (localhost) on port 9050.
An example of typical usage is provided under the 'example' heading at the end of this manual page. The script 'usewithtor' provided with your torsocks installation will set this environment variable for you, and load the configuration file provided with your installation.
If you want to use a custom file in a different location, you should set the environment variable yourself and then use the torsocks command, rather than usewithtor.
The configuration for torsocks can be anything from two lines to hundreds of lines based on the needs at any particular site. The basic idea is to define any networks the machine can access directly (i.e without the use of a SOCKS server) and define one or many SOCKS servers to be used to access other networks (including a 'default' server).
Local networks are declared using the 'local' keyword in the configuration file. When applications attempt to connect to machines in networks marked as local torsocks will not attempt to use a SOCKS server to negotiate the connection.
Obviously if a connection is not to a locally accessible network it will need to be proxied over a SOCKS server. However, many installations have several different SOCKS servers to be used to access different internal (and external) networks. For this reason the configuration file allows the definition of `paths' as well as a default SOCKS server.
Paths are declared as blocks in the configuration file. That is, they begin with a 'path {' line in the configuration file and end with a '}' line. Inside this block directives should be used to declare a SOCKS server (as documented later in this manual page) and 'reaches' directives should be used to declare networks and even destination ports in those networks that this server should be used to reach. N.B Each path MUST define a SOCKS server and contain one or more 'reaches' directives.
SOCKS server declaration directives that are not contained within a 'path' block define the default SOCKS server. If torsocks needs to connect to a machine via a SOCKS server (i.e it isn't a network declared as 'local') and no 'path' has declared it can reach that network via a 'reaches' directive this server is used to negotiate the connection.
The basic structure of all lines in the configuration file is:
The exception to this is 'path' blocks which look like:
Empty lines are ignored and all input on a line after a '#' character is ignored.
The following directives are used in the torsocks configuration file:
You can use the inspectorsocks utility to determine the type of server, see the 'UTILITIES' section later in this manual page.
torsocks comes with two utilities that can be useful in creating and verifying the torsocks configuration file.
export TORSOCKS_CONF_FILE=$PWD/torsocks.conf
torsocks ssh account@sshserver.com
Robert Hogan (robert@roberthogan.net) Shaun Clowes (delius@progsoc.uts.edu.au)
Copyright 2009 Robert Hogan Copyright 2000 Shaun Clowes
Renamed for use by torsocks to avoid conflict with torsocks by Robert Hogan.
torsocks and its documentation may be freely copied under the terms and conditions of version 2 of the GNU General Public License, as published by the Free Software Foundation (Cambridge, Massachusetts, United States of America).
This documentation is based on the documentation for logwrites, another shared library interceptor. One line of code from it was used in torsocks and a lot of the documentation :) logwrites is by adam@yggdrasil.com (Adam J. Richter) and can be had from ftp.yggdrasil.com pub/dist/pkg