1. Enable Automatic Software Updates

One of the most important things to keep your relay secure is to install security updates timely and ideally automatically so you can not forget about it. Follow the instructions to enable automatic software updates for your operating system.

2. Install epel-release

To install the tor package on CentOS/RHEL, you need to enable the use of the EPEL Repository first. To do so, you must install the epel-release package:

# yum install epel-release

Recent versions of CentOS/RHEL are using dnf instead of yum:

# dnf install epel-release

If you are on a recent version that uses dnf, please keep using it for the following steps where yum is called on this setup guide.

3. Configure Tor Project's Repository

Configuring the Tor Project's Repository for CentOS/RHEL consists basically on setting up /etc/yum.repos.d/Tor.repo with the following content:

[tor]
name=Tor for Enterprise Linux $releasever - $basearch
baseurl=https://rpm.torproject.org/centos/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://rpm.torproject.org/centos/public_gpg.key
cost=100

4. Install Tor

Once you are set with EPEL and the Tor repositories, you are now able to install the package:

# yum install tor

Please note that when you are installing the first package from the EPEL repository you will be asked about verifying the EPEL's GPG signing key. გთხოვთ, დარწმუნდით რომ გასაღები ემთხვევა Fedora-პროექტის საიტზე მოცემულს. This will also happens when installing packages from Tor's repository for the first time - again you must ensure the key matches.

5. Build obfs4proxy and move it into place.

ზედმეტად ძველ git-ვერსიებში go get ვერ მუშაობს, ამიტომ ჯერ სცადეთ გადასვლა უფრო ახალ git-ვერსიაზე თუ დაბრკოლებას წააწყდებით.

Install the golang package and other dependencies:

# yum install git golang policycoreutils-python-utils

Now build the binary, and move it to a proper directory:

export GOPATH='mktemp -d'
go get gitlab.com/yawning/obfs4.git/obfs4proxy
sudo cp $GOPATH/bin/obfs4proxy /usr/local/bin/
# chcon --reference=/usr/bin/tor /usr/local/bin/obfs4proxy

6. Edit your Tor config file, usually located at /etc/tor/torrc and replace its content with:

RunAsDaemon 1
BridgeRelay 1

# შეცვალეთ „TODO1“ სასურველი Tor-პორტით.  ეს პორტი გარედან
# მისაწვდომი უნდა იყოს.  აირიდეთ 9001, ვინაიდან მეტად გაიგივებულია Tor-თან და
# ცენზორებმა შეიძლება გადაამოწმონ ინტერნეტიდან ეს პორტი.
ORPort TODO1

ServerTransportPlugin obfs4 exec /usr/local/bin/obfs4proxy

# შეცვალეთ „TODO2“ სასურველი obfs4-პორტით.  ეს პორტი გარედან
# გარედან მისაწვდომი უნდა იყოს და განსხვავდებოდეს OR-პორტისთვის განსაზღვრულისგან.
# აირიდეთ 9001 ვინაიდან, მეტად გაიგივებულია
# Tor-თან და ცენზორებმა შეიძლება გადაამოწმონ ინტერნეტიდან ეს პორტი.
ServerTransportListenAddr obfs4 0.0.0.0:TODO2

# ადგილობრივი კავშირის პორტი Tor-სა და obfs4-ს შორის.  ყოველთვის მიუთითეთ „auto“.
# „Ext“ ნიშნავს გაფართოებულს, „extended“ და არა გარეს, „external“.  არ სცადოთ ცალკეული პორტის
#  ნომრის მითითება ან 0.0.0.0. პორტის დაყენება კავშირის მისაღებად
ExtORPort auto

# შეცვალეთ „<address@email.com>“ თქვენი ელფოსტით, რომ შევძლოთ თქვენთან დაკავშირება, თუ
# რამე ხარვეზი წარმოექმნება გადამცემ ხიდს.  ეს არასავალდებულოა, მაგრამ სასურველი.
ContactInfo <address@email.com>

# აირჩიეთ სასურველი მეტსახელი ხიდისთვის.  არასავალდებულოა.
Nickname PickANickname

არ დაგავიწყდეთ შეცვალოთ ORPort, ServerTransportListenAddr, ContactInfo და Nickname პარამეტრები.

  • Note that both Tor's OR port and its obfs4 port must be reachable. If your bridge is behind a firewall or NAT, make sure to open both ports. You can use our reachability test to see if your obfs4 port is reachable from the Internet.

7. Restart Tor

sudo semanage port -a -t tor_port_t -p tcp [OR port set earlier, in TODO1]

sudo semanage port -a -t tor_port_t -p tcp [obfs4 port set earlier, in TODO2]

Recent versions os CentOS/RHEL which ship with systemd:

# systemctl enable --now tor
... or restart it if it was running already, so configurations take effect
# systemctl restart tor

Should you use an older release like CentOS/RHEL 6, that will be:

# service tor enable
# service tor start

8. Monitor your logs

იმის დასამოწმებლად, რომ თქვენი გადამცემი ხიდი გაშვებულია უხარვეზოდ, უნდა იხილოთ ასეთი რამ (ჩვეულებრივ მისამართზე /var/log/tor/log ან /var/log/syslog):

[notice] Your Tor server's identity key fingerprint is '<NICKNAME> <FINGERPRINT>'
[notice] Your Tor bridge's hashed identity key fingerprint is '<NICKNAME> <HASHED FINGERPRINT>'
[notice] Registered server transport 'obfs4' at '[::]:46396'
[notice] Tor has successfully opened a circuit. Looks like client functionality is working.
[notice] Bootstrapped 100%: Done
[notice] Now checking whether ORPort <redacted>:3818 is reachable... (this may take up to 20 minutes -- look for log messages indicating success)
[ცნობა] თვითშემოწმება აჩვენებს, რომ თქვენი ORPort ხელმისაწვდომია გარედან. მშვენიერია. გამოქვეყნდება სერვერის აღმწერი.

9 Final Notes

If you are having trouble setting up your bridge, have a look at our help section. If your bridge is now running, check out the post-install notes.