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. Configure Tor Project's Repository
Configuring the Tor Project's package repository for Debian/Ubuntu is recommended and documented on Support portal. Please follow those instructions before proceeding.
Note: Ubuntu users need to get Tor from the Tor Project's repository.
3. Install Tor
Ensure you update the packages database before installing the package, than call apt
to install it:
# apt update
# apt install tor
4. Install obfs4proxy
On Debian, the obfs4proxy
package is available in unstable, testing, and stable. On Ubuntu, bionic, cosmic, disco, eoan, and focal have the package. If you're running any of them, sudo apt-get install obfs4proxy
should work.
إذا لم يكن الأمر كذلك ، يمكنك بنائه من المصدر.
5. Edit your Tor config file, usually located at /etc/tor/torrc
and replace its content with:
BridgeRelay 1
# استبدل "TODO1" بمنفذ Tor من اختيارك.
# يجب أن يكون هذا المنفذ قابلاً للوصول خارجيًا.
# تجنب المنفذ 9001 لأنه مرتبط بشكل شائع بـ Tor وقد يقوم الرقيب بمسح الإنترنت لهذا المنفذ.
ORPort TODO1
ServerTransportPlugin obfs4 exec /usr/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
.
- إذا قررت استخدام منفذ obfs4 ثابت أصغر من 1024 (على سبيل المثال 80 أو 443) ، فستحتاج إلى إعطاء إمكانيات obfs4
CAP_NET_BIND_SERVICE
لربط المنفذ بمستخدم غير جذر:
sudo setcap cap_net_bind_service=+ep /usr/bin/obfs4proxy
للتغلب على تصلب النظام ، ستحتاج أيضًا إلى ضبطNoNewPrivileges=no
in /lib/systemd/system/tor@default.service
and /lib/systemd/system/tor@.service
وبعد ذلك قم بتشغيل systemctl daemon-reload
. لمزيد من التفاصيل ، انظر ticket 18356.
- 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.
6. Restart Tor
Enable and Start tor
:
# systemctl enable --now tor@default
Or restart it if it was running already, so configurations take effect:
# systemctl restart tor
7. 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 من الخارج. ممتاز. واصف خادم النشر.
8. Final Notes
إذا كنت تواجه مشكلة في إعداد الجسر ، فقم بإلقاء نظرة على قسم المساعدة الخاص بنا. إذا كان الجسر الخاص بك يعمل الآن ، فتحقق من ملاحظات ما بعد التثبيت.