Jan 152012
 

First of all, don’t use the packages in the native repositories, they are always outdated!

So we start by adding the Tor repository:

Add a file “tor.repo” or else in /etc/yum.repos.d/.
Paste the following if you use CentOS 5:

[torproject]
name=Tor and Vidalia
enabled=1
autorefresh=0
baseurl=http://deb.torproject.org/torproject.org/rpm/centos5/
type=rpm-md
gpgcheck=1
gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org

Then just run the command “yum install tor“. If you use another Version, check out http://deb.torproject.org/torproject.org/rpm/ for the available packages.

I prefer to block outgoing emails, so the spammers can’t use my exit node, so I disable Port 25 (SMTP) on my exit node:

Edit /etc/tor/torrc to your needs, e.g.:

# reject SMTP (anti spam)
Exitpolicy reject *:25
# or reject *:* to act as a bridge, see https://www.torproject.org/docs/bridges.html.en for more info
#Exitpolicy reject *:*
# EXITPOLICY IS COMMA SEPARATED!!

#a pretty cool service for tor users, you should always enable this! see applebaum at 28c3 video for more info
#BridgeRelay 1
# classic socks, if you need it as client..
SocksPort 0
ORPort 9913
# if you prefer to reduce bandwidth usage (calculate 2678400 * the bandwidth to see monthly traffic at peak)
# (if you have a monthly traffic limit, see "accounting" in the example config to set monthly traffic limits)
RelayBandwidthRate 30 KBytes
RelayBandwidthBurst 40 KBytes

# you may want to enable logging
Log notice file /var/log/tor/notices.log

# or start it as daemon
RunAsDaemon 1

# and put the tor keys in a central place instead of ~/.tor
DataDirectory /var/lib/tor

Now “/etc/init.d/tor restart” and you’re done! Do a “tail /var/log/tor/tor.log” to see if there are any warnings or errors. It may look like this:


[..]
Jan 15 11:04:03.586 [notice] We now have enough directory information to build circuits.
Jan 15 11:04:03.586 [notice] Bootstrapped 80%: Connecting to the Tor network.
Jan 15 11:04:03.595 [notice] Bootstrapped 85%: Finishing handshake with first hop.
Jan 15 11:04:04.393 [notice] Bootstrapped 90%: Establishing a Tor circuit.
Jan 15 11:04:07.243 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Jan 15 11:04:07.250 [notice] Bootstrapped 100%: Done.