Article Title: how to set up a serial port terminal in Red Hat Enterprise Linux ?. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
In some cases, you need to configure the serial port console for linux for debugging purposes, or if linux does not have a video card at all, you also need to configure the serial port terminal. A serial port console displays all the terminals sent to the serial port, and the serial port terminal can log on to the system through the serial port. You can set two or one of them at the same time.
In order to control the kernel output of all console messages to the serial port, you need to pass the console = ttyS0 parameter to the kernel at the time, which can be achieved through GRUB, in the following example, messages from the console are sent to tty0 (Display Console) and ttyS0 (Serial Port 1) at a speed of 115200, however, you must note that one type of device can only define one console. For example, you cannot send messages to both Serial 1 and Serial 2, and edit/boot/grub. conf to add the following content:
Console = ttyS0, 115200 console = tty0
For example:
# Cat/boot/grub. conf # grub. conf generated by anaconda # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a/boot partition. this means that # all kernel and initrd paths are relative to/boot/, eg. # root (hd0, 0) # kernel/vmlinuz-version ro root =/dev/hda2 # initrd/initrd-version.img # boot =/dev/hdadefault = 0 timeout = 10 splashimage = (hd0, 0) /grub/splash.xpm.gz title Red Hat Enterprise Linux AS (2.4.21-27.0.2.ELsmp) root (hd0, 0) kernel/vmlinuz-2.4.21-27.0.2.ELsmp ro root = LABEL =/console = ttyS0, 115200 console = tty0 initrd/initrd-2.4.21-27.0.2.ELsmp.img
To set a serial port terminal, a serial port derivative (spawn) agetty is required. Add the following content to the/etc/inittab: co: 2345: respawn: /sbin/agetty ttyS0 115200 vt100 init q example:
# Run gettys in standard runlevels1: 2345: respawn:/sbin/mingetty tty12: 2345: respawn:/sbin/mingetty tty23: 2345: Weight:/sbin/mingetty tty34: 2345: respawn:/sbin/mingetty tty45: 2345: respawn:/sbin/mingetty tty56: 2345: respawn:/sbin/mingetty tty6co: 2345: respawn: /sbin/agetty ttyS0 115200 vt100 init q
You can also add the serial port settings in the/etc/securetty file so that you can log on from the serial port as root and add a line at the end of the file. The content is
TtyS0
(If this row is not added, you cannot enter a password during logon .)