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

Do not use the packages in Ubuntu's universe. In the past they have not reliably been updated. That means you could be missing stability and security fixes.

  1. Configure Tor package repository

Enable the Tor Project APT repository by following the instructions.

  1. Package installation

    # apt install tor

Fedora

  1. Configure Tor Package repository

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

  1. Package installation

    # dnf install tor

FreeBSD

  1. Package installation

    # pkg install tor

OpenBSD

  1. Package installation

    # pkg_add tor

macOS

  1. 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.

  1. 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

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

DragonFlyBSD

  1. 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

1.1 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
  1. Package installation

Install the tor package:

# pkg install tor

NetBSD

  1. 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
  1. 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

  1. 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).

  1. 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.

주목: 다음 안내사항은 Tor 소스 코드의 검증을 위한 것입니다. Tor 브라우저의 서명을 검증하는 과정을 기재된 방식에 따라 제대로 진행해주세요

디지털 서명은 주어진 패키지가 원 개발자가 생성한 것이고 이후 손대지 않은 것임을 보장하는 절차입니다. 다운로드 받은 tor 소스 코드가 Tor 프로젝트에서 만들었고, 공격자에 의해 개조되지 않았음을 검증하는 게 왜 중요한지 그 이유와 검증 방법을 아래에 설명해뒀습니다.

Tor 프로젝트의 다운로드 페이지 에 있는 각 파일을 다운로드 받을 때 'checksum'과 'sig'라 명명된 두 파일을 같이 받게 됩니다. 이 두 파일의 이름 자체는 패키지와 같으며, 확장자가 각각 '.sha256sum', '.sha256sum.asc'입니다.

.asc 파일로 (패키지 검사합계가 포함된) .sha256sum 파일이 변조되지 않고 원본 그대로인지 여부를 검증합니다. 서명이 검증된 후(하단에서 서명이 검증되는 방식을 살펴보세요), 다음을 통해 패키지 무결성을 검증됩니다:

$ sha256sum -c *.sha256sum

위 파일을 통해 다운로드 한 파일이 Tor 측에서 제공하려 했던 파일과 정확히 같은지 검증할 수 있습니다. 웹 브라우저마다 다르지만, 일반적으로 'sig'와 'checksum' 링크를 오른쪽 마우스 버튼으로 클릭한 후, 'save file as' 옵션을 선택해 이 파일을 다운로드할 수 있습니다.

예를 들어, tor-0.4.6.7.tar.gztor-0.4.6.7.tar.gz.sha256sum.asc와 대응됩니다. 위의 파일 이름은 예시일 뿐, 귀하가 다운로드 받은 파일 이름과는 정확하게 일치하지 않습니다.

지금부터는 다운로드 받은 파일의 디지털 서명을 검증하는 방법을 운영 체제에 따라 설명해드리겠습니다. 서명에 기재된 날짜는 패키지가 서명된 순간을 의미함을 유의하세요. 따라서 새로운 파일이 업로드될 때마다, 새로운 서명이 생성되며, 기재된 날짜도 달라지게 됩니다. 서명을 검증한 이상 더이상 확인된 날짜가 상이하다고 해서 걱정할 필요가 없습니다.

GnuPG 설치하기

서명을 검증하기 전에 우선 GnuPG가 설치돼있어야 합니다.

윈도우 사용자라면:

Windows를 사용 중이라면, Gpg4win를 다운로드 받으세요. 그 후 다운로드 받은 '설치 도우미'를 실행하세요.

서명을 검증하려면 윈도우 명령 행인 cmd.exe에 명령 몇 개를 입력해야 합니다.

macOS 사용자라면:

macOS를 사용 중이라면, GPGTools를 설치하세요.

서명을 검증하려면 터미널('애플리케이션' 메뉴 내에 있습니다)에 명령 몇 개를 입력해야 합니다.

GNU/LINUX 사용자라면:

GNU/Linux를 사용한다면 GnuPG가 이미 시스템 내에 있을 겁니다. GNU/Linux 배포판 대다수엔 사전 설치 돼있거든요.

서명을 검하려면 터미널 창에 명령을 몇 개 입력해야 합니다. 귀하가 받은 배포판에 따라 하는 방법에 차이가 있습니다.

Tor 개발자 키 인출하기

다음에 제시되는 키로 tarball에 서명할 수 있습니다. 그 릴리스의 개발자가 누구냐에 따라 차이가 있으니 너무 기대하진 마세요.

상단의 링크에서 키를 인출할 수 있습니다. 아니면 다음을 통해서도 가능합니다:

$ 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

이를 사용할 경우 다음과 같이 떠야 합니다 (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]

오류 메시지가 표시되면 문제가 발생한 것이며 이 오류가 발생한 이유를 파악할 때까지 진행할 수 없습니다. Workaround (using a public key) 섹션을 대신 사용해 키를 가져올(import) 수도 있습니다.

키를 가져온 후, 파일(파일에 있는 지문을 통해 키를 식별할 수 있습니다)에 저장할 수 있습니다:

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

이 명령을 사용하면, 키가 ./tor.keyring 경로, 즉 현 디렉터리에 파일 형태로 저장됩니다. 이 명령을 사용했음에도 ./tor.keyring경로가 없다면, 뭔가 잘못된 겁니다. 문제의 원인을 찾을 때까지 더이상 진행할 수 없습니다.

서명의 검증

다운로드한 패키지의 서명을 검증하려면, 상응하는 .sha256sum.asc 서명 파일과 .sha256sum 파일을 따로 다운로드 받아야 합니다. 그 후 GnuPG가 다운로드한 파일을 검증하도록 하는 명령을 입력해 검증합니다.

하단의 예시는 귀하가 두 파일을 'Downloads' 폴더에 받았을 것을 상정하고 작성됐습니다. 이러한 명령에 적혀있는 파일명은 예시이지, 귀하가 받은 실제 파일명과는 상이한 점에 유의하세요: 예시엔 9.0이라 적혀있지만, 귀하가 다운로드 받은 버전은 이보다 높을 것입니다. 예시로 기재된 English (en-US) 버전이 아닌 다른 언어로 받으셨을 수도 있고요.

윈도우 사용자라면:

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

macOS 사용자라면:

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

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

명령의 결과가 다음과 같이 산출돼야 합니다(서명된 키에 따라 다릅니다) :

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>"

'해당 파일이나 디렉터리가 없습니다(No such file or directory)'라는 에러 메시지가 송출될 경우, 이전까지의 단계를 진행하면서 뭔가 잘못 했을 수 있습니다. 혹은 명령을 입력할 때 예시에 적힌 파일 이름을 그대로 적어서 문제가 발생한 것일 수도 있어요. 귀하가 받은 파일 이름과 예시 파일 이름은 살짝 다르거든요.

GnuPG에 대해 더 알아보셔도 좋습니다.

검사합 검증

검사합 서명이 적합함을 확인했다면, 이제 패키지의 무결성을 검증해야 합니다.

윈도우 사용자라면:

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

macOS 사용자라면:

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

BSD/Linux 사용자:

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