Enable Serial Console

Mon, Jun 1, 2009

Linux

This tutorial will show you how to set up a serial console on a Linux system, and connect to it via a null modem cable. This is quite useful as it allows you to easily get a console on the system if there are any problems with it and you cannot access it via ssh

Check that you have a serial port and it is enabled in your bios

dmesg | grep tty

root@duffys-place:~# dmesg | grep tty
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

Configuring Lilo

  1. open up /etc/lilo.conf
    nano /etc/lilo.conf
  2. Find the the serial line and change it to the following:
    serial=0,38400n8
  3. Now edit your kernel settings so they include the line
    append="console=ttyS0,38400n8"

    It should look something like this

    default=Linux
    image=/vmlinuz
            label=Linux
            append = "console=ttyS0,38400n8"
            initrd=/initrd.img
  4. Run /sbin/lilo to apply the changes

Enable Logins

  1. Open up /etc/inittab
    nano /etc/inittab

    and add the following line

    T0:2345:respawn:/sbin/getty -L ttyS0 38400 vt100

Testing It

  1. Plug one end of your null modem cable into your server and the other into your computer
  2. Open your terminal client i used putty hyperterminal works fine too
  3. Use the following settings:
    Port: COM1 or COM2(what ever your serial port is)
    Bits per second: 38400
    Data bits: 8
    Parity: None
    Stop bits: 1
    Flow control: None
  4. You should be able to see your console. If you have any issues feel free to leave a comment
, , , , , , , , ,

This post was written by:

Duffy - who has written 48 posts on Tuts4Tech.

I am the owner of this website, please feel free to ask me any questions you have

Contact the author

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply