Ansluta till Tor

When OnionShare starts, it will show you a screen asking you to connect to the Tor network.

_images/autoconnect-welcome-screen.png

You can toggle on the switch ”Connect to Tor automatically” before clicking ”Connect to Tor”. This means that next time OnionShare starts, it will automatically connect with its Tor connection settings from the last session, instead of presenting you with the connection options. If the connection fails, you can still try bridges or reconfigure Tor via the ”Network Settings” button.

You can click ”Connect to Tor” to begin the connection process. If there are no problems with your network, including any attempts to block your access to the Tor network, this should hopefully work the first time.

Or, if you want to manually configure Bridges or other Tor settings before you connect, you can click ”Network Settings”.

Automatic censorship circumvention

When you click ”Connect to Tor”, if OnionShare fails to connect, it might be because Tor is censored in your country or on your local network.

If this occurs, you will have these choices:

  • Try again without a bridge

  • Automatically determine my country from my IP address for bridge settings

  • Manually select my country for bridge settings

_images/autoconnect-failed-to-connect.png

If you choose the ”Try again without a bridge” option, OnionShare will retry connecting to Tor like normal, without attempting to bypass censorship.

The other two options will attempt to automatically bypass censorship using Tor bridges. If your network provider is blocking access to the Tor network, you can hopefully still connect to a Tor bridge, which will then connect you to the Tor network, circumventing the censorship. Both of these options use the Tor Project’s Censorship Circumvention API to provide you with bridge settings that should work for you. OnionShare will temporarily use the Meek domain-fronting proxy to make a non-Tor connection from your computer to Tor’s Censorship Circumvention API. The Meek proxy hides the fact that you are trying to find a way to connect to Tor.

If you choose ”Automatically determine my country from my IP address for bridge settings”, the Censorship Circumvention API will consider your IP address (yes, your real IP address) to determine what country you might reside in. Based on the country information, the API will try to automatically find bridges that suit your location.

_images/autoconnect-trying-to-resolve-connectivity-issues.png

If you choose ”Manually select my country for bridge settings”, the Censorship API will find the bridges that suit the country that you specified.

_images/autoconnect-select-country.png

How automatic censorship circumvention works

If the Censorship Circumvention API finds bridges that it believes will suit you, OnionShare will try to reconnect to Tor using those bridges. If the API does not find any bridges for your location, OnionShare will ask the API for ”fallback” options, and then try to reconnect using those.

If for some reason OnionShare fails to connect to the Censorship API itself, or if the API returns an error message, OnionShare will attempt to use the obfs4 built-in bridges.

It’s important to note that the requests to the Censorship Circumvention API do not go over the Tor network (because if you could connect to Tor already, you wouldn’t need to connect to the API).

Even though it’s hard for an adversary to discover where the Meek request is going, this may still be risky for some users. Therefore, it is an opt-in feature. The use of Meek and non-torified network requests are limited only to making one or two requests to the Censorship Circumvention API. Then Meek is stopped, and all further network requests happen over the Tor network.

If you are uncomfortable with making a request that doesn’t go over the Tor network, you can click ”Network Settings” (or the Settings icon in the bottom right corner, followed by the Tor Settings tab in the screen that appears), and manually configure bridges. After you save any bridge settings, OnionShare will try to reconnect using those bridges.

Manually configure Tor settings

You can get to the Tor settings by clicking ”Network Settings” on the welcome screen, or by clicking the ”⚙” icon in the bottom-right corner of the application, and then switch to the Tor Settings tab in the screen that appears.

_images/tor-settings.png

Here are the different ways you can configure OnionShare to connect to Tor:

Use the Tor version built into OnionShare

Detta är det standardiserade, enklaste och mest pålitliga sättet som OnionShare ansluter till Tor. Av denna anledning rekommenderas det för de flesta användare.

När du öppnar OnionShare startar den en förkonfigurerad ”tor-process” i bakgrunden för OnionShare att använda. Det stör inte andra ”tor-processer” på din dator, så du kan använda Tor Browser eller systemet ’’tor’’ på egen hand.

Using bridges

To use a bridge, you must select ”Use the Tor version built into OnionShare” and check the ”Use a bridge” checkbox.

Try using a built-in bridge first. Using obfs4 or snowflake bridges is recommended over using meek-azure.

_images/tor-settings-bridges.png

If using a built-in bridge doesn’t work, you can request a bridge from torproject.org. You will have to solve a CAPTCHA in order to request a bridge. (This makes it more difficult for governments or ISPs to block access to Tor bridges.)

_images/tor-settings-moat.png

You also have the option of using a bridge that you learned about from a trusted source.

Försök att konfigurera automatiskt med Tor Browser

