Little-t-tor

注意: これらの手順は、ネットワークデーモン、つまり little-t-tor をインストールするためのものです。 Tor Browser のインストール方法につきましては、Tor Browser ユーザーマニュアルをご覧ください。

管理者権限: Tor をインストールするには root 権限が必要です。 apt や dpkg のように root ユーザーとして実行する必要があるコマンドの下には、すべて # が付加されています。一方、ユーザーとして実行するコマンドには、ターミナルの標準プロンプトに似た $ が付加されています。

Debian / Ubuntu

Ubuntu universe 内のパッケージは使用しないでください。 過去には確実に更新されていませんでした。 つまり、安定性とセキュリティ上の問題が修正されないままになる可能性があります。

Tor パッケージリポジトリの設定

以下の手順に沿って、Tor Project APT リポジトリを有効にします。

パッケージのインストール

# apt install tor

Fedora

Tor パッケージリポジトリの設定

以下の手順に沿って、Tor Project の RPM パッケージリポジトリを有効にします。

パッケージのインストール

# dnf install tor

FreeBSD

パッケージのインストール

# pkg install tor

OpenBSD

パッケージのインストール

# pkg_add tor

macOS

パッケージマネージャーのインストール

OS X には Homebrew と Macports の2つのパッケージマネージャーがあります。 お好きなパッケージマネージャーをご利用ください。

Homebrew をインストールするには、brew.sh の指示に沿ってください。

Macports をインストールするには、macports.org の指示に沿ってください。

パッケージのインストール

ターミナルウィンドウで Homebrew をご利用の場合は、以下のコマンドを実行します。

# brew install tor

ターミナルウィンドウで Macports をご利用の場合は、以下のコマンドを実行します。

$ sudo port install tor

Arch Linux

tor パッケージを Arch Linux にインストールするには、以下のコマンドを実行します。

# pacman -Syu tor

DragonFlyBSD

ブートストラップ pkg

DragonFlyBSD の日次スナップショットとリリース (3.4から) には、すでに pkg がインストールされています。ただし、以前のリリースからのアップグレードにはありません。何らかの理由で pkg がシステムにない場合は、ソースからビルドしたり、DPorts をインストールしたりしなくても、簡単にブートストラップできます。

# cd /usr
# make pkg-bootstrap
# rehash
# pkg-static install -y pkg
# rehash

pkg のセットアップの推奨手順

ここでは、FreeBSD システムで使用しているものと似ています。また、HTTPS を使用してパッケージと更新プログラムを取得します。そのため、ここでは追加のパッケージ (ca_root_nss) も必要です。

ca_root_nss パッケージのインストール

# pkg install ca_root_nss

新規インストールの場合、ファイル /usr/local/etc/pkg/repos/df-latest.conf.sample/usr/local/etc/pkg/repos/df-latest にコピーされます。拡張子 ".sample" で終わるファイルは無視されます。pkg (8) は ".conf" で終わるファイルのみを読み込み、見つかった数だけ読み込みます。

DragonflyBSD は 2 つのパッケージリポジトリを持っています。

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

/usr/local/etc/pkg/repos/df-latest のリポジトリを示すために使用される URLを編集するだけです。Avalon には pkg+https:// をご利用ください。

これらすべての変更を適用した後、パッケージリストを再度更新し、適用する新しい更新が既にあるかどうかをご確認ください。

# pkg update -f
# pkg upgrade -y -f

パッケージのインストール

tor パッケージをインストールします。

# pkg install tor

NetBSD

pkg_add のセットアップ

NetBSD オペレーティングシステムの最近のバージョンでは、pkgsrc バイナリーパッケージを管理するための aptyum のようなソフトウェアである pkgin を使用するように設定できます。ここでは設定を変換せず、代わりに単純な pkg_add を使用します。

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

パッケージのインストール

NetBSD の tor パッケージをインストールします。

# pkg_add tor

Void Linux

Void Linux に tor パッケージをインストールするには、以下のコマンドを実行します。

# xbps-install -S tor

ソースからの Tor のインストール

最新リリースと依存関係のダウンロード

Tor の最新リリースはダウンロードページにあります。

