


CentOS 7にTorをインストールしてみました。
Tor Project: Anonymity Online
https://www.torproject.org/
yumでインストールしてみます。
Tor packages for RPM-based linux distributions.
https://www.torproject.org/docs/rpms.html.en#rpms
- レポジトリファイルの作成
- Torのインストール
- 環境設定ファイルの編集
- 環境設定ファイルのチェック
- Firewallの許可
- Torの起動
- 動作確認
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[root@host01 ~]# vi /etc/yum.repos.d/torproject.repo [root@host01 ~]# cat /etc/yum.repos.d/torproject.repo [tor] name=Tor repo enabled=1 baseurl=https://deb.torproject.org/torproject.org/rpm/el/7/$basearch/ gpgcheck=1 gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc [tor-source] name=Tor source repo enabled=1 autorefresh=0 baseurl=https://deb.torproject.org/torproject.org/rpm/el/7/SRPMS gpgcheck=1 gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
[root@host01 ~]# yum info tor 読み込んだプラグイン:fastestmirror base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 tor | 2.9 kB 00:00:00 tor-source | 2.9 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/3): updates/7/x86_64/primary_db | 2.5 MB 00:00:00 (2/3): tor/x86_64/primary_db | 4.2 kB 00:00:00 (3/3): tor-source/primary_db | 2.5 kB 00:00:01 Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp 利用可能なパッケージ 名前 : tor アーキテクチャー : x86_64 バージョン : 0.2.6.9 リリース : tor.1.rh7_1_1503 容量 : 1.8 M リポジトリー : tor/x86_64 要約 : Anonymizing overlay network for TCP (The onion router) URL : https://www.torproject.org/ ライセンス : 3-clause BSD 説明 : Tor is a connection-based low-latency anonymous communication system. : : Clients choose a source-routed path through a set of relays, and : negotiate a "virtual circuit" through the network, in which each relay : knows its predecessor and successor, but no others. Traffic flowing : down the circuit is decrypted at each relay, which reveals the : downstream relay. : : Basically, Tor provides a distributed network of relays. Users bounce : their TCP streams (web traffic, ftp, ssh, etc) around the relays, and : recipients, observers, and even the relays themselves have difficulty : learning which users connected to which destinations. : : This package enables only a Tor client by default, but it can also be : configured as a relay and/or a hidden service easily. : : Client applications can use the Tor network by connecting to the local : socks proxy interface provided by your Tor instance. If the application : itself does not come with socks support, you can use a socks client : such as torsocks. : : Note that Tor does no protocol cleaning on application traffic. There : is a danger that application protocols and associated programs can be : induced to reveal information about the user. Tor depends on Torbutton : and similar protocol cleaners to solve this problem. For best : protection when web surfing, the Tor Project recommends that you use : the Tor Browser Bundle, a standalone tarball that includes static : builds of Tor, Torbutton, and a modified Firefox that is patched to fix : a variety of privacy bugs. [root@host01 ~]# yum -y install tor 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile * base: www.ftp.ne.jp * extras: www.ftp.ne.jp * updates: www.ftp.ne.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ tor.x86_64 0:0.2.6.9-tor.1.rh7_1_1503 を インストール --> 依存性の処理をしています: libevent >= 1.4.13 のパッケージ: tor-0.2.6.9-tor.1.rh7_1_1503.x86_64 --> 依存性の処理をしています: libevent-2.0.so.5()(64bit) のパッケージ: tor-0.2.6.9-tor.1.rh7_1_1503.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ libevent.x86_64 0:2.0.21-4.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました ================================================================================================ Package アーキテクチャー バージョン リポジトリー 容量 ================================================================================================ インストール中: tor x86_64 0.2.6.9-tor.1.rh7_1_1503 tor 1.8 M 依存性関連でのインストールをします: libevent x86_64 2.0.21-4.el7 base 214 k トランザクションの要約 ================================================================================================ インストール 1 パッケージ (+1 個の依存関係のパッケージ) 総ダウンロード容量: 2.0 M インストール容量: 7.9 M Downloading packages: (1/2): libevent-2.0.21-4.el7.x86_64.rpm | 214 kB 00:00:00 warning: /var/cache/yum/x86_64/7/tor/packages/tor-0.2.6.9-tor.1.rh7_1_1503.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 5ac001f1: NOKEY tor-0.2.6.9-tor.1.rh7_1_1503.x86_64.rpm の公開鍵がインストールされていません (2/2): tor-0.2.6.9-tor.1.rh7_1_1503.x86_64.rpm | 1.8 MB 00:00:02 ------------------------------------------------------------------------------------------------ 合計 850 kB/s | 2.0 MB 00:00:02 https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc から鍵を取得中です 。 Importing GPG key 0x5AC001F1: Userid : "torproject.org RPM signing key" Fingerprint: 3b9e eeb9 7b1e 827b cf0a 0d96 8af5 653c 5ac0 01f1 From : https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc Running transaction check Running transaction test Transaction test succeeded Running transaction インストール中 : libevent-2.0.21-4.el7.x86_64 1/2 インストール中 : tor-0.2.6.9-tor.1.rh7_1_1503.x86_64 2/2 検証中 : libevent-2.0.21-4.el7.x86_64 1/2 検証中 : tor-0.2.6.9-tor.1.rh7_1_1503.x86_64 2/2 インストール: tor.x86_64 0:0.2.6.9-tor.1.rh7_1_1503 依存性関連をインストールしました: libevent.x86_64 0:2.0.21-4.el7 完了しました! |
/etc/tor/には下記の3つのファイルが作成されていますが、yumでインストールした場合に使用されるファイルはtor-rpm-defaults-torrcになります。
1 2 3 |
/etc/tor/tor-rpm-defaults-torrc /etc/tor/torrc /etc/tor/torrc.sample |
最初/etc/tor/torrcをあれこれ編集していても全くダメでした(^^;;
取り敢えず起動してプロセスを確認してらこんな状態で…早く気付けと(;_;
1 2 |
[root@host01 ~]# ps ax | grep tor 1809 ? S 0:00 /usr/bin/tor --hush --defaults-torrc /etc/tor/tor-rpm-defaults-torrc |
もし通常(?)の状態にしたいならば起動スクリプト(/etc/init.d/tor)を変更して下さい。
1 |
DEFAULT_ARGS="--hush --defaults-torrc /etc/tor/tor-rpm-defaults-torrc" |
今回は/etc/tor/tor-rpm-defaults-torrcでインストールします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[root@host01 ~]# vi /etc/tor/tor-rpm-defaults-torrc [root@host01 ~]# cat /etc/tor/tor-rpm-defaults-torrc # You probably want to edit torrc file instead of this one. # These are just fallback variables for --defaults-torrc Tor option. SocksPort 9050 # Default: Bind to localhost:9050 for local connections. SocksPolicy accept 192.168.1.0/24 SocksPolicy reject * DataDirectory /var/lib/tor PidFile /var/run/tor/tor.pid RunAsDaemon 1 User _tor #ControlSocket /var/run/tor/control #ControlSocketsGroupWritable 1 #CookieAuthentication 1 CookieAuthFileGroupReadable 1 CookieAuthFile /var/run/tor/control.authcookie Log notice file /var/log/tor/tor.log |
1 2 3 4 |
[root@host01 ~]# tor -f /etc/tor/tor-rpm-defaults-torrc --verify-config Jul 7 15:47:11.467 [notice] Tor v0.2.6.10 (git-xxxxxxxxxx) running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.1e-fips and Zlib 1.2.7. Jul 7 15:47:11.467 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning Jul 7 15:47:11.467 [notice] Read configuration file "/etc/tor/tor-rpm-defaults-torrc". |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@host01 ~]# firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="192.168.1.0/24" port protocol="tcp" port="9050" accept" success [root@host01 ~]# firewall-cmd --reload success [root@host01 ~]# firewall-cmd --list-all public (default, active) interfaces: eno16777984 sources: services: dhcpv6-client ssh ports: masquerade: no forward-ports: icmp-blocks: rich rules: rule family="ipv4" source address="192.168.1.0/24" port port="9050" protocol="tcp" accept |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@host01 ~]# chkconfig --list 注記: この出力は SysV サービスのみであり、ネイティブな systemd のサービスは含ま れていません。 systemd services. SysV 設定のデータはネイティブな systemd の設定によって上書きされます。 systemd サービスを一覧表示するには 'systemctl list-unit-files' を使用して ください。 特定のターゲットにおいて有効化されているサービスを確認するには、 'systemctl list-dependencies [target]' 。 netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off tor 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@host01 ~]# /etc/init.d/tor start Starting tor...done. [root@host01 ~]# /etc/init.d/tor status tor (pid 3666) running |
Internet Explorerのプロキシを設定して動作確認をしてみます。
下記のサイトにアクセスして”Congratulations. This browser is configured to use Tor. “と表示されればTor Networkに接続しています。
https://check.torproject.org/