To install and configure a serial console on CentOS or RHEL v6.x, you need to make changes to the system’s GRUB configuration, as well as the /etc/securetty and /etc/inittab files. Here are the steps you need to follow:
- Edit the GRUB configuration file:
sudo nano /etc/grub.conf
- Add the following lines to the end of the
kernelline:console=ttyS0,115200n8
- Configure the serial port in
/etc/securetty:sudo nano /etc/securetty
- Add the following line to the end of the file:
ttyS0
- Edit the
/etc/inittabfile:sudo nano /etc/inittab
- Add the following line to the end of the file:
S0:2345:respawn:/sbin/agetty ttyS0 115200 vt100-nav
- Save the changes and restart the system:
sudo reboot
After the system reboots, you should be able to access the console through the serial port using a terminal program such as minicom or screen. To connect using minicom, use the following command:
sudo minicom -b 115200 -o -D /dev/ttyS0
Note: The above steps assume that the serial port is connected to /dev/ttyS0. If your system uses a different device file for the serial port, you’ll need to adjust the steps accordingly.