# Remote Serial Console HOWTO

### Glen Turner

Australian Academic and Research Network

`<glen.turner+howto@aarnet.edu.au>`

### Mark F. Komarinski

`<mkomarinskiATwayga.org>`

v2.6 2003-03-31

Revision History
Revision 2.6 | 2003-03-31 | Revised by: gdt
Correct opposing CTS/RTS explanations. Use <quote> in markup. TLDP PDF is now good, so remove instructions for rendering PostScript to PDF. Typo in GRUB configuration.
Revision 2.5 | 2003-01-20 | Revised by: gdt
Only one console per technology type. Setting timezone. Use off parameter rather than comments in inittab. Cable lengths.
Revision 2.4 | 2002-10-03 | Revised by: gdt
Kernel flow control bug, more cabling, Debian, Livingston Portmaster, typos (especially those found during translation to Japanese).
Revision 2.3 | 2002-07-11 | Revised by: gdt
Updates for Red Hat Linux 7.3, corrections to serial port speeds and UARTs, ioctlsave.
Revision 2.2 | 2002-05-22 | Revised by: gdt
Minor changes
Revision 2.1 | 2002-05-16 | Revised by: gdt
Corrections to kernel console syntax. Addition of USB and devfs.
Revision 2.0 | 2002-02-02 | Revised by: gdt
Second edition.
Revision ≤1.0 | 2001-03-20 | Revised by: mfk
First edition.

An RS-232 serial console allows Linux to be controlled from a terminal or modem attached to an asynchronous serial port. The monitor, mouse and keyboard are no longer required for system administration. Serial consoles are useful where Linux systems are deployed at remote sites or are deployed in high-density racks.

This HOWTO describes how to configure Linux to attach a serial console.

# Dedication

Glen Turner would like to thank his family for allowing him to work on this project for the surprisingly large number of evenings which it took to write this HOWTO. Thank you Karen, Kayla and Ella.

List of Tables
1-1. Different ways of referring to the "console"
2-1. Many names for the same serial port
2-2. Interrupts used for IBM PC/AT RS-232 ports
4-1. SYSLINUX flow control bitmap
10-1. IBM-PC/AT serial port bit rates and their bit-clock divisors
11-1. Data rates and the maximum distances recommended in RS-232

List of Figures
2-1. Using the setserial command in `/etc/rc.serial`to disable the serial port `/dev/ttyS2`
2-2. Syntax for serial bits per second rate, in extended Backus-Naur form
2-3. Syntax for serial parity, in extended Backus-Naur form
2-4. Syntax for serial data bits, in extended Backus-Naur form
2-5. Syntax for serial stop bits, in extended Backus-Naur form
2-6. Syntax for serial flow control, in extended Backus-Naur form
2-7. Syntax for kernel serial parameters, in extended Backus-Naur form
4-1. Syntax of LILO serial command, in EBNF
4-2. LILO serial EBNF variables
4-3. LILO boot loader sample configuration
4-4. Using md5crypt to create a hashed password for GRUB
4-5. GRUB configuration to require a password
4-6. GRUB configuration for serial console
4-7. GRUB configuration for serial console and attached monitor and keybaord console
4-8. GRUB output to default device when configured for serial and attached monior output
4-9. GRUB configuration for command line interface for terminals other than VT100
4-10. Adding a single user mode option to the GRUB menu
4-11. Syntax of SYSLINUX serial command, in EBNF
4-12. SYSLINUX serial EBNF variables
5-1. Kernel `console` syntax, in EBNF
5-2. Recommended kernel parameters, PCs with video card
5-3. Recommended kernel parameters, PCs without video card
5-4. Recommended kernel parameters, LILO configuration
5-5. Recommened kernel parameters, GRUB configuration
5-6. Recommended kernel parameters, SYSLINUX configuration
6-1. Interactively altering the connecting terminal's make and model
6-2. Interactively altering the connecting terminal's time zone
6-3. getty is started by init, based upon an entry in `/etc/inittab`
6-4. Define `CON9600` in `gettydefs`
6-5. Syntax of entries in `/etc/gettydefs`, in EBNF
6-6. `/etc/inittab` entry for agetty
6-7. `/etc/inittab` entry for mgetty
6-8. mgetty configuration file `mgetty.config`
6-9. Fewer virtual terminals. Removing mingetty entries from `/etc/inittab`
6-10. Fewer virtual terminals. Deallocating unused virtual terminals and removing their device files.
6-11. Contents of `/etc/rc.serial` to lock console serial port when no getty used
7-1. Alter `securetty` to allow root to log in from the serial console
7-2. `Xservers` from Red Hat Linux 7.2
7-3. `[servers]` section of `gdm.conf` from Red Hat Linux 7.2
7-4. Removal of `ioctl.save` containing the saved console parameters
7-5. Remove `/dev/modem` if it points to the serial console's port
7-6. Default value of `/dev/systty` in `/etc/makedev.d/linux-2.4.x`
7-7. Alter value of `/dev/systty` in MAKEDEV configuration file
7-8. Installing new value of `/dev/systty`
7-9. Default `<console>` in `console.perms` refers to attached keyboard and screen
7-10. Default device listing in `console.perms`
7-11. Devices in `console.perms` required for attached keyboard and screen
7-12. Add `<sconsole>` in `console.perms` to refer to serial console
7-13. Remaining devices in `console.perms` altered to refer to serial console
7-14. Alterations to `/etc/sysconfig/init` for Red Hat Linux
7-15. Alterations to `/etc/sysconfig/kudzu` for Red Hat Linux
8-1. Using ioctlsave to create `/etc/ioctl.save` without entering single user mode
9-1. Extract from Crackers favour war dialling and weak passwords
9-2. `/etc/syslog.conf` modified to copy log messages to a log server
9-3. Allowing remote log messages by setting options in `/etc/sysconfig/syslog`
9-4. Restrict syslog messages to remote.example.edu.au
9-5. Using nscd to cache reverse DNS lookups
9-6. Restrict sending of messages to console user
9-7. Restrict sending of messages to console user, `/etc/profile.d/mesg.sh`
9-8. Restrict sending of messages to console user, `/etc/profile.d/mesg.csh`
9-9. Install files into `/etc/profile.d`
9-10. Using sysctl to defeat the magic SysRq key
9-11. Configuring `/etc/sysctl.conf` to defeat the magic SysRq key
9-12. Kernel make menuconfig showing disabled SysRq key
9-13. Kernel `.config` showing disabled SysRq key
9-14. Default handling of Ctrl-Alt-Delete in `/etc/inittab`
9-15. Ignoring Ctrl-Alt-Delete in `/etc/inittab`
9-16. Shut down cleanly upon Ctrl-Alt-Delete in `/etc/inittab`
10-1. Kernel configuration for serial console using make menuconfig
10-2. Kernel configuration for serial console using `.config`
10-3. Kernel configuration for USB dongle serial console using make menuconfig
10-4. Kernel configuration for USB dongle serial console using `.config`
10-5. Kernel configuration for serial console using make menuconfig
10-6. Kernel configuration for serial console using `.config`
11-1. Null modem cable with full status and handshaking
11-2. Variation on null modem cable with full status and handshaking
11-3. Null modem cable with falsified status and handshaking
11-4. Null modem cable with no status or handshaking
11-5. One-way null modem cable with no status or handshaking
12-1. Front panel of a dumb modem
12-2. Testing the modem's port speed
12-3. Configure modem using AT commands
12-4. Resetting a Hayes AT-style modem
A-1. A kernel `console` parameter with CTS/RTS flow control
A-2. Kernel source code for console CTS/RTS flow control
A-3. setserial causes a modem to hang up as the machine initializes
B-1. Supressing kernel messages to the console in Red Hat Linux
C-1. Configuring BIOS to use serial link
C-2. Configuring BIOS to boot from hard disk
C-3. Extract from Red Hat Linux 7.2 `mkbootdisk` which creates `SYSLINUX.CFG`
C-4. Altered extract from `mkbootdisk`, which creates a `SYSLINUX.CFG` that uses a serial console
E-1. Basic configuration for Cisco 2511 terminal server to Linux PC
E-2. Portmaster unit configuration
E-3. Portmaster port configuration
F-1. Configuring /dev/nvram to access the CMOS configuration
F-2. Getting the CMOS configuration
F-3. Setting the CMOS configuration

List of Examples
4-1. Using kernel parameters to avoid access permissions
5-1. Complete LILO configuration, as installed by vendor
5-2. Complete LILO configuration, modified for serial console
5-3. Complete GRUB configuration, as installed by vendor
5-4. Complete GRUB configuration, modified for serial console
8-1. Dialing into a serial console
C-1. Displaying the Internet Protocol configuration
C-2. Displaying the LILO configuration

|  | Next
|  | Introduction