Om du har laddat ner Tor Browser och inte vill att två tor-processer ska köras kan du använda tor-processen från Tor Browser. Tänk på att du måste hålla Tor Browser öppen i bakgrunden medan du använder OnionShare för att detta ska fungera.

Använda ett ’’system-tor’’ i Windows

Det här är ganska avancerat. Du måste veta hur du redigerar klartextfiler och gör saker som administratör.

Ladda ned Tor Windows Expert Bundle ’från <https://www.torproject.org/download/tor/>’_. Extrahera den komprimerade filen och kopiera den extraherade mappen till ’’C:Program Files (x86)'’ Byt namn på den extraherade mappen med ’’Data’’ och ’’Tor’’ i den till ’’tor-win32’’.

Skapa ett lösenord för kontrollporten. (Att använda 7 ord i en sekvens som ’’comprised stumble rummage work avenging construct volatile’’ är en bra idé för ett lösenord.) Öppna nu en kommandotolk (cmd) som administratör och använd ’’tor.exe –hash-password’’ för att generera en hash av ditt lösenord. Till exempel:

cd "C:\Program Files (x86)\tor-win32\Tor"
tor.exe --hash-password "comprised stumble rummage work avenging construct volatile"

Hash-lösenordsutmatningen visas efter vissa varningar (som du kan ignorera). När det gäller exemplet ovan är det ’’16:00322E903D96DE986058BB9ABDA91E010D7A863768635AC38E213FDBEF’”.

Skapa nu en ny textfil på ’’C:Program Files (x86)tor-win32torrc’’ och lägg din hashade lösenordsutmatning i den och ersätt ’’HashedControlPassword’’ med den du just genererade:

ControlPort 9051
HashedControlPassword (the hash you generate from the password you picked above)

I kommandotolken för administratör installerar du ’’tor’’ som en tjänst med lämplig ’torrc’’-fil som du just skapade (enligt beskrivningen i ’<https://2019.www.torproject.org/docs/faq.html.en#NTService>’_). Som det här:

tor.exe --service install -options -f "C:\Program Files (x86)\tor-win32\torrc"

Du kör nu en ”system-torprocess” i Windows!

Open OnionShare, click the ”⚙” icon in it, and switch to the Tor Settings tab. Under ”How should OnionShare connect to Tor?” choose ”Connect using control port”, and set ”Control port” to 127.0.0.1 and ”Port” to 9051. Under ”Tor authentication settings” choose ”Password” and set the password to the control port password you picked above. Click the ”Test Connection to Tor” button. If all goes well, you should see ”Connected to the Tor controller”.

Använda ett ’’system-tor’’ i macOS

Installera först Homebrew om du inte redan har det och installera sedan Tor:

brew install tor

Konfigurera nu Tor till att ansluta från OnionShare:

mkdir -p /usr/local/var/run/tor
chmod 700 /usr/local/var/run/tor
echo 'SOCKSPort 9050' >> /usr/local/etc/tor/torrc
echo 'ControlPort unix:"/usr/local/var/run/tor/control.socket"' >> /usr/local/etc/tor/torrc

Och starta systemets Tor-tjänst:

brew services start tor

Open OnionShare, click the ”⚙” icon in it, and switch to the Tor Settings tab. Under ”How should OnionShare connect to Tor?” choose ”Connect using socket file”, and set the socket file to be /usr/local/var/run/tor/control.socket. Under ”Tor authentication settings” choose ”No authentication, or cookie authentication”. Click the ”Test Connection to Tor” button.

Om allt går bra bör du se ”Ansluten till Tor-styrenheten”.

Använda ett ’’system-tor’’ i Linux

Installera först tor-paketet. Om du använder Debian, Ubuntu eller en liknande Linux-distribution rekommenderas att använda Tor-projektets officiella lagringsplats.

Lägg sedan till din användare i gruppen som kör tor-processen (när det gäller Debian och Ubuntu, ’’debian-tor’) och konfigurera OnionShare för att ansluta till systemets tor-kontrollsocketfil.

Lägg till din användare i gruppen debian-tor genom att köra det här kommandot (ersätt ’’användarnamn’’ med ditt faktiska användarnamn):

sudo usermod -a -G debian-tor username

Reboot your computer. After it boots up again, open OnionShare, click the ”⚙” icon in it, and switch to the Tor Settings tab. Under ”How should OnionShare connect to Tor?” choose ”Connect using socket file”. Set the socket file to be /var/run/tor/control. Under ”Tor authentication settings” choose ”No authentication, or cookie authentication”. Click the ”Test Connection to Tor” button.

Om allt går bra bör du se ”Ansluten till Tor-styrenheten”.