Little-t-tor

Attention: These instructions are meant for installing tor the network daemon i.e. little-t-tor. For instructions on installing Tor Browser, refer to Tor Browser user manual.

Admin access: To install Tor you need root privileges. Below all commands that need to be run as root user like apt and dpkg are prepended with '#', while commands to be run as user with '$' resembling the standard prompt in a terminal. To open a root terminal you have several options: sudo su, or sudo -i, or su -i. Note that sudo asks for your user password, while su expects the root password of your system.

Debian / Ubuntu

No utilitzeu els paquets de l'univers d'Ubuntu. In the past they have not reliably been updated. That means you could be missing stability and security fixes.

  • Configure Tor package repository

Enable the Tor Project APT repository by following the instructions.

  • Package installation

# apt install tor

Fedora

  • Configure Tor Package repository

Enable the Tor Project's RPM package repository by following the instructions.

  • Package installation

# dnf install tor

FreeBSD

  • Package installation

# pkg install tor

OpenBSD

  • Package installation

# pkg_add tor

macOS

  • Install a package manager

There are two package manager on OS X: Homebrew and Macports. You can use the package manager of your choice.

To install Homebrew follow the instructions on brew.sh.

To install Macports follow the instructions on macports.org/install.php.

  • Package installation

If you are using Homebrew in a Terminal window, run:

# brew install tor

If you are using Macports in a Terminal window, run:

$ sudo port install tor

Arch Linux

  • To install the tor package on Arch Linux, run:
# pacman -Syu tor

DragonFlyBSD

  • Bootstrap pkg

DragonFlyBSD's daily snapshots and releases (starting with 3.4) come with pkg already installed. Upgrades from earlier releases, however, will not have it. If pkg is missing on the system for any reason, it can be quickly bootstrapped without having to build it from source or even having DPorts installed:

# cd /usr
# make pkg-bootstrap
# rehash
# pkg-static install -y pkg
# rehash
  • Recommended steps to setup pkg

Here, it will be similar to what we have on a FreeBSD system, and we are going to use HTTPS to fetch our packages, and updates - so here we also need an extra package to help us out (ca_root_nss).

Installing the ca_root_nss package:

# pkg install ca_root_nss

For fresh installations, the file /usr/local/etc/pkg/repos/df-latest.conf.sample is copied to /usr/local/etc/pkg/repos/df-latest. The files ending in the ".sample" extension are ignored; pkg(8) only reads files that end in ".conf" and it will read as many as it finds.

DragonflyBSD has 2 packages repositories:

  • Avalon (mirror-master.dragonflybsd.org);
  • Wolfpond (pkg.wolfpond.org).

We can simply edit the URL used to point out the repositories on /usr/local/etc/pkg/repos/df-latest and that's it! Remember to use pkg+https:// for Avalon.

After applying all these changes, we update the packages list again and try to check if there's already a new update to apply:

# pkg update -f
# pkg upgrade -y -f
  • Package installation

Install the tor package:

# pkg install tor

NetBSD

  • Setup pkg_add

Modern versions of the NetBSD operating system can be set to use pkgin, which is a piece of software aimed to be like apt or yum for managing pkgsrc binary packages. We are not convering its setup here, and opt to use plain pkg_add instead.

# echo "PKG_PATH=http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/$(uname -m)/$(uname -r)/All" > /etc/pkg_install.conf
  • Package installation

Install tor NetBSD's package:

# pkg_add tor

Void Linux

To install the tor package on Void Linux, please run:

# xbps-install -S tor

Installing Tor from source

  • Download latest release and dependencies

The latest release of Tor can be found on the download page.

If you're building from source, first install libevent, and make sure you have openssl and zlib (including the -devel packages if applicable).

  • Install Tor

    tar -xzf tor-0.4.3.6.tar.gz; cd tor-0.4.3.6

    ./configure && make

Now you can run tor as src/app/tor (0.4.3.x and later), or you can run make install (as root if necessary) to install it into /usr/local/, and then you can start it just by running tor.

Atenció: aquestes instruccions són per verificar el codi font de tor. Si us plau, seguiu les instruccions correctes per verificar la signatura del Navegador Tor.

La signatura digital és un procés que assegura que un paquet determinat ha estat generat pels seus desenvolupadors i no ha estat alterat. A continuació us expliquem per què és important i com verificar que el codi font de tor que baixeu és el que hem creat i no ha estat modificat per algun atacant.

Cada fitxer de la nostra pàgina de baixada va acompanyat de dos fitxers anomenats "checksum" i "sig" amb el mateix nom que el paquet i l'extensió ".sha256sum" i ".sha256sum.asc" respectivament.

El fitxer .asc verificarà que el fitxer .sha256sum (que conté la suma de verificació del paquet) no s'ha manipulat. Un cop validada la signatura (vegeu a continuació com fer-ho), la integritat del paquet es pot validar amb:

$ sha256sum -c *.sha256sum

Aquests fitxers us permeten verificar que el fitxer que heu baixat és exactament el que volíem que tinguéssiu. Això variarà segons el navegador web, però en general podeu baixar aquest fitxer fent clic amb el botó dret a l'enllaç "sig" i "checksum" i seleccionant l'opció "desa el fitxer com a".

Per exemple, tor-0.4.6.7.tar.gz va acompanyat de tor-0.4.6.7.tar.gz.sha256sum.asc. Aquests són noms de fitxer d'exemple i no coincidiran exactament amb els noms de fitxer que baixeu.

