It can be beneficial to view console messages over a serial port or even log in and make configuration changes over the console terminal window. This can be a confusing process, especially with any slight differences in operating systems and/or versions. However, this guide should provide the basics needed for most situations.

The first step is to determine that your operating system recognizes your serial ports and to determine their labels:

linux-2tq9:/ # dmesg | grep tty

00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

You should see something similar to the above output.  The important information is that your first serial port should be set to ttyS0 and incrementally go up from that point.

Next you need to edit /etc/inittab to allow logins from the serial console.  First create a backup copy of the file:

linux-2tq9:/ # cp /etc/inittab  /etc/inittab_bak

Then edit the file:

linux-2tq9:/ vi /etc/inittab

Add the following line to the end of the file (assumes you are using agetty):
S0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt102

NOTE: 9600 is the default baud rate of most serial ports.  You should confirm this baud rate before making the setting.

Finally to make the serial console your system console, you need to edit GRUB to output the console to the serial port:

linux-2tq9:/ # vi /boot/grub/menu.lst (or grub.conf – same file)

Edit the file as shown in orange:

###Don’t change this comment – YaST2 identifier: Original name: linux###
title SUSE Linux Enterprise Server 11 – 2.6.27.19-5
root (hd0,1)
kernel /boot/vmlinuz-2.6.27.19-5-pae root=LABEL=/ console=ttyS0, 9600
initrd /boot/initrd-2.6.27.19-5-pae

These steps will allow you to redirect the Linux console over the serial port as well as login and make configuration changes.

OPTIONAL:
If you would like to allow root to log in over the serial console, you need to edit the /etc/securetty file:

Add the entries marked in orange:

#
# This file contains the device names of tty lines (one per line,
# without leading /dev/) on which root is allowed to login.
#
ttyS0
ttyS1

tty1
tty2
tty3
tty4
tty5
tty6

Related Articles:


ABOUT US
Seeds of Genius, Inc. offers a full range of IT solutions including hardware and software products in addition to consulting, installation and support services. For more information, please visit our main web site at http://www.seedsofgenius.com or contact our Technical Sales department at (410) 312-9806.