Linux Serial Console

Linux Serial Console Rating: 9,6/10 6908 votes

Using a serial console on Linux is much like using a modem; the technology is virtually identical, but instead of using a modem to dial into a remote system, a special serial cable, called a null-modem cable, is strung between two computers via their serial ports. Most modern desktops and laptops no longer come with serial ports; however, virtually all server-class systems do.

The one system is set up to listen on one end of the cable, and the other system is used to log in, as the client, on the other end. This can be reverted very easily; a null-modem cable works both ways. Why use a serial console? For one, it can be very useful for debugging, particularly if the network is down and the system is headless. For another, you can use it to bypass security rules and bridge one network to another -- not for things like copying files, but purely for login purposes to obtain shell access to the other system. For instance, if you had a server in a DMZ, you could bypass potentially complex networking needs to obtain shell access to the server from a system on the LAN. This also could mean that running a remotely-accessible sshd service is no longer required on the DMZ server.

Console

I'm developing on an embedded linux SBC (Mini2451) How do I enable the serial console? I've set it in the boot options: Linux-CommandLine = root=/dev/mtdblock2 rootfstype=yaffs2 init=/linuxrc console=ttySAC0,115200 vt.globalcursordefault=0 And also added it to the kernel configuration in boot options. But still no output. Could you assist please. If you want to use the 38,400 bps serial port on ttyS1, then your settings should be adjusted to 38400, N, 8, 1. Cable: To connect a laptop to the serial port on the Linux host, you need to have a null-modem cable. The purpose of a null-modem cable is to permit two RS-232 DTE devices to communicate with each other without modems between them.

I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303. I'm a beginner at minicom. Is this the correct command to execute? Combat arms game. Or do I need to configure something?

To begin, all you really need is the null-modem cable and two systems with serial ports, making sure the serial ports are enabled in the BIOS. On the server, edit /etc/inittab and add:

The Serial Console in the Azure portal provides access to a text-based console for Linux virtual machines (VMs) and virtual machine scale set instances. This serial connection connects to the ttys0 serial port of the VM or virtual machine scale set instance, providing access to it independent of the network or operating system state. Setting up a serial console. This is quite useful if your Linux server is in a headless configuration (no keyboard or monitor), as it allows you to easily get a console on the system if there are any problems with it (especially network problems, when SSH is not available). In the end, the GRUB menu will appear over the serial link. How to connect to a serial port as simple as using SSH? Ask Question Asked 7 years. From the port to the console. The putty package (which does run on Linux) does include serial support. Share improve this answer. Answered Oct 14 '11 at 18:34. Then setup the server to output the console to a serial port and use screen/minicom (Hyperterminal or putty in Windows) to console into the server over a serial cable. To set this up, you need to edit /etc/inittab to tell it to start a terminal on the serial port for the console.

Serial

This tells init to launch agetty, listening on /dev/ttyS0 (the first serial port) at a baud-rate of 115200bps, and to use vt102 terminal emulation. On the client, once the null-modem cable is in place and agetty is running, use screen to connect:

Hit enter once screen starts and you will be sitting at a familiar login prompt on the remote system. To disconnect, simply type [CTRL-A]+K in screen, after logging out.

If you were so inclined, you could also force syslog to send all logs to the serial port as well, for observation over the serial line. This can be done by modifying /etc/syslog.conf to add:

Linux Serial Console Color

If nothing else, should you need to connect to some hardware via the console, like a network router or switch, being able to use screen to manage the serial connection is a great and easy way to do so. Virtually all Linux distributions either come with screen preinstalled, or it's a simple apt-get, urpmi, or yum away. Most Linux distributions come with agetty already installed.

Linux Serial Console Howto

Delivered each Tuesday, TechRepublic's free Linux and Open Source newsletter provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!