Tor: Difference between revisions

Mh (talk | contribs)
m Add obfs4 config for running a tor bridge
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<div style="border: 1px solid #D33; background: #FFEBEB; padding: 30px; border-radius: 5px; margin: 10px 0px; display: flex; align-items: center;">
{{Security Warning|To achieve effective anonymity with Tor, you must understand its <strong>caveats</strong> and adjust your <strong>browsing habits</strong>. The Tor Project provides a crucial [https://support.torproject.org/faq/staying-anonymous/ list of tips] that you should read before using Tor.|heading=Tor is not a panacea.}}
    <div style="color: #D33; font-size: 40px; margin-right: 15px; background: #FFEBEB; display: flex; line-height: 0;  align-items: center;">⚠</div>
    <div style="color: #D33; font-size: 15px; font-style: normal; font-weight: 400; line-height: normal; text-align: left;"><strong>Tor is not a panacea.</strong> To achieve effective anonymity with Tor, you must understand its <strong>caveats</strong> and adjust your <strong>browsing habits</strong>. The Tor Project provides a crucial [https://support.torproject.org/faq/staying-anonymous/ list of tips] that you should read before using Tor.</div>
</div>


<strong>Tor (The Onion Router)</strong> is a free, open-source software that enables anonymous internet communication. It protects users' privacy by routing traffic through a global network of volunteer-operated servers, masking IP addresses and online activities. Tor's key features include <strong>anonymity</strong>, <strong>privacy</strong>, and <strong>censorship circumvention</strong>. It supports hidden services with <strong>.onion domains</strong> for additional anonymity.
<strong>Tor (The Onion Router)</strong> is a free, open-source software that enables anonymous internet communication. It protects users' privacy by routing traffic through a global network of volunteer-operated servers, masking IP addresses and online activities. Tor's key features include <strong>anonymity</strong>, <strong>privacy</strong>, and <strong>censorship circumvention</strong>. It supports hidden services with <strong>.onion domains</strong> for additional anonymity.
Line 15: Line 12:


==== Using nix-shell ====
==== Using nix-shell ====
<syntaxhighlight lang="bash" start="3">
<syntaxhighlight lang=console>
nix-shell -p tor-browser
$ nix-shell -p tor-browser
</syntaxhighlight>
</syntaxhighlight>


==== Using Global Configuration ====
==== Using Global Configuration ====
<syntaxhighlight lang="text">
<syntaxhighlight lang=nix>
environment.systemPackages = [
environment.systemPackages = [
  pkgs.tor-browser
  pkgs.tor-browser
];
];
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
</syntaxhighlight>
sudo nixos-rebuild switch
After modifying your configuration, apply the changes by running:
<syntaxhighlight lang=console>
# nixos-rebuild switch
</syntaxhighlight>
</syntaxhighlight>


==== Using Home Configuration ====
==== Using Home Configuration ====
<syntaxhighlight lang="text">
<syntaxhighlight lang=nix>
home.packages = [  
home.packages = [  
   pkgs.tor-browser
   pkgs.tor-browser
];
];
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
</syntaxhighlight>
home-manager switch
After updating your configuration, apply the changes by running:
<syntaxhighlight lang=console>
$ home-manager switch
</syntaxhighlight>
</syntaxhighlight>


Line 74: Line 75:
     Nickname = "YourNickname";   
     Nickname = "YourNickname";   
     ContactInfo = "your-email@example.com";  
     ContactInfo = "your-email@example.com";  
    # obfs4 proxy, use when running a bridge. Change port as needed
    ServerTransportListenAddr = [ "obfs4 0.0.0.0:8443" ];


     # Bandwidth settings
     # Bandwidth settings
Line 137: Line 141:


=== Client Bridge ===
=== Client Bridge ===
<div style="border: 1px solid #D33; background: #FFEBEB; padding: 30px; border-radius: 5px; margin: 10px 0px; display: flex; align-items: center;">
{{Security Warning|Do not attempt to use Tor with any web browsers other than Tor Browser. Tor Browser integrates custom modifications to Firefox to enhance anonymity and ensure that information leakage does not occur. Using another web browser with Tor is likely to result in imperfect anonymity and is unsafe.}}
    <div style="color: #D33; font-size: 40px; margin-right: 15px; background: #FFEBEB; display: flex; line-height: 0;  align-items: center;">⚠</div>
    <div style="color: #D33; font-size: 15px; font-style: normal; font-weight: 400; line-height: normal; text-align: left;">Do not attempt to use Tor with any web browsers other than Tor Browser. Tor Browser integrates custom modifications to Firefox to enhance anonymity and ensure that information leakage does not occur. Using another web browser with Tor is likely to result in imperfect anonymity and is unsafe.</div>
</div>


Tor can be enabled as a system service by enabling options {{nixos:option|services.tor.enable}}. Configuration of tor service is an example of [https://nixos.org/manual/nixos/stable/index.html#sec-freeform-modules Freeform module], so you can pass not only explicitly supported {{nixos:option|services.tor.settings}}, but all other [https://2019.www.torproject.org/docs/tor-manual.html.en torrc] options. For example, client bridge config can be set like this:
Tor can be enabled as a system service by enabling options {{nixos:option|services.tor.enable}}. Configuration of tor service is an example of [https://nixos.org/manual/nixos/stable/index.html#sec-freeform-modules Freeform module], so you can pass not only explicitly supported {{nixos:option|services.tor.settings}}, but all other [https://2019.www.torproject.org/docs/tor-manual.html.en torrc] options. For example, a client obfs4 bridge config can be set like this:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.tor.settings = {
services.tor.settings = {
      UseBridges = true;
  UseBridges = true;
      ClientTransportPlugin = "obfs4 exec ${pkgs.obfs4}/bin/lyrebird";
  ClientTransportPlugin = "obfs4 exec ${pkgs.obfs4}/bin/lyrebird";
      Bridge = "obfs4 IP:ORPort [fingerprint]"
  Bridge = "obfs4 IP:ORPort [fingerprint]";
};
</syntaxhighlight>
For a webtunnel bridge, use:
<syntaxhighlight lang="nix">
services.tor.settings = {
  UseBridges = true;
  ClientTransportPlugin = "webtunnel exec ${pkgs.webtunnel}/bin/client";
  Bridge = "webtunnel IP:ORPort [fingerprint]";
};
};
</syntaxhighlight>
</syntaxhighlight>