トップ «前の日記(2009年01月27日) 最新 次の日記(2009年02月05日)» 編集

Masa's blog

検索キーワード:

2009年01月29日 zebedee [長年日記]

_ zebedee

低速インターネット環境の苦しみから開放される方法

某所のナローバンドな環境から自宅のブロードバンドな環境のサーバ上のプロキシを、zebedeeのデータ圧縮機能&暗号化機能を介して利用し、機密性を保持しながらアクセス速度の向上を企てることを夢想する。

                          |
           Private        |        Global
                          |
                          |
                          |            SLOOOW Internet                         FAST Internet
[ Browser ] <--> [ zebedee(client) ] <-----------------> [ zebedee(server) ] <---------------> [ 色んなサーバ ]
                          |            data complession     with delegated
                          |               by zebedee

インストール(クライアント&サーバ)

http://www.winton.org.uk/zebedee/download.htmlから

  • blowfish-0.9.5a.tar.gz
  • zlib-1.2.3.tar.gz
  • zip2-1.0.3.tar.gz
  • zebedee-2.4.1A.tar.gz

を取得し、全てを同一のディレクトリで展開し、順番にビルドしていく。最後のzedbeeに関してはMakefileをいじって/usr/local/以下にインストールするようにし、

$ make OS=linux
# make OS=linux install

でインストールした。

設定 (クライアント側)

クライアント機の秘密鍵(server.key)と公開鍵(server.id)を作成する。この公開鍵(server.id)をサーバ側に登録(後述)することにより、秘密鍵(server.key)を持ったクライアントのみが接続できるようになる。

# cd /usr/local/lib/zebedee
# zebedee -p >server.key
# zebedee -P -f server.key >server.id

/usr/local/lib/zebedee/以下はzebedeeの実行ユーザからのみアクセスできればいいので、

# cd /usr/local/lib/zebedee && chmod 600 *

クライアント設定ファイル(client.zbd)を作成し、認証に利用する秘密鍵(server.key)を指定する。

# cd /usr/local/lib/zebedee
# echo "include '/usr/local/lib/zebedee/server.key'" >client.zbd

最後にzbedeeをクライアントとして起動する。

# /usr/local/bin/zebedee -f /usr/local/lib/zebedee/client.zbd -z 6 8080:myh.no-ip.org:8080
  • -z 6 は圧縮レベルの指定。0-9で指定する(0が圧縮無し、9が最高)
  • 8080(クライアントの待受ポート):myh-no-ip.org(転送先サーバ):8080(転送先ポート)

転送先サーバの転送先ポートはdelegeted(プロキシ)の待ち受けポートになっている。

設定 (サーバ側)

クライアント機の公開鍵(server.id)を取り込む。

# cd /usr/local/lib/zebedee
# vi clients.id <-- クライアント機の公開鍵(server.id)の内容を、そのままコピーする

サーバ設定ファイル(server.zbd)を修正し、clients.idに登録されたクライアントからの接続のみを許可する。

root@lib100:/usr/local/lib/zebedee# diff -c server.zbd.ORG server.zbd
*** server.zbd.ORG      2009-01-29 18:08:06.000000000 +0900
--- server.zbd  2009-01-29 16:58:40.000000000 +0900
***************
*** 11,19 ****
  # Comment out the following line once you have read the comments
  # in this file and enabled or disabled the appropriate options!

! message "DEFAULT CONFIGURATION FILE -- EDIT BEFORE USE"

! detached false        # You will probably want this 'true' for normal
                # use but I want to make sure that you see the
                # preceding message if you haven't edited this.

--- 11,20 ----
  # Comment out the following line once you have read the comments
  # in this file and enabled or disabled the appropriate options!

! ##message "DEFAULT CONFIGURATION FILE -- EDIT BEFORE USE"

! detached true
! ##detached false      # You will probably want this 'true' for normal
                # use but I want to make sure that you see the
                # preceding message if you haven't edited this.

***************
*** 46,51 ****
--- 47,53 ----
  # the following:
  #
  #  checkidfile './clients.id'
+ checkidfile '/usr/local/lib/zebedee/clients.id'

  # The "redirect" expression can be use to set the default ports
  # allowed when a target specification consists of a hostname but

最後にzebedeeをサーバとして起動する。

# /usr/local/bin/zebedee -f /usr/local/lib/zebedee/server.zbd -s -z 6 -r 8080
  • -s はサーバモード指定
  • -z 6 は圧縮レベルの指定。0-9で指定する(0が圧縮無し、9が最高)
  • -r 8080 は転送先ポートの制限

仕上げ

某所ナローバンド環境のブラウザどものプロキシ設定を[クライアント:8080]に向ける。

注意

サーバはデフォルトでは11965/tcpで接続を待つので、クライアントからアクセスできるようにファイヤウォールの設定等を行うこと。

また、1024番ポート以降を使ってるので、zebedeeの実効ユーザはrootである必要が無い。セキュリティ上は専用のユーザを設けて、そのユーザとして起動するのが好ましい。