OS再インストールからDebian 6 i386をインストール。keymapはjapaneseを選択。
sshの設定、rootのログインを禁止、パスワードによるログインを禁止。
# echo 'PermitRootLogin no'>> /etc/ssh/sshd_config # echo 'PasswordAuthentication no'>> /etc/ssh/sshd_config
sshdの再起動。
# /etc/init.d/ssh restart
ログインしたいホストの公開鍵をログイン先にコピー
$ scp /*******/.ssh/id_rsa.pub ****@**********************:id_rsa.pub ****@**********************'s password: id_rsa.pub 100% 391 0.4KB/s 00:00
ログインする一般ユーザで、公開鍵秘密鍵ペアを作って、~/.ssh/authorized_keysにログインしたいホストの公開鍵を追加。今後はログインに公開鍵認証が必要になる。
$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/*******/.ssh/id_rsa): Created directory '/*******/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /*******/.ssh/id_rsa. Your public key has been saved in /*******/.ssh/id_rsa.pub. The key fingerprint is: *********************************************** **@********* The key's randomart image is: +--[ RSA 2048]----+ |*****************| |*****************| |*****************| |*****************| |*****************| |*****************| |*****************| |*****************| |*****************| +-----------------+ $ cat id_rsa.pub >> ~/.ssh/authorized_keys
リモートコンソールでgrub2を使うための設定を/etc/default/grubに書き込む。更新内容を元にupdate-grub2。今後は再起動時にgrub2メニューがリモートコンソールに5秒間表示される。
# echo GRUB_CMDLINE_LINUX=\"console=ttyS0,115200n8\" >> /etc/default/grub # echo GRUB_TERMINAL=serial >> /etc/default/grub # echo GRUB_SERIAL_COMMAND=\"serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\" >> /etc/default/grub # update-grub2 Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-5-686 Found initrd image: /boot/initrd.img-2.6.32-5-686 done
Clonezilla をダウンロード
$ wget 'http://sourceforge.net/projects/clonezilla/files/latest/download?source=files' -O clonezilla-live-20120326-oneiric.iso --2012-03-29 23:36:18-- http://sourceforge.net/projects/clonezilla/files/latest/download?source=files Resolving sourceforge.net... 216.34.181.60 Connecting to sourceforge.net|216.34.181.60|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://downloads.sourceforge.net/project/clonezilla/clonezilla_live_alternative/20120326-oneiric/clonezilla-live-20120326-oneiric.iso?r=&ts=1333031779&use_mirror=jaist [following] --2012-03-29 23:36:19-- http://downloads.sourceforge.net/project/clonezilla/clonezilla_live_alternative/20120326-oneiric/clonezilla-live-20120326-oneiric.iso?r=&ts=1333031779&use_mirror=jaist Resolving downloads.sourceforge.net... 216.34.181.59 Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://jaist.dl.sourceforge.net/project/clonezilla/clonezilla_live_alternative/20120326-oneiric/clonezilla-live-20120326-oneiric.iso [following] --2012-03-29 23:36:19-- http://jaist.dl.sourceforge.net/project/clonezilla/clonezilla_live_alternative/20120326-oneiric/clonezilla-live-20120326-oneiric.iso Resolving jaist.dl.sourceforge.net... 150.65.7.130, 2001:200:141:feed::feed Connecting to jaist.dl.sourceforge.net|150.65.7.130|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 118489088 (113M) [application/octet-stream] Saving to: “clonezilla-live-20120326-oneiric.iso” 100%[====================================================================================================================>] 118,489,088 13.2M/s in 9.8s 2012-03-29 23:36:29 (11.5 MB/s) - “clonezilla-live-20120326-oneiric.iso” saved [118489088/118489088]
Clonezilla を使うための設定を/etc/grub.d/40_customに書き込む
menuentry "Clonezilla live" { set isofile="/**/clonezilla-live-20120326-oneiric.iso" loopback loop (hd0,9)$isofile linux (loop)/live/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_keymap=\"\" ocs_live_batch=\"no\" ocs_lang=\"\" ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile initrd (loop)/live/initrd.img }
アップデート
# update-grub2 Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-5-686 Found initrd image: /boot/initrd.img-2.6.32-5-686 done
SystemRescueCD をダウンロード
$ wget 'http://sourceforge.net/projects/systemrescuecd/files/latest/download' -O systemrescuecd-x86-2.5.1.iso --2012-03-29 23:04:14-- http://sourceforge.net/projects/systemrescuecd/files/latest/download Resolving sourceforge.net... 216.34.181.60 Connecting to sourceforge.net|216.34.181.60|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.5.1/systemrescuecd-x86-2.5.1.iso?r=&ts=1333029856&use_mirror=jaist [following] --2012-03-29 23:04:15-- http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.5.1/systemrescuecd-x86-2.5.1.iso?r=&ts=1333029856&use_mirror=jaist Resolving downloads.sourceforge.net... 216.34.181.59 Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://jaist.dl.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.5.1/systemrescuecd-x86-2.5.1.iso [following] --2012-03-29 23:04:15-- http://jaist.dl.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.5.1/systemrescuecd-x86-2.5.1.iso Resolving jaist.dl.sourceforge.net... 150.65.7.130, 2001:200:141:feed::feed Connecting to jaist.dl.sourceforge.net|150.65.7.130|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 379248640 (362M) [application/octet-stream] Saving to: “systemrescuecd-x86-2.5.1.iso” 100%[====================================================================================================================>] 379,248,640 46.2M/s in 8.4s 2012-03-29 23:04:24 (43.3 MB/s) - “systemrescuecd-x86-2.5.1.iso” saved [379248640/379248640]
/etc/grub.d/40_custom に必要な情報を書き込む
menuentry "SystemRescueCd (isoloop)" { set isofile="**/systemrescuecd-x86-2.5.1.iso" loopback loop (hd0,9)/$isofile linux (loop)/isolinux/rescuecd isoloop=$isofile initrd (loop)/isolinux/initram.igz }
grub2のアップデート
# update-grub2 Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-5-686 Found initrd image: /boot/initrd.img-2.6.32-5-686 done