Benjy's Body of Knowledge
Clues : Linux Serial Console

How to set up a Linux serial console

by Benjy Feen

Here's a cookbook recipe to make a RedHat Linux system genuinely reachable via a serial port. Your mileage may vary; let me know if you have any tips or advice.

1. Make LILO serial-aware.

Add this line somewhere near the top of /etc/lilo.conf:

serial=0,9600n8

This configures ttyS0 (What MS-DOS would call COM1) to be 9600 baud, N-8-1.

2. Make your kernel consider ttyS0 the system console device. Serial support needs to be enabled in your kernel; this seems to be the case in the kernel supplied with RedHat.

Add this to the boot stanza for your kernel in /etc/lilo.conf:

append = "console=ttyS0,9600"
3. Make your system provide a login prompt on the serial port. To do this you need to add a getty for the serial port to /etc/inittab.

Add this above the line which begins with "S1:" in your inittab file:

S0:12345:respawn:/sbin/uugetty ttyS0 DT9600 vt100
4. Fix the kudzu startup file so it doesn't probe serial, because that hoses things. Alternatively, just take kudzu out of your startup sequence.

Add the option -s to the appropriate line in /etc/rc.d/init.d/kudzu: For example:

/usr/sbin/kudzu -t 30 -s
5. Identify the serial port as a "secure tty" -- a tty that root is allowed to log in on.

Add ttyS0 to the top of the file /etc/securettys.

Good luck!