水曜日, 3月 11, 2009

DebianでConsole接続

blog.shimazu.org参照。

Debian GNU/Linux (Etch) でのシリアルコンソール接続

おそらくサーバ運用における基本のキなんだろうけど、シリアルコンソール接続をはじめて設定してみて、思いのほかてこずったので、メモしておく(DebianマシンにWindows PCからアクセスする想定)。

/etc/inittab の以下を修正。

■修正前
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
■修正後
T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100
#コメントアウトを削除の上、通信速度を変更。

反映のため、以下コマンドを実行。

# init q

/etc/securetty の以下を修正。

■修正前
#ttyS0
■修正後
ttyS0
#コメントアウトを削除

/boot/grub/menu.lst の以下を修正。

■追加
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console

■kernel部分に「console=ttyS0,115200n8」を追加
title Debian GNU/Linux, kernel 2.6.18-5-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/hda1 ro console=tty0 console=ttyS0,115200n8
initrd /boot/initrd.img-2.6.18-5-686
savedefault
title Debian GNU/Linux, kernel 2.6.18-5-686 (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/hda1 ro single console=tty0 console=ttyS0,115200n8
initrd /boot/initrd.img-2.6.18-5-686
savedefault

火曜日, 3月 03, 2009

特定のポートをオープンしているプロセスを調べるには

@ITより
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/664useportps.html

apt-get install lspf

# lsof -i:22
など。