Serial Devices and the login: Prompt
It was once very common that a Unix installation involved one server machine and many “dumb” character mode terminals or dial-up modems. Today that sort of installation is less common, which is good news for many people interested in operating this way, because the “dumb” terminals are now very cheap to acquire. Dial-up modem configurations are no less common, but these days they would probably be used to support a SLIP or PPP login (discussed in Chapter 7 and Chapter 8) than to be used for a simple login. Nevertheless, each of these configurations can make use of a simple program called a getty program.
The term getty is probably a contraction of
“get tty.” A getty program opens a
serial device, configures it appropriately, optionally configures a
modem, and waits for a connection to be made. An active connection on
a serial device is usually indicated by the Data Carrier Detect (DCD)
pin on the serial device being raised. When a connection is detected,
the getty program issues a
login: prompt, and then invokes the
login program to handle the actual system
login. Each of the virtual terminals (e.g.,
/dev/tty1) in Linux has a
getty running against it.
There are a number of different getty implementations, each designed to suit some configurations better than others. The getty that we’ll describe here is called mgetty. It is quite popular because it has all sorts of features that make it especially modem-friendly, including support for automatic ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access