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. 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 לפי בחירתכם.
# Tערוץ זה חייב להיות זמין חיצונית ושונה מזה שהוגדר עבור ORPort.
# המנעו מערוץ 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
.
- אם החלטתם להשתמש בערוץ obfs4 הקטן יותר מ 1024 (למשל 80 או 443), תצטרכו לספק יכולות ל obfs4
CAP_NET_BIND_SERVICE
להתקשר לערוץ עם משתמש ללא פריבילגיות מיוחדות:
sudo setcap cap_net_bind_service=+ep /usr/bin/obfs4proxy
To work around systemd hardening, you will also need to set NoNewPrivileges=no
in /lib/systemd/system/tor@default.service
and /lib/systemd/system/tor@.service
and then run systemctl daemon-reload
. For more details, see 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
or /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)
[notice] Self-testing indicates your ORPort is reachable from the outside. Excellent. Publishing server descriptor.
8. 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.