LDP: Remote Serial Console Howto
Env:
OS -- Red Hat Linux 9, Fedora Core 2
boot loader -- GRUB
Modify steps:
1. GRUB parameter:
bash# vi /etc/grub.conf
Add below 2 lines to set the serial console as 9600/8/n/1, and 10 secs timeout.
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal --timeout=10 -dumb serial console
Add a single user mode option to GRUB menu
title Red Hat Linux (2.4.9-21) single user mode
lock
root (hd0,0)
kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 s
initrd /initrd-2.4.9-21.img
2. Kernel parameter in GRUB
Add the kernel parameter for serial console
title Red Hat Linux (2.4.9-21)
root (hd0,0)
kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8
initrd /initrd-2.4.9-21.img
3. Install mgetty
The mingetty which was installed can not use for serial console.
Please get mgetty and install it.
4. Add mgetty as ttyS in /etc/inittab
co:2345:respawn:/sbin/mgetty ttyS
5. Configure /etc/mgetty+sendfax/mgetty.config for ttyS0
port ttyS0
speed 9600
direct yes
data-only yes
toggle-dtr yes
need-dsr yes
port-owner root
port-group root
port-mode 600
login-prompt @ \P login:\040
login-time 60
term vt102
6. Remove mingetty entry from /etc/inittab
1:2345:respawn:/sbin/mingetty tty1
# Additional virtual terminals are not used
2:2345:off:/sbin/mingetty tty2
3:2345:off:/sbin/mingetty tty3
4:2345:off:/sbin/mingetty tty4
5:2345:off:/sbin/mingetty tty5
6:2345:off:/sbin/mingetty tty6
Then restart init
bash# telinit q
7. Edit /etc/securetty to allow root login from serial console
add 'ttyS0' in /etc/securetty
8. Change init level to textual ( run level 3)
bash# vi /etc/inittab
find
id:5:initdefault:
edit as
id:3:initdefault:
9. Remove saved console setting
bash# rm -f /etc/ioctl.save
10. Alter target of /dev/systty
bash# cd /etc/makedev.d
bash# fgrep systty *
linux-2.4.x:l systty tty0
bash# vi linux-2.4.x
find
l systty tty0
edit as
l systty ttyS0
save it, then re-create /dev/systty
bash# cd /dev
bash# rm systty
bash# ./MAKEDEV systty
11. PAM configure
bash# vi /etc/security/console.perms
Add sconsole =ttyS0
Then modify the remaining entries from console to sconsole
12. Configure Red Hat Linux
bash# vi /etc/sysconfig/init
set it as:
BOOTUP=serial
PROMPT=no
bash# vi /etc/sysconfig/kudzu
set it as:
SAFE=yes
Then you can reboot and test it.