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. Bootstrap pkg
This guide assumes we have already a base installation of FreeBSD running, and only the base system.
משמעו של דבר שאין לנו אף חבילת תוכנה שהותקנה, או אפילו מנהל תוכנות ה pkg
בעצמו ( sudo
אינו זמין - אנו מריצים פקודות כבסיס - root).
להתחיל ולהתקין pkg
עלינו להריץ את הפקודה הבאה:
# pkg bootstrap
# pkg update -f
2.1. Recommended steps to setup pkg
כדי לעקוב אחר העדכונים העתידיים באופן "מהיר יותר" אנו ממליצים לשנות את 'quarterly' branch שבשימוש pkg
ל 'latest' branch.
צעד אחד נוסף הנו להעדיף את השימוש ב HTTPS כדי להעלות את התוכנות והעדכונים שלנו ולכן אנו צריכים תוכנה נוספת שתעזור לנו בכך (ca_root_nss).
התקנת תוכנת ca_root_nss
package:
# pkg install ca_root_nss
We are keeping the original setting used by pkg
but setting a new one that will override it. So we set up a new directory, and then create a configuration file to override what we need. This configuration file will be /usr/local/etc/pkg/repos/FreeBSD.conf
.
יצירת ספריה חדשה
# mkdir -p /usr/local/etc/pkg/repos
כך צריך להראות קובץ ההגדרות החדש /usr/local/etc/pkg/repos/FreeBSD.conf
:
FreeBSD: {
url: pkg+https://pkg.freebsd.org/${ABI}/latest
}
לאחר שמיישמים את כל השינויים האלה, אנו מעדכנים את רשימת התוכנות שוב ומנסים לבדוק אם אם יש כבר עדכון חדש ליישם:
# pkg update -f
# pkg upgrade -y -f
3. Install Tor
You can choose to install the stable version (recommended):
# pkg install tor
Or install an alpha release:
# pkg install tor-devel
4. Install obfs4proxy
# pkg install obfs4proxy-tor
5. Edit your Tor config file, usually located at /usr/local/etc/tor
and replace its content with:
RunAsDaemon 1
BridgeRelay 1
# החליפו "TODO1" עם ערוץ Tor לפי בחירתכם. הערוץ הזה צריך להיות זמין מבחוץ.
# המנעו מערוץ 9001 כיון שהוא בדרך כלל מזוהה עם Tor
# וצנזורים עלולים לבצע סריקות של האינטרנט לערוץ הזה..
ORPort TODO1
ServerTransportPlugin obfs4 exec /usr/local/bin/obfs4proxy
# החליפו את "TODO2" עם ערוץ obfs4 לבחירתכם. This port must be
# שיהיה זמין מבחוץ וחייב להיות שונה מזה שהוגדר עבור 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
לוג קובץ ההודעות /var/log/tor/notices.log
לא לשכוח לשנות את אפשרויות ORPort
, ServerTransportListenAddr
, ContactInfo
, ו Nickname
.
שימו לב שגם ערוץ Tor OR וגם ערוץ obfs4 שלו חייבים לאפשר גישה אליהם. אם הגשר שלכם נמצא מאחורי חומת אש או NAT, וודאו שפתתחתם את שניהם.. אתם יכולים להעזר ב our reachability test tכדי לבחון אם ערוץ obfs4 ניתן לגישה מהאנטרנט.
Are you using FreeBSD's firewall with a "default deny" policy? If so, make sure that your obfs4proxy can talk to your Tor process over the loopback interface. Don't forget to whitelist Tor's
ExtORPort
.
6. Ensure that the random_id
sysctl setting is enabled
# echo "net.inet.ip.random_id=1" >> /etc/sysctl.conf
# sysctl net.inet.ip.random_id=1
7. Start the tor daemon and make sure it starts at boot
# sysrc tor_setuid=YES
# sysrc tor_enable=YES
# service tor start
8. Monitor your logs
לאשר שהגשר שלכם פועל ללא תקלות, אתם צריכים לראות משהו כגון זה ב /var/log/tor/notices.log
:
[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.
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.