You may have heard about Tor and wondered what it’s all about. Tor is an anonymity network that allows you to browse the web without anyone knowing your identity if used correctly. Tor works by sending your traffic through different relays and finally exiting one to your destination. At no time is it possible for the entrance relay to know where the traffic will end up, and the exit node to know where it originated from. These relays are run by volunteers, and in this tutorial I will explain how you can help by setting up a middle relay on CentOS 6.
- The first thing you need to do is add the Tor repository to /etc/yum.repos.d/. Name this file torproject.repo and add the following lines using your text editor of choice with root privileges.
[tor] name=Tor experimental repo enabled=1 baseurl=http://deb.torproject.org/torproject.org/rpm/el/6/$basearch/ gpgcheck=1 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc [tor-source] name=Tor experimental source repo enabled=1 autorefresh=0 baseurl=http://deb.torproject.org/torproject.org/rpm/el/6/SRPMS gpgcheck=1 gpgkey=http://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
- The next thing to do is to update yum by running:
# yum update
- Now the next thing to do is actually install Tor.
# yum install tor
- Once Tor is installed it’s time to configure it as a middle relay. These are the lines you will either need to uncomment or add in your /etc/tor/torrc file. Edit these using your favorite text editor with root privileges.
Log notice file /var/log/tor/notices.log ControlPort 9051 DisableDebuggerAttachment 0 ORPort 443 (As long as you aren't using this port already. If you are, use a different one) Nickname namethiswhatyouwant ContactInfo email address can go here, you can put your name if you want to. This is public, expect spam. ExitPolicy reject *:*
Tor will use all your bandwidth and as much data as it can. If this is a problem for you, you can set:
BandwidthRate something KB/MB/GB BandwidthBurst something KB/MB/GB RelayBandwidthRate something KB/MB/GB RelayBandwidthBurst something KB/MB/GB
Something would be a number of your choice. This is the amount of data per second to allow through your relay. Please note that’s in K/M/GBbytes/s not bits/s.
If you have a data quota, you can set AccountingMax like this.
AccountingMax maxamountofdata KB/MB/GB AccountingStart month 1 00:00 AccountingStart day 00:00
In this example maxamountofdata is the maximum amount of data that Tor will use either for the month or day. AccountingStart is the interval for AccountingMax. You only set one AccountingStart, either month or day.
- Alright, next let’s get onto installing Arm. Arm is a monitoring software for Tor.
Download Arm from here.
Now install Arm by running:
# rpm -ivh arm-replace-with-version-downloaded.rpm
- Now it’s time to start Tor. In a terminal run:
# service tor restart
Tor should now be running!
You can verify this by running:
Arm will now fire up and it should be able to connect to your Tor instance. You should be able to monitor your flags and data throughput, as well as several other things using it.
That wraps up this tutorial. I hope you enjoy running your Tor relay, and would even consider running additional ones.
The Tor Project, Inc. is the owner of the image used as the header of this page. The header image on this page is licensed under a Creative Commons Attribution 3.0 United States License.
Source: The Tor Project