ソースからビルドする場合は、まず libevent をインストールし、openssl と zlib (該当する場合は-develパッケージを含む) があることをご確認ください。

Tor のインストール

tar -xzf tor-<version>.tar.gz; cd tor-<version>

<version>を tor の最新バージョン、例えば tor-0.4.8.12 のように置き換えてください。

./configure && make

これで、tor を src/app/tor として実行するか (0.4.3.x以降) 、make install を (必要に応じて root として) 実行して /usr/local/ にインストールし、tor を実行するだけで起動できるようになります。

注意: これらの手順は、Tor のソースコードを検証するためのものです。 Tor Browser の署名を確認するには、正しい手順に沿ってください。

デジタル署名とは、パッケージが開発者によって生成されたものであり、改ざんされていないことを保証するプロセスです。 以下では、なぜそれが重要なのか、またダウンロードした Tor ソースコードが私たちの作成したものであり、攻撃者によって改ざんされていないことを確認する方法をご説明します。

私たちのダウンロードページにある各ファイルには、パッケージと同じ名前で拡張子がそれぞれ ".sha256sum" と ".sha256sum.asc " の、"checksum" と "sig" とラベル付けされた2つのファイルが付属しています。

.asc ファイルは、 (パッケージのチェックサムを含む) .sha 256 sumファイルが改ざんされていないことを検証します。署名が検証されると (その方法については以下を参照) 、パッケージの整合性を次の方法で検証できます。

$ sha256sum -c *.sha256sum

これらのファイルを使用すると、ダウンロードしたファイルが意図したものであることを検証できます。 これはウェブブラウザーによって異なりますが、通常は "sig" と "checksum" のリンクを右クリックし、「名前を付けてファイルを保存」オプションを選択することで、このファイルをダウンロードできます。

例えば、tor-0.4.6.7.tar.gz には tor-0.4.6.7.tar.gz.sha256sum.asc が付属しています。 これらはファイル名の例であり、ダウンロードするファイル名と完全に一致するとは限りません。

ここでは、さまざまなオペレーティングシステムでダウンロードしたファイルのデジタル署名を検証する方法についてご説明します。 署名はパッケージに署名された時点で日付が付けられます。 したがって新しいファイルがアップロードされる度に、新しい署名が異なる日付で生成されます。 署名を確認していれば、報告された日付が異なることを心配する必要はありません。

GnuPG のインストール

署名を検証するには、まず GnuPG をインストールする必要があります。

Windows ユーザーの場合:

Windows を使用している場合、Gpg4win をダウンロードして実行してください。

署名を検証するためには、Windows のコマンドライン 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]

エラーメッセージが表示された場合、何か問題が発生したため、これが機能しなかった原因が分かるまで続行できません。 代わりに 回避策 (公開鍵を使用) セクションを使用してキーをインポートできる場合があります。

キーをインポートしたら、ファイルに保存できます (ここではフィンガープリントで識別します) 。

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

このコマンドを実行すると、鍵はパス ./tor.keyring にあるファイル、つまり現在のディレクトリーに保存されます。 このコマンドを実行した後、./tor.keyring が存在しない場合、何か問題が発生したため、これが機能しなかった原因が分かるまで続行できません。

署名を検証する

ダウンロードしたパッケージの署名を検証するには、対応する .sha256sum.asc 署名ファイルと .sha256sum ファイルそのものをダウンロードし、GnuPG にダウンロードしたファイルの検証を依頼するコマンドで検証する必要があります。

以下の例では、これら2つのファイルを「Downloads」フォルダーにダウンロードしたものとします。 これらのコマンドはファイル名の例であり、あなたのファイル名は異なる可能性があることにご注意ください。あなたは 9.0 以外のバージョンをダウンロードし、英語 (en-US) ではない言語を選択していない可能性があります。

Windows ユーザーの場合:

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 の詳細もご覧ください。

チェックサムを検証する

チェックサムの署名を検証したので、パッケージの整合性を検証する必要があります。

Windows ユーザーの場合:

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

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