Ara us mostrem com podeu verificar la signatura digital del fitxer baixat en diferents sistemes operatius. Tingueu en compte que la signatura porta la data del moment en què s'ha signat el paquet. Per tant, cada vegada que es puja un fitxer nou es genera una nova signatura amb una data diferent. Sempre que hàgiu verificat la signatura, no us hauríeu de preocupar perquè la data notificada pugui variar.

Instal·lació de GnuPG

En primer lloc, heu de tenir instal·lat GnuPG abans de poder verificar les signatures.

Per a usuaris de Windows:

Si feu servir Windows, baixeu Gpg4win i executeu el seu instal·lador.

Per verificar la signatura, haureu d'escriure unes quantes ordres a la línia d'ordres de Windows, cmd.exe.

Per a usuaris macOS:

Si utilitzeu macOS, podeu instal·lar GPGTools.

Per verificar la signatura, haureu d'escriure algunes ordres al Terminal (a "Aplicacions").

Per a usuaris de GNU/Linux:

Si utilitzeu GNU/Linux, probablement ja tingueu GnuPG al vostre sistema, ja que la majoria de distribucions GNU/Linux l'inclouen preinstal·lat.

Per verificar la signatura, haureu d'escriure unes quantes ordres en una finestra de terminal. Com fer-ho variarà en funció de la vostra distribució.

Obtenir la clau dels desenvolupadors de Tor

Les claus següents poden signar el tarball. No espereu totes les signatures, pot variar segons qui estigui disponible per fer el llançament.

Podeu obtenir la clau amb els enllaços proporcionats més amunt o amb:

$ gpg --auto-key-locate nodefault,wkd --locate-keys ahf@torproject.org
$ gpg --auto-key-locate nodefault,wkd --locate-keys dgoulet@torproject.org
$ gpg --auto-key-locate nodefault,wkd --locate-keys nickm@torproject.org

Això us hauria de mostrar alguna cosa com (per al nickm):

gpg: key FE43009C4607B1FB: public key "Nick Mathewson <nickm@torproject.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
pub   rsa4096 2016-09-21 [C] [expires: 2025-10-04]
      2133BC600AB133E1D826D173FE43009C4607B1FB
uid           [ unknown] Nick Mathewson <nickm@torproject.org>
sub   rsa4096 2016-09-23 [S] [expires: 2025-10-04]
sub   rsa4096 2016-09-23 [E] [expires: 2025-10-04]

Si rebeu un missatge d'error, alguna cosa ha anat malament i no podeu continuar fins que no hàgiu esbrinat per què això no ha funcionat. És possible que pugueu importar la clau mitjançant la secció Solució (utilitzant una clau pública).

Després d'importar la clau, podeu desar-la en un fitxer (identificant-la per la seva empremta digital aquí):

$ gpg --output ./tor.keyring --export 0x2133BC600AB133E1D826D173FE43009C4607B1FB

Aquesta ordre fa que la clau es desi en un fitxer que es troba al camí ./tor.keyring, és a dir, al directori actual. Si ./tor.keyring no existeix després d'executar aquesta ordre, alguna cosa ha anat malament i no podeu continuar fins que no hàgiu esbrinat per què això no ha funcionat.

Verificar la signatura

Per verificar la signatura del paquet que heu baixat, haureu de baixar el fitxer de signatura .sha256sum.asc corresponent i el propi fitxer .sha256sum, i verificar-ho amb una ordre que demana a GnuPG que verifiqui el fitxer que heu baixat.

Els exemples següents suposen que heu baixat aquests dos fitxers a la vostra carpeta "Baixades". Tingueu en compte que aquestes ordres utilitzen noms de fitxer d'exemple i el vostre serà diferent: haureu baixat una versió diferent de la 9.0 i és possible que no hàgiu triat la versió anglesa (en-US).

Per a usuaris de Windows:

gpgv --keyring .\tor.keyring Downloads\tor-0.4.6.10.tar.gz.sha256sum.asc Downloads\tor-0.4.6.10.tar.gz.sha256sum

Per a usuaris macOS:

gpgv --keyring ./tor.keyring ~/Downloads/tor-0.4.6.10.tar.gz.sha256sum.asc ~/Downloads/tor-0.4.6.10.tar.gz.sha256sum

Per a usuaris de BSD/Linux:

gpgv --keyring ./tor.keyring ~/Downloads/tor-0.4.6.10.tar.gz.sha256sum.asc ~/Downloads/tor-0.4.6.10.tar.gz.sha256sum

El resultat de l'ordre hauria de produir alguna cosa com això (segons quina clau l'ha signat):

gpgv: Signature made Mon 16 Aug 2021 04:44:27 PM -03
gpgv:                using RSA key 7A02B3521DC75C542BA015456AFEE6D49E92B601
gpgv: Good signature from "Nick Mathewson <nickm@torproject.org>"

Si rebeu missatges d'error que contenen 'No existeix el fitxer o directori', o bé alguna cosa ha anat malament amb un dels passos anteriors o heu oblidat que aquestes ordres utilitzen noms de fitxer d'exemple i el vostre serà una mica diferent.

També podeu aprendre més sobre GnuPG.

Verificar la suma de verificació

Ara que hem validat les signatures de la suma de verificació, hem de verificar la integritat del paquet.

Per a usuaris de Windows:

certUtil -hashfile tor-0.4.6.10.tar.gz.sha256sum SHA256

Per a usuaris macOS:

shasum -a 256 tor-0.4.6.10.tar.gz.sha256sum

Per a usuaris de BSD/Linux:

sha256sum -c tor-0.4.6.10.tar.gz.sha256sum