minicom: A terminal emulation program for interacting with serial devices

minicom: A terminal emulation program for interacting with serial devices

Every time I’ve had to talk to a router’s console port, debug a misbehaving IoT device over UART, or flash firmware on an embedded board, minicom has been the tool sitting quietly in the background making it possible. It doesn’t get the attention flashier security tools do, but if you work anywhere near hardware, embedded systems, network appliances, or old-school modems, you’ll eventually need it. Here’s everything I know about it, tested and explained from the ground up.

What Is Minicom?

Minicom is a text-based, menu-driven serial communication program for Linux and other Unix-like systems. It’s the modern successor to the classic MS-DOS/Unix “Telix”-style terminal programs, and it lets you open a terminal session over a serial port — whether that’s a real RS-232 port, a USB-to-serial adapter, or a virtual serial device — to talk directly to whatever hardware is on the other end.

It’s licensed under the GPL and has been a staple of Linux distributions since the 1990s, still actively maintained on GitHub.

Why Serial Communication Still Matters

In a world of Ethernet, Wi-Fi, and cloud APIs, it’s easy to forget that a huge amount of infrastructure and hardware is still managed over serial:

Installing Minicom

On Debian/Ubuntu:

sudo apt update
sudo apt install minicom

Confirmed working install output:

Setting up minicom (2.9-4) ...

Other platforms:

# Fedora / RHEL
sudo dnf install minicom

# Arch Linux
sudo pacman -S minicom

# macOS (via Homebrew)
brew install minicom

Check the version:

minicom --version

Output:

minicom version 2.9
Copyright (C) Miquel van Smoorenburg.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

Preparing Your System

Before minicom can talk to a serial device, your user typically needs access to the relevant device node. On most distros, serial and USB-serial adapters show up as /dev/ttyUSB0, /dev/ttyACM0, or /dev/ttyS0.

Add yourself to the dialout group (Debian/Ubuntu) so you don’t need root for every session:

sudo usermod -aG dialout $USER

Log out and back in for the group change to apply. Confirm the device is present:

ls -l /dev/ttyUSB* /dev/ttyACM* 2>/dev/null
dmesg | grep -i tty | tail -10

Basic Syntax

minicom [options] [configuration]

Common options:

-D <device>     Serial device to use (e.g. /dev/ttyUSB0)
-b <baudrate>   Set the baud rate (e.g. 115200)
-s              Enter setup/configuration menu
-o              Don't initialize the modem/serial port (useful for already-configured devices)
-C <file>       Log all session output to a capture file
-c on/off       Enable/disable ANSI color

First-Time Configuration

The cleanest way to start is to run the setup menu as root once, save a default config, and then run minicom normally afterward.

sudo minicom -s

This opens minicom’s classic blue configuration screen with options including:

Inside “Serial port setup” you’ll typically set:

A - Serial Device      : /dev/ttyUSB0
B - Lockfile Location   : /var/lock
C - Callin Program      :
D - Callout Program     :
E - Bps/Par/Bits        : 115200 8N1
F - Hardware Flow Control : No
G - Software Flow Control : No

115200 8N1 (115200 baud, 8 data bits, no parity, 1 stop bit) is the most common configuration for modern embedded debug UARTs; older network gear console ports are frequently 9600 8N1.

Connecting Directly Without Setup

Once you know your device and baud rate, you can skip the menu entirely:

sudo minicom -D /dev/ttyUSB0 -b 115200

This immediately opens a live terminal session against the serial device. Any boot logs, login prompts, or shell output from the connected hardware appear directly in your terminal, and anything you type is sent out over the serial line.

Key Commands Inside a Minicom Session

Once connected, minicom is controlled with Ctrl-A as the command prefix (similar to screen‘s Ctrl-A or tmux’s Ctrl-B):

