Configuring serial Console__linux for Linux systems

Source: Internet
Author: User

Serial output

1) Edit the/boot/grub/grub.conf file at the end of kernel to add the following:

Console=ttys0,115200n8

2) Modify Securetty

echo "TtyS0" >>/etc/securetty

3) Edit/etc/init/ttys0.conf, after specifying CONSOLE=TTYS0 in the Grub boot parameter, this profile will conflict with/etc/init/serial.conf, so comment out the contents of the file

# # Ttys0-agetty

# #

# This service maintains a agetty onttyS0.

#

# stop on RunLevel [S016]

# Start on RunLevel [23]

#

# respawn

# exec agetty-h-l-w/dev/ttys0 115200vt102





Original:

"Remote serial Console HOWTO":

Http://www.linux.com/learn/docs/ldp/714-Remote-Serial-Console-HOWTO

Translate by Bob

Email:gexbob@gmail.com

Friday, July 15, 2011

According to my environment (Redhat 9,grub 0.93), I translated the part I needed. The original text also has configuration instructions for Lilo and Syslinux.

PDF version of this document download: http://download.csdn.net/source/3462563

1. Preparatory work

1.1. About Serial console

Console is a output system management information of the text output device, which comes from the kernel, system startup and system users, serial console is the serial port as output terminal equipment, is this information can be used in the remote terminal display.

Configuring a serial console roughly includes five items:

Ø Configure BIOS to use serial console (optional);

Ø Configure Bootloader to use serial console (optional);

Ø configuration kernel uses serial console

Ø to run a program that supports serial console login at system startup

Ø some other system configurations that enable these features to support serial console, or prevent them from disrupting the serial console

1.2. Serial Line

Using the RS232 method of the DB9 serial line, the signal connection is as follows:

Signal Ground------------------Signal Ground

Receive Data------------------Transmit data

Transmit Data------------------Receive data

Ready to send------------------clear to send

Clear to send------------------Ready to send

ATA Terminal Ready-------------+---Data carrier detect

|

+---Data set ready

Data Carrier Detect----+----------------Data Terminal ready

|

Data Set Ready-----+

1.3. The setting of serial port parameter

The selected serial port is COM1, the device name is ttyS0, baud rate is 9600, 8 bit data bit, no parity, 1 bit stop bit.

2. Configure BIOS

Some BIOS support serial console, which can display BIOS boot information in the serial console, which needs to be configured in the BIOS.

3. Configure Bootloader

Both LILO, grub, and syslinux support the serial console.

configuration of 3.1. GRUB

The grub configuration file is grub.conf in the/boot/grub directory and added at the beginning of the configuration file:

Serial--unit=0--speed=9600--word=8--parity=no--stop=1

Terminal--timeout=10 Serial Console

The serial command sets the parameters for the serial port:

--unit: Serial equipment, 0 means ttyS0, if it is ttyS1 to set to 1;

--speed: Baud rate;

--work: Data bits;

--parity: parity check bit;

--stop: Stop bit.

The terminal command is used to set the type of terminal

--timeout: Wait time, Unit is seconds

4. Configure Kernel

The kernel console type can be selected through the console parameter, and the syntax for the console configuration is as follows:

Console=ttys<serial_port>[,<mode>]
Console=tty<virtual_terminal>
Console=lp<parallel_port>
Console=ttyusb[<usb_port>[,<mode>]

One of the TTYs is the serial device, mode means the parameters of the serial port, TTY represents the virtual terminal.

Each console type guide sets up a device, for example, it can be set to Console=tty0 console=lp0 Console=ttys0, but setting to Console=ttys0 console=ttys1 is wrong.

If the console parameter is not set, the kernel defaults to using a virtual terminal, that is, tty0, which can be switched to tty0 using a combination of keys ctrl+alt+f1. If your computer has a display device, it's best to set it to console, or console=tty0.

Depending on my device, it can be set to:

Console=tty0 CONSOLE=TTYS0,9600N8

The console parameter needs to be passed to the kernel when the kernel starts, and for grub, you need to modify the grub.conf file to add the parameters to the kernel command, for example; bootloader

[plain] view plain copy title Red Hat Linux (2.4.9-21) root (hd0,0) kernel/vmlinuz-2.4.9-21 ro root=/de V/hda6 console=tty0 CONSOLE=TTYS0,9600N8 initrd/initrd-2.4.9-21.img

5. Configure Getty

Getty monitors and waits for a connection, then configures the serial port connection, sends the/etc/issue content, and asks for a login name and password, and then starts logging in, and Getty returns to the waiting state if the login fails.

Another task for Getty is to set the value of the term variable to specify the type of terminal being connected.

The commonly used Getty have four versions:

Getty: Traditional Getty, requiring configuration files/etc/gettydefs

Agetty: Without configuration files, passing parameters directly through the command line

Mgetty: Support Modem's Getty, need configuration file

Minigetty: Compact version of the Getty, does not support serial console

RedHat9 with Agetty and Mgetty

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.