I’ve had times where I need to get a quick serial console going to a device like an APC PDU.  I typically use minicom in the past but sometimes it’s just not available on the machine.   I was on a Raspberry Pi using a USB Serial adapter, and I needed to connect to the Watchguard Firebox X750e Core when installing pfSense, an upcoming post, for $50-100 you can have an awesome firewall.

Screen is a tool that is capable of acting as a serial terminal, worked perfect for me.  You won’t have all the fancy settings of minicom, but it works.  Try these steps as root.

yum -y install screen

Make sure you’re serial cable is connect to the device and use the following command.

screen /dev/ttyS0 9600

You’ll connect to ttyS0 at 9600 baud.  If you’re on a linux server sometimes I don’t always know the ttyXX to use.  So I use the command

dmesg

Which dumps out the kernel boot messages and

[root@localhost ~]# dmesg | grep tty
console [tty0] enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

You’ll see there are two serial ports ttyS0 and ttyS1.  In most cases it’s ttyS0, but you can try both if you’re not sure.

Whats awesome this also works on OSX.  I’m use an MacBook Air whenever I’m in the data center with a USB to Serial adapter, in that case my command would be.

screen /dev/tty.usbserial-A603PQIY 115200

Not all devices are named the same, on OSX, I would check in the /dev/ directory for anything named *usb* or *usbserial* after I connect my USB Serial adapter.

Then to exit your session type Control-A then Control-\ to terminate screen and go back to a prompt.

 

Hope this helps everyone.