Ctrl-A Z    Show the help/command summary
Ctrl-A X    Exit minicom (with confirmation)
Ctrl-A Q    Quit without reset, no confirmation
Ctrl-A C    Clear the screen
Ctrl-A L    Capture session to a log file (toggle on/off)
Ctrl-A O    Open the configuration menu mid-session
Ctrl-A A    Add a linefeed after each carriage return (useful when output looks staircased)
Ctrl-A E    Toggle local echo (turn on if you can't see what you type)

Logging a Session (Capture Mode)

For forensics or documentation purposes, you’ll often want a full transcript of the serial session:

minicom -D /dev/ttyUSB0 -b 115200 -C session_capture.log

Everything sent and received is written to session_capture.log in real time, which is invaluable when you need to hand a boot log or debug shell transcript to a colleague or attach it as evidence in an incident report.

How Minicom Works Internally

Minicom is a fairly thin, well-understood layer over the POSIX termios API:

  1. It opens the specified device node (/dev/ttyUSB0, etc.) using standard open().
  2. It configures the port’s line discipline via tcsetattr() — this is where baud rate, parity, stop bits, and flow control settings actually get applied at the kernel driver level.
  3. It runs a read/write loop: keystrokes from your terminal are written to the serial file descriptor, and any bytes arriving on the serial line are read and rendered to your screen through minicom’s own VT102-compatible terminal emulator.
  4. Session capture (Ctrl-A L) simply tees the incoming byte stream to a log file in parallel with rendering it.

Because it operates at the termios/tty layer, minicom works identically whether the underlying device is a genuine RS-232 UART, a USB-to-serial converter (FTDI, CP210x, CH340 chipsets are the most common), or a PTY.

Real-World Use Cases

1. Network device console recovery When a router or switch has been misconfigured and is unreachable over the network (wrong VLAN, bad IP config, locked out), the console port is often the only way back in. Connect a USB-to-RJ45 console cable, fire up minicom at the appropriate baud rate (commonly 9600 8N1 for Cisco gear), and you get direct access to the device’s CLI regardless of its network state.

2. Embedded security research and firmware analysis During authorized hardware security assessments, UART debug headers on IoT devices frequently expose an unauthenticated root shell or bootloader interface. Minicom is the standard way to interact with that shell once you’ve identified the correct pins (TX/RX/GND) with a logic analyzer or multimeter.

3. Bootloader and kernel boot log capture Capturing full U-Boot / kernel boot output from an embedded device for troubleshooting a boot failure, verifying secure boot chain messages, or documenting device behavior for a report.

4. Digital forensics on legacy or air-gapped equipment Extracting diagnostic output from isolated lab or industrial equipment that has no network interface at all, where serial is the only available data path.

Automation and Scripting

Minicom itself is interactive by design, but it does support scripting via its companion tool runscript, driven by the expect-like minicom scripting language:

# example script: login.mcs
send "\r"
expect "login:"
send "admin\r"
expect "Password:"
send "yourpassword\r"

Run it with:

minicom -D /dev/ttyUSB0 -b 9600 -S login.mcs

For more complex automated interactions, many engineers instead reach for Python’s pexpect or pyserial libraries, using minicom mainly for the interactive/manual portion of a workflow and scripting only the repetitive bits.

Integration with Other Tools

Troubleshooting and Common Mistakes

Best Practices

FAQ

What’s the difference between minicom and screen for serial connections? screen /dev/ttyUSB0 115200 works for a quick session, but minicom offers a persistent configuration menu, built-in session capture, scripting support, and a friendlier interface for repeated use on the same hardware.

Do I need root to run minicom? Not if your user is in the dialout (or equivalent) group with permission on the device node. Otherwise, yes.

Can minicom talk over USB directly, or only real serial ports? It works over any device that presents a standard tty interface, which includes USB-to-serial adapters (/dev/ttyUSB*, /dev/ttyACM*) — it doesn’t need a physical RS-232 port.

How do I know the correct baud rate for an unknown device? Check vendor documentation first. If unavailable, common defaults to try are 115200, 9600, and 38400 — garbled text is the signal to try a different rate.

Can I use minicom for forensic evidence collection? Yes, its -C capture flag produces a timestamped-by-your-system plain text transcript, though for formal chain-of-custody work you should also log your session metadata (start/end time, examiner, device serial number) separately per your organization’s evidence handling procedures.

Summary

Minicom is unglamorous but essential: a reliable, scriptable serial terminal that’s been quietly enabling console access, embedded debugging, and hardware forensics work for decades. If your work ever touches physical network appliances or embedded devices, it’s worth having installed and configured before you actually need it in a pinch.

References

Exit mobile version