インストール
# apt-get install * (上記のパッケージでインストールされていないもの.htoff 以外.)
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 のメンバーを参照のこと
# emacs /etc/group gate:x:500:morikawa,mym,odakker,takahisa,michi
.shosts 認証を可能にする. /etc/ssh/sshd_config を以下のように編集する
(変更前) IgnoreRhosts yes HostbasedAuthentication no (変更後) IgnoreRhosts no HostbasedAuthentication yes
ファイル編集後, ssh を再起動
# service ssh restart
gate ユーザになる
$ sudo -u gate -s -H
.shosts を作成
$ cd /home/gate $ emacs .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 -rwxr-xr-x 1 root 434024 12月 2 2016 /usr/bin/ssh -rwxr-xr-x 1 root 195416 12月 2 2016 /usr/bin/ssh-keygen
$ chmod 4755 /usr/bin/ssh /usr/bin/ssh-keygen $ ls -lg /usr/bin/ssh /usr/bin/ssh-keygen -rwsr-xr-x 1 root 434024 12月 2 2016 /usr/bin/ssh -rwsr-xr-x 1 root 195416 12月 2 2016 /usr/bin/ssh-keygen
/etc/ssh/ssh_config に以下の 2 行を追加
HostbasedAuthentication yes PreferredAuthentications hostbased,publickey,password,keyboard-interactive
orange の公開鍵が既に存在しているか調べる
$ grep orange /home/gate/.ssh/known_hosts
ssh ログインする
$ ssh orange.ep.sci.hokudai.ac.jp
orange で先ほどと同じようにして .ssh/known_hosts を確認
$ ssh kawahara@www.ep.sci.hokudai.ac.jp kawahara@orange:~$ sudo -u gate -s -H gate@orange:/home/kawahara$ cd /home/gate gate@orange:~$ grep sango .ssh/known_hosts gate@orange:~$
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
$ emacs ./include/gate.conf ! 以下の部分を確認 : $DEBUG_CONFIG = 1; : if ($DEBUG_CONFIG) { $ETCDIR = '/ETC'; $VAR_NAMED_DIR = '/ETC'; } else { $ETCDIR = '/etc'; $VAR_NAMED_DIR = '/var/cache/bind';! ゾーンファイル置き場のディレクトリに一致させる } :
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
wheezy においてもsqueeze 同様 inetd は標準装備ではないためインストールする.
# apt-get install openbsd-inetd
なお, 先にqmail のインストールを行っている場合には, そちらの手順中で既にインストールしてある.
デーモンモードで起動するため, /etc/gate.conf で
$USE_DEAMON = 1;
と表示されているのを確認する.
# emacs /etc/inetd.conf gate stream tcp nowait root /usr/sbin/tcpd /usr/local/lib/gate/gate-daily -N
/etc/services に以下を追記
# emacs /etc/services gate 8888/tcp
# service openbsd-inetd start
gate のポートには, 登録サーバである orange 以外のホストはアクセスできない用にする.
# emacs /etc/hosts.deny gate-daily: ALL # emacs /etc/hosts.allow gate-daily: 127.0.0.1
アクセスの確認
# tcpdmatch gate-daily 133.50.160.50 client: address 133.50.160.50 server: process gate-daily access: denied ^^^^^^ # tcpdmatch gate-daily 127.0.0.1 client: address 127.0.0.1 server: process gate-daily access: granted ^^^^^^^
/etc/passwd, /etc/shadow, /etc/group, /etc/sudoers ファイルのバックアップを mondo5 のホームディレクトリ以下に作成しておく
# cp /etc/passwd /home/mondo5/ # cp /etc/shadow /home/mondo5/ # cp /etc/group /home/mondo5/ # cp /etc/sudoers /home/mondo5/ # cd /home/mondo5 # chmod 400 passwd shadow group sudoers
localhost の gate ポートに接続
$ telnet localhost 8888 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.
最終更新日: 2017/03/26 (須藤 康平) | Copyright © 2015 epcore |