Direct access to the Tor network may sometimes be blocked. Tor can be used with circumvention tools, known as pluggable transports, for getting around these blocks. obfs4, Snowflake and WebTunnel are some pluggable transports available to use with Tor. Tor can be configured to use pluggable transports by modifying Tor's configuration file i.e. torrc.

Steps to configure tor to use pluggable transports for different operating systems are as follows.

  • Download and install tor or the Tor Expert Bundle for your operating system. If access to the Tor Project website is blocked, use an official Tor Project mirror.

  • If you have tor installed, pluggable transport binaries can be downloaded as part of the Tor Expert Bundle. Pluggable transport binaries available as part of the Tor Expert Bundle:

    • lyrebird : implements several pluggable transport protocols, including obfs4 and WebTunnel.
    • snowflake-client : implements the Snowflake pluggable transport.
  • Extract the Tor Expert Bundle to a directory of your choice.

  • For pluggable transports, obfs4 and WebTunnel, obtain bridges from the bridges website, via Email or via Telegram.

  • Modify Tor's configuration file, i.e. torrc. Copy and modify the following sample torrc according to the operating system. If you have installed little-t tor on Linux, you will have to modify the default torrc.

Configuring tor to use obfs4 or WebTunnel

UseBridges 1
# Uncomment the line below for Windows and include the path to the pluggable transport executable (Example: C:\Users\user\Downloads\tor\pluggable_transports\lyrebird.exe)
#ClientTransportPlugin meek_lite,obfs4,webtunnel exec <path-of-executable>

# Uncomment the line below for macOS and include the path to the pluggable transport executable (Example: /Users/user/Downloads/tor/pluggable_transports/lyrebird)
#ClientTransportPlugin meek_lite,obfs4,webtunnel exec <path-of-executable>

# Uncomment the line below for Linux and include the path to the pluggable transport executable (Example: /home/user/Downloads/tor/pluggable_transports/lyrebird)
#ClientTransportPlugin meek_lite,obfs4,webtunnel exec <path-of-executable>

Bridge obfs4 <IP ADDRESS>:<PORT> <FINGERPRINT> cert=<CERTIFICATE> iat-mode=0
Bridge webtunnel <IP ADDRESS>:<PORT> <FINGERPRINT> url=<URL> ver=0.0.1

Configuring tor to use Snowflake

UseBridges 1
# Uncomment the line below for Windows and include the path to the pluggable transport executable (Example: C:\username\Browser\TorBrowser\tor\pluggable_transports\snowflake-client.exe)
#ClientTransportPlugin snowflake exec <path-of-executable>

# Uncomment the line below for macOS and include the path to the pluggable transport executable (Example: /Users/user/Downloads/tor/pluggable_transports/snowflake-client)
#ClientTransportPlugin snowflake exec <path-of-executable>

# Uncomment the line below for Linux and include the path to the pluggable transport executable (Example: /home/user/Downloads/tor/pluggable_transports/snowflake-client)
#ClientTransportPlugin snowflake exec <path-of-executable>

Bridge snowflake 192.0.2.3:80 2B280B23E1107BB62ABFC40DDCC8824814F80A72 fingerprint=2B280B23E1107BB62ABFC40DDCC8824814F80A72 url=https://1098762253.rsc.cdn77.org front=www.phpmyadmin.net,cdn.zk.mk ice=stun:stun.antisip.com:3478,stun:stun.epygi.com:3478,stun:stun.uls.co.za:3478,stun:stun.voipgate.com:3478,stun:stun.mixvoip.com:3478,stun:stun.nextcloud.com:3478,stun:stun.bethesda.net:3478,stun:stun.nextcloud.com:443 utls-imitate=hellorandomizedalpn
  • Save the torrc file.

  • Run tor from the command line: ./tor -f torrc

  • Note: If you have installed little-t tor on Linux and modified the default torrc, you will have to restart the daemon.

Troubleshooting

  • If Tor fails to connect, check that the torrc file is correctly formatted.
  • If tor is installed from the Tor Expert Bundle ensure the torrc file is in the same folder as the tor binary.
  • Check the Tor logs for errors.
  • After exhausting these common troubleshooting steps, if the connection still fails, the bridges you received may be offline or blocked. Obtain new set of bridges from the bridges website, via Email or via Telegram.