Whole document tree

Whole document tree

Remote Serial Console HOWTO

Remote Serial Console HOWTO

Glen Turner

Australian Academic and Research Network


Mark F. Komarinski


v2.0 2002/02/02

Revision History
Revision 2.02002-02-02Revised by: gdt
Second edition.
Revision ≤1.02001-03-20Revised 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 in remote sites or are deployed in high-density racks.

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

Table of Contents
1. Preliminaries
1.1. Copyright
1.2. Disclaimer
1.3. Acknowledgments
1.4. Comments and corrections
2. Introduction
2.1. What is a console?
2.2. Why use a serial console?
2.3. Alternative meanings of ‘console’
2.4. Configuration overview
3. Preparation
3.1. Create fallback position
3.2. Select a serial port
3.3. Select a serial speed and parameters
3.4. Configure the modem or the null-modem cable
3.5. Configure the terminal or the terminal emulator
4. Configure the boot loader
4.1. Configure the LILO boot loader
4.2. Configure the GRUB boot loader
4.3. Configure the SYSLINUX boot loader
5. Configure Linux kernel
5.1. Configure Linux kernel using LILO
5.2. Configure Linux kernel using GRUB
5.3. Configure Linux kernel using SYSLINUX
6. Configure getty
6.1. init system
6.2. Traditional getty
6.3. agetty
6.4. mgetty
6.5. mingetty
6.6. No getty
7. Configure incidentals
7.1. Allow root to login from serial console
7.2. Change init level to textual
7.3. Remove saved console settings
7.4. Serial console is not /dev/modem
7.5. Alter target of /dev/systty
7.6. Configure Pluggable Authentication Modules
7.7. Configure Red Hat Linux
8. Reboot and test
8.1. Verify console operation
8.2. Re-create saved console settings
8.3. Test the console
8.4. Where to next from here?
9. Security
9.1. Use good passwords
9.2. Obey Data Terminal Ready and Data Carrier Detect
9.3. Use or configure a dumb modem
9.4. Restrict console messages
9.5. Modem features to restrict usage
9.6. BIOS features
9.7. Use a boot loader password
9.8. Non-interactive boot sequence
9.9. Magic SysRq key
9.10. Adjust behaviour of Ctrl-Alt-Delete
9.11. Log attempted access
10. Configuring a kernel to support serial console
10.1. Linux kernel version 2.4
10.2. Linux kernel version 2.2
11. Serial cabling
11.1. Jargon
11.2. Cable from console port to modem
11.3. Cable from console port to terminal (or another PC)
11.4. Making serial cables
12. Modem configuration
12.1. Using Minicom to give commands to a modem
12.2. Configure dumb modem
12.3. Configure modem with AT commands
12.4. Internal modems
12.5. WinModems
A. Bugs and annoyances
A.1. Red Hat Linux 7.1 and SysVinit
A.2. BIOSs, keyboards and video cards
A.3. Modem hangs up upon reboot
A.4. init and syslog output does not display on secondary consoles
A.5. The console is unresponsive after connecting
A.6. Modem hangs up during initialization
A.7. Boot loader has no flow control
A.8. Boot loaders are vulnerable to line noise
A.9. Advanced Power Management
A.10. Modems and overseas telecommunications requirements
B. Uploading files from a serial console
B.1. ASCII upload and cat
B.2. Disable logging to console
B.3. Xmodem, Ymodem and Zmodem
B.4. Kermit
C. Upgrading Red Hat Linux from a serial console
C.1. Select boot disk
C.2. Configure the BIOS to use the serial port
C.3. Configure modem to ignore DTR and assert DCD
C.4. Prepare a network install floppy diskette
C.5. Prepare HTTP server
C.6. Record network configuration
C.7. Record LILO configuration
C.8. Upgrade Red Hat distribution
C.9. Create boot disk for serial console
C.10. Further references
D. Terminal server configuration
D.1. Cisco 2511
E. Gratuitous advice for developers
E.1. Advice for boot loader authors
E.2. Advice for BIOS authors
List of Figures
3-1. Serial parameter syntax, 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 configuration for command line interface for terminals other than VT100
4-9. Adding a single user mode option to the GRUB menu
4-10. Syntax of SYSLINUX serial command, in EBNF
4-11. 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. getty is started by init, based upon an entry in /etc/inittab
6-3. Define CON9600 in gettydefs
6-4. Syntax of entries in /etc/gettydefs, in EBNF
6-5. /etc/inittab entry for agetty
6-6. /etc/inittab entry for mgetty
6-7. mgetty configuration file mgetty.config
6-8. Fewer virtual terminals. Removing mingetty entries from /etc/inittab
6-9. Fewer virtual terminals. Deallocating unused virtual terminals and removing their device files.
6-10. 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. Removal of ioctl.save containing the saved console parameters
7-3. Remove /dev/modem if it points to the serial console's port
7-4. Default value of /dev/systty in /etc/makedev.d/linux-2.4.x
7-5. Alter value of /dev/systty in MAKEDEV configuration file
7-6. Installing new value of /dev/systty
7-7. Default <console> in console.perms refers to attached keyboard and screen
7-8. Default device listing in console.perms
7-9. Devices in console.perms required for attached keyboard and screen
7-10. Add <sconsole> in console.perms to refer to serial console
7-11. Remaining devices in console.perms altered to refer to serial console
7-12. Alterations to /etc/sysconfig/init for Red Hat Linux
7-13. Alterations to /etc/sysconfig/kudzu for Red Hat Linux
9-1. Restrict sending of messages to console user
9-2. Restrict sending of messages to console user, /etc/profile.d/mesg.sh
9-3. Restrict sending of messages to console user, /etc/profile.d/mesg.csh
9-4. Install files into /etc/profile.d
9-5. Using sysctl to defeat the magic SysRq key
9-6. Configuring /etc/sysctl.conf to defeat the magic SysRq key
9-7. Kernel make menuconfig showing disabled SysRq key
9-8. Kernel .config showing disabled SysRq key
9-9. Default handling of Ctrl-Alt-Delete in /etc/inittab
9-10. Ignoring Ctrl-Alt-Delete in /etc/inittab
9-11. 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
11-1. Null modem cable with full status and handshaking
11-2. Null modem cable with falsified status and handshaking
11-3. 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. 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
D-1. Basic configuration for Cisco 2511 terminal server to Linux PC
E-1. Configuring /dev/nvram to access the CMOS configuration
E-2. Getting the CMOS configuration
E-3. Setting the CMOS configuration