The Serial Console: A Front Door Worth Leaving Open - Page 2

 By Carla Schroder
Page 2 of 2   |  Back to Page 1
Print Article

Continued From Page 1

Now go to the "terminal" machine, your trusty laptop or whatever, and set up Minicom. You'll see this beautiful ASCII menu:

# minicom -s

| Filenames and paths      
| File transfer protocols 
| Serial port setup        
| Modem and dialing       
| Screen and keyboard   
| Save setup as dfl 
| Save setup as..         
| Exit          
| Exit from Minicom 

Select "serial port setup". Modern modems are pretty good at auto-negotiating connection speeds. Start out conservatively, then you can bump it up if you like and see what happens. Select the letter of the option you want to change, then hit return to get back to "Change which setting?":

| A -    Serial Device      : /dev/ttyS0 
| B - Lockfile Location     : /var/lock 
| C -   Callin Program      :      
| D -  Callout Program      : 
| E -    Bps/Par/Bits       : 9600 8N1
| F - Hardware Flow Control : No
| G - Software Flow Control : No 
|    Change which setting? 

Next, select the "Modem and dialing" option, and make sure the "Init string" and "Reset string" settings are blank. Finally, select "Save setup as dfl" to make this the default, and then "Exit" from Minicom.

Making the Connection with Minicom

Now take your nice new null-modem cable and connect the two machines. Then fire up Minicom on the "terminal":

# minicom

Welcome to minicom 2.1

OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
Compiled on Nov 12 2003, 19:21:57

Press CTRL-A Z for help on special keys

headless login:

Login, and there you are. What can you do? Anything that you can do from any Linux command shell.

To exit, hit Ctrl+A, Z, X.

Serial Annoyances

Permissions inconsistencies are going to bite you a lot. By default on most Linuxes, root cannot login over a tty. So you'll have to edit or create /etc/securetty on your server, and add this line:


Non-root users can't use tty ports. The quick n dirty fix is this:

# chmod o+rw /dev/ttyS0

The long-term fix is set up sudo users for /dev/ttyS0.

A third show stopper nuisance is having mingetty. mingetty is strictly for logging into to local virtual terminals. It does not support serial lines. You want agetty, getty, or mgetty, which can be obtained from the usual Linux sources. If your system is using mingetty, don't remove it. Just be sure to edit /etc/inittab to point to agetty, getty, or mingetty.


This article was originally published on Aug 18, 2004
Get the Latest Scoop with Networking Update Newsletter