perl perl-suid libjcode-perl のインストール
# apt-get install perl perl-suid libjcode-perl
htroff_2.0-1 のインストール
# wget http://www.gfd-dennou.org/arch/cc-env/htroff/htroff_2.0-1_all.deb # dpkg -i htroff_2.0-1_all.deb
ユーザ ID は 1 -- 999 の間 (システムユーザ領域) に設定する
# adduser --uid 500 --disabled-password gate
http://www.ep.sci.hokudai.ac.jp/~gate/hyousi.html のメンバーを参照のこと
# vi /etc/group gate:x:500:odakker
.shosts 認証を可能にする. /etc/ssh/sshd_config を以下のように編集する
(変更前) IgnoreRhosts yes HostbasedAuthentication no (変更後) IgnoreRhosts no HostbasedAuthentication yes
ファイル編集後, ssh を再起動
# /etc/init.d/ssh restart
gate ユーザになる
$ sudo -u gate -s -H
.shhosts を作成
$ cd /home/gate $ vi .shosts orange.ep.sci.hokudai.ac.jp gate と書き込む
.shosts のパーミッションを, gate ユーザ以外見られないように設定
$ chmod 600 .shosts
/usr/bin/ssh, /usr/bin/ssh-keygen の s ビットが立っていることを確認
$ ls -lg /usr/bin/ssh /usr/bin/ssh-keygen
/etc/ssh/ssh_config に以下の 2 行を追加
HostbasedAuthentication yes PreferredAuthentications hostbased,publickey,password
orange の公開鍵が既に存在しているか調べる
$ grep orange /home/gate/.ssh/known_hosts
ssh ログインする
$ ssh orange.ep.sci.hokudai.ac.jp
orange で先ほどと同じようにして .ssh/known_hosts を確認
$ ssh takuya@www.ep.sci.hokudai.ac.jp takuya@orange:~$ sudo -u gate -s -H gate@orange:/home/takuya$ cd /home/gate gate@orange:~$ grep sango .ssh/known_hosts sango.ep.sci.hokudai.ac.jp,133.50.160.53 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6CKnsDb84CUMOZjTuZcb8gNtzCxND2bmGPX7at/abK3VbIxw8l9fFbBpUDv9R0H8kHFeOWVcpxdVS0oG04n2gIrzPfUI2dpPPJYtZuTn4I2aege2C51sEKPTIMfcplYX+vQoxelvkC6Z/gUYPdciRRtGln6hVnpA01g+fffmnIv67H7YWx5VR0sny/yuSc+TBs/WBzBHpZmS1OXutF8a4iBsW5ByRk0sSADZ5WWySVrAzlNDpBVs9aVkKPViKJVZYj+hszwLvwalWf+DMjL9Ru4MiBT5CgdojeXIXryXJHsvVX4Su4yiwt/3MrhZU4Pd3gcPT7h6o8csmvsoNK6WGw== sango ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEArz6xvUg19f8BBZPpLkCFCgdt+eubcc+/5EE/X6wiKrFLSt1N4Rblyxj5DiHMMe83ptR0BaQaEglIVQNmL5rJKcdGMJPsxum4V2y346m9vrHI2+y+ikK0Sw1cqrZCy4hhdUKoCWC9XRJiLGC/LZcgWJdmvQ/lJz0bASZHPtzHQ4s=
sango から新たに公開鍵を取得
$ ssh sango.ep.sci.hokudai.ac.jp
ユーザ gate で作業
$ tar xvfz gate-toroku-system.tar.gz
作成された gate-toroku-system ディレクトリに移動
$ cd gate-toroku-system_20XX-XX-XX
Config.mk の生成
$ perl ./config.pl
make によるコンパイル
$ make
インストール
$ exit (gate ユーザから, 一般ユーザに戻る) $ sudo -s # cd /home/gate/gate-toroku-system_20XX-XX-XX # cp include/gate.conf /etc/gate.conf # make install
デーモンモードで起動するため, /etc/gate.conf で
$USE_DEAMON = 1;
と表示されているのを確認する.
squeeze において inetd は標準装備ではない
# apt-get install openbsd-inetd insserv: warning: script 'K01qmail' missing LSB tags and overrides insserv: warning: script 'qmail' missing LSB tags and overrides Not starting internet superserver: no services enabled.
/etc/inetd.conf に以下を書き込む
gate stream tcp nowait root /usr/sbin/tcpd /usr/local/lib/gate/gate-daily -N
/etc/services に以下を追記
gate 8888/tcp
/etc/inetd を再起動
# kill -HUP `cat /var/run/inetd.pid` cat: /var/run/inetd.pid: そのようなファイルやディレクトリはありません kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
inetd を起動
# /etc/init.d/openbsd-inetd start
gate のポートには, 登録サーバである orange 以外のホストはアクセスできない用にする.
# vi /etc/hosts.deny gate-daily: ALL # vi /etc/hosts.allow gate-daily: orange.ep.sci.hokudai.ac.jp
アクセスの確認
# tcpdmatch gate-daily mail.ep.sci.hokudai.ac.jp warning: mail.ep.sci.hokudai.ac.jp: hostname alias warning: (official name: grey.ep.sci.hokudai.ac.jp) client: hostname grey.ep.sci.hokudai.ac.jp client: address 133.50.160.50 server: process gate-daily matched: /etc/hosts.deny line 20 access: denied ^^^^^^ # tcpdmatch gate-daily orange.ep.sci.hokudai.ac.jp client: hostname orange.ep.sci.hokudai.ac.jp client: address 133.50.160.51 server: process gate-daily matched: /etc/hosts.allow line 13 access: granted ^^^^^^^
/etc/passwd, /etc/shadow, /etc/group, /etc/sudoers ファイルのバックアップを mondo0 のホームディレクトリ以下に作成しておく
# cp /etc/passwd /home/mondo0/ # cp /etc/shadow /home/mondo0/ # cp /etc/group /home/mondo0/ # cp /etc/sudoers /home/mondo0/ # cd /home/mondo0 # chmod 400 passwd shadow group sudoers
www (orange) サーバから sango の gate ポートに接続
$ ssh orange.ep.sci.hokudai.ac.jp $ telnet sango.ep.sci.hokudai.ac.jp 8888
接続できたかを確認するために, /etc/passwd /etc/shadow ファイルのタイムスタンプを確認
$ date 2011年 9月 29日 木曜日 09:26:04 JST $ ls -l /etc/passwd /etc/shadow -rw-r--r-- 1 root root 1567 2011-09-29 09:25 /etc/passwd -rw-r----- 1 root root 998 2011-09-29 09:25 /etc/shadow
最終更新: 2013/01/28 (古田 裕規), 作成日: 2012/11/28 (古田 裕規) | epwww © 2012 |