1. قم بتمكين تحديثات البرامج التلقائية

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. ثبت 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

الإصدارات الحديثة من CentOS/RHEL تستخدم dnf بدلاً من yum:

# dnf install epel-release

إذا كنت تستخدم إصدارًا حديثًا يستخدم dnf، فالرجاء الاستمرار في استخدامه للخطوات التالية حيث يتم استدعاء yum في دليل الإعداد هذا.

3. تكوين مستودع مشروع Tor

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. يرجى التأكد من تطابق المفاتيح مع المفتاح المتاح على موقع مشروع فيدورا. 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 من اختيارك. يجب أن يكون هذا المنفذ
# يمكن الوصول إليه خارجيًا ويجب أن يكون مختلفًا عن المحدد لمنفذ ORPort.
# تجنب المنفذ 9001 لأنه يرتبط بشكل شائع بـ
# قد يقوم Tor وأجهزة الاستشعار بمسح الإنترنت لهذا المنفذ.
ServerTransportListenAddr obfs4 0.0.0.0:TODO2

# منفذ اتصال محلي بين Tor و obfs4. قم دائمًا بتعيين هذا على "تلقائي".
# "Ext" تعني "ممتد" وليس "خارجي". لا تحاول تعيين منفذ معين
# رقم ، لا تستمع إلى 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]

الإصدارات الحديثة من نظام التشغيل OS CentOS/RHEL والتي يتم شحنها مع systemd:

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

إذا كنت تستخدم إصدارًا قديمًا مثل CentOS/RHEL 6, فسيكون هذا:

# service tor enable
# service tor start

8. Monitor your logs

لتأكيد أن الجسر الخاص بك يعمل بدون مشاكل ، يجب أن ترى شيئًا كهذا (عادةً في / var / log / tor / log أو/ var / log / syslog):

[إشعار] بصمة مفتاح هوية خادم Tor الخاص بك هي '<FINGERPRINT><NICKNAME>'
[إشعار] بصمة مفتاح الهوية المجزأة لجسر Tor الخاص بك هي '<HASHED FINGERPRINT> <NICKNAME>'
[notice] Registered server transport 'obfs4' at '[::]:46396'
[notice] Tor has successfully opened a circuit. Looks like client functionality is working.
[إشعار] Bootstrapped 100٪: تم
[إشعار] تحقق الآن مما إذا كان يمكن الوصول إلى <redacted>ORPort: 3818 ... (قد يستغرق هذا ما يصل إلى 20 دقيقة - ابحث عن رسائل السجل التي تشير إلى النجاح)
[إشعار] يشير الاختبار الذاتي إلى أنه يمكن الوصول إلى منفذ ORPort من الخارج. ممتاز. واصف خادم النشر.

9 Final Notes

إذا كنت تواجه مشكلة في إعداد الجسر ، فقم بإلقاء نظرة على قسم المساعدة الخاص بنا. إذا كان الجسر الخاص بك يعمل الآن ، فتحقق من ملاحظات ما بعد التثبيت.