/etc/shadow, /etc/passwd, /etc/group, /etc/sudoers を手元の計算機にバックアップする.
コピーしたファイルの持ち主変更
chown root:root * chmod 400 *
プライベート LAN 停止
現 blue の eth1 (プライベート側) のネットワーク線を抜き, 新 blue の eth1 につなぐ.
/etc/hosts において
133.87.45.66 blue.ep.sci.hokudai.ac.jp blue
/etc/hostname において
blue
/etc/motd において
Linux blue 2.6.26-2-686
と編集.
新 blue のプライベート IP アドレスを 192.168.16.2 に, グローバル IP アドレスを 133.87.45.66 に設定
/etc/network/interfaces を
# The loopback network interface auto lo eth1 iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 133.87.45.66 netmask 255.255.255.0 network 133.87.45.0 broadcast 133.87.45.255 gateway 133.87.45.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 133.87.45.70 133.87.45.66 133.87.1.11 dns-search ep.sci.hokudai.ac.jp iface eth1 inet static address 192.168.16.2 netmask 255.255.255.0 network 192.168.16.0 broadcast 192.168.16.255
と編集.
blue.ep.sci.hokudai.ac.jp に変更
dc_other_hostnames='blue.ep.sci.hokudai.ac.jp' に変更
$DHCP_SERVER = 'blue.ep.sci.hokudai.ac.jp'
となっていることを確認.
$ sudo grep aoi /etc/*
# /etc/init.d/networking restart
ここで, restart し,ifconfig で確認すると eth0 が認識されなかった.
そこで /etc/network/interfaces を次のように変更した
auto lo eth0 eth1
allow-hotplug eth0 の行はコメントアウトした.
restart すると
Reconfiguring network interfaces...if-up.d/montnfs[eth0]:waiting for interface eth1 before doing NFS mounts (warning)
と表示されたが,ifconfig すると eth0 が認識されているのでよしとした. また,blue に ssh でログインできた.
# hostname --file /etc/hostname
# /etc/init.d/syslog-ng restart
www サーバで gate ユーザが作業を行う.
すでにある公開鍵を削除する.
~gate/.ssh/known_hosts 中の blue の行を削除
新たに公開鍵を取得する.
$ ssh blue.ep.sci.hokudai.ac.jp
公開鍵を作りますかと聞かれ yes を入力.
orange の /etc/gate.conf の %DB_SHARE_HOSTS に blue が書き込まれているか確認.
blue から www にログイン.
$ ssh orange.ep.sci.hokudai.ac.jp $ telnet localhost 8888
転送は数秒で終わったものとみられる.
blue にて
$ ps aux | grep gate
動いていない.
$ ls -lt /etc/passwd
再構築のときの日付だった. つまり,転送できていなかった.
原因は orange:~gate/.ssh/known_host の持ち主が root になっていたので公開鍵の登録ができなかった. もう一度やり直して上記までの確認をし,新しくユーザーディレクトリも作られていることを確認.
$ ls -lt /etc/passwd
直前の時間だった -> 転送は完了したと考えられる
host -l ep.sci.hokudai.ac.jp
動いている.
新たにプライベート IP を取得する実験成功.
新しくできた /etc/passwd, /etc/shadow の人名の行(gate より下)を, バックアップしておいたファイルで置き換える.
mondo 以外でログインしてみる.
-> ログインできた.
/ETC, /HOME を削除
# rm -r /ETC /HOME
mondo ユーザを削除
# deluser --remove-home mondo1 # deluser --remove-home mondo5
gate 登録更新
テプラの貼り換え