<?xml version="1.0"?>
<book id="remote-serial-console-howto" lang="en"><bookinfo><title>Remote Serial Console HOWTO</title><pubdate>v2.5 2003-01-20</pubdate><authorgroup><author><firstname>Glen</firstname><surname>Turner</surname><affiliation><orgname>Australian Academic and Research Network</orgname><address format="linespecific"><email>glen.turner+howto@aarnet.edu.au</email></address></affiliation></author><author><firstname>Mark</firstname><othername>F.</othername><surname>Komarinski</surname><affiliation><address format="linespecific"><email>mkomarinskiATwayga.org</email></address></affiliation></author></authorgroup><revhistory><revision><revnumber>2.5</revnumber><date>2003-01-20</date><authorinitials>gdt</authorinitials><revremark>Only one console
    per technology type. Setting timezone. Use off parameter rather
    than comments in inittab. Cable lengths.</revremark></revision><revision><revnumber>2.4</revnumber><date>2002-10-03</date><authorinitials>gdt</authorinitials><revremark>Kernel flow control bug, more cabling, Debian,
    Livingston Portmaster, typos (especially those found during
    translation to Japanese).</revremark></revision><revision><revnumber>2.3</revnumber><date>2002-07-11</date><authorinitials>gdt</authorinitials><revremark>Updates for Red Hat Linux 7.3, corrections to serial
    port speeds and UARTs, ioctlsave.</revremark></revision><revision><revnumber>2.2</revnumber><date>2002-05-22</date><authorinitials>gdt</authorinitials><revremark>Minor changes</revremark></revision><revision><revnumber>2.1</revnumber><date>2002-05-16</date><authorinitials>gdt</authorinitials><revremark>Corrections to kernel console syntax. Addition of USB
    and devfs.</revremark></revision><revision><revnumber>2.0</revnumber><date>2002-02-02</date><authorinitials>gdt</authorinitials><revremark>Second edition.</revremark></revision><revision><revnumber>ent1.0</revnumber><date>2001-03-20</date><authorinitials>mfk</authorinitials><revremark>First edition.</revremark></revision></revhistory><abstract><para>An <acronym>RS-232</acronym> serial console allows
   <systemitem class="osname" moreinfo="none">Linux</systemitem> to be controlled from
   a terminal or modem attached to an asynchronous serial port.  The
   monitor, mouse and keyboard are no longer required for system
   administration.  Serial consoles are useful where <systemitem class="osname" moreinfo="none">Linux</systemitem> systems are deployed at remote
   sites or are deployed in high-density racks.</para><para>This <citetitle>HOWTO</citetitle> describes how to configure
   <systemitem class="osname" moreinfo="none">Linux</systemitem> to attach a serial
   console.</para></abstract><keywordset><keyword>serial console</keyword><keyword>console</keyword><keyword>serial</keyword><keyword>modem</keyword><keyword>RS-232</keyword></keywordset></bookinfo><dedication id="dedication"><title>Dedication</title><para>Glen Turner would like to thank his family for allowing him to
  work on this project for the surprisingly large number of evenings
  which it took to write this <citetitle>HOWTO</citetitle>.  Thank you
  Karen, Kayla and Ella.</para></dedication><chapter id="intro"><title>Introduction</title><epigraph id="intro-skb"><para><wordasword>console</wordasword> <abbrev>n.</abbrev> [From
   latin <foreignphrase>consolatio(n)</foreignphrase> entcomfort,
   spiritual solace.ent] A device for displaying or printing
   condolances or obituaries for the operator.</para><para>Stan Kelly-Bootle, <citetitle>The Computer
   Contradictionary</citetitle>.</para></epigraph><section id="intro-what"><title>What is a console?</title><para>The console is the text output device for system
   administration messages.  These messages come from the kernel, from
   the <application moreinfo="none">init</application> system and from the system
   logger.</para><para>On modern small computers the console is usually the
   computer's attached monitor and keyboard.</para><para>On many older computers the console is an
   <acronym>RS-232</acronym> link to a terminal such as a
   <acronym>DEC</acronym>
   <productname class="trade"><acronym>VT100</acronym></productname>.  This terminal
   is in a locked room and is continually observed by the
   minicomputer's operators.  Large systems from Sun, Hewlett-Packard
   and <acronym>IBM</acronym> still use serial consoles.</para><para>It is usually possible to login from the console.  A login
   session from the console is treated by many parts of the operating
   system as being more trustworthy than a login session from other
   sources.  Logging in as the <systemitem class="username" moreinfo="none">root</systemitem> super-user from the console is
   the Command Line of Last Resort when faced with a misbehaving
   system.</para></section><section id="intro-why"><title>Why use a serial console?</title><para>For the average user a serial console has no advantage over a
   console offered by a directly attached keyboard and screen.  Serial
   consoles are much slower, taking up to a second to fill a 80 column
   by 24 line screen.  Serial consoles generally only support
   non-proportional <acronym>ASCII</acronym> text, with limited
   support for languages other than English.  A new terminal can be
   more expensive than an old <acronym>PC</acronym>.</para><para>There are some scenarios where serial consoles are
   useful. These are:</para><variablelist><varlistentry><term>Systems administration of remote computers</term><listitem><para><systemitem class="osname" moreinfo="none">Linux</systemitem> is a good
      operating system for deployment at unstaffed sites.  <systemitem class="osname" moreinfo="none">Linux</systemitem> is also good for hosting
      critical network infrastructure such as <acronym>DNS</acronym>
      and <acronym>DHCP</acronym> services.  These services are
      generally installed at every site of an organisation including
      sites which may be too small or too remote to have information
      technology staff.</para><para>System administration of these remote computers is usually
      done using <application moreinfo="none"><acronym>SSH</acronym></application>, but
      there are times when access to the console is the only way to
      diagnose and correct software failures.  Major upgrades to the
      installed distribution may also require console access.</para><para>In these cases the serial console is attached to a modem.
      Access to the console is gained from a remote computer by
      dialing into the modem.  This allows the console to be reached
      from any telephone socket.</para></listitem></varlistentry><varlistentry><term>High density racks of computers</term><listitem><para>Clusters of personal computers can outperform mainframe
      computers and form competitive supercomputers for some
      applications.  See the <ulink url="http://www.tldp.org/HOWTO/Cluster-HOWTO.html"><citetitle>Cluster-HOWTO</citetitle></ulink>
      for more information on clustering.</para><para>These clusters are typically assembled into 19 inch
      telecommunications equipment racks and the system unit of each
      computer is typically one rack unit (or 1.75 inches) tall.  It
      is not desirable to put a keyboard and monitor on each computer,
      as a small cathode ray tube monitor would consume the space used
      by sixteen rack units.</para><para>A first glance it seems that a monitor and keyboard switch
      is the best solution.  However the <acronym>VGA</acronym> signal
      to the monitor is small, so even with the switch the monitor
      cannot be placed very far away from the rack of
      computers.</para><para>It is desirable to allow the consoles to be monitored in
      the operators' room of the computer center, rather than in the
      very expensive space of the machine room.  Although monitor
      switches with remote control and fiber optical extensions are
      available, this solution can be expensive.</para><para>A standard <acronym>RS-232</acronym> cable can be 15
      meters in length.  Longer distances are easily possible. The
      cabling is cheap.  Terminal servers can be used to allow one
      terminal to access up to 90 serial consoles.</para></listitem></varlistentry><varlistentry><term>Recording console messages</term><listitem><para>This is useful in two very different cases.</para><para>Kernel programmers are often faced with a kernel error
      message that is displayed a split second before the computer
      reboots.  A serial console can be used to record that
      message. Another <systemitem class="osname" moreinfo="none">Linux</systemitem>
      machine can be used as the serial terminal.</para><para>Some secure installations require all security events to
      be unalterably logged.  One way to meet this requirement is to
      print all console messages.  Connecting the serial console to a
      serial printer can achieve this.<footnote><para>The <systemitem class="osname" moreinfo="none">Linux</systemitem>
        <productnumber>2.4</productnumber> kernel also supports the
        output of console messages to
        <productname class="trade">Centronics</productname> or
        <citetitle><acronym>IEEE</acronym> 1284-2000</citetitle>
        parallel printer interfaces.</para></footnote></para></listitem></varlistentry><varlistentry><term>Embedded software development</term><listitem><para><systemitem class="osname" moreinfo="none">Linux</systemitem> is
      increasingly being used as an operating system for embedded
      applications.  These computers do not have keyboards or
      screens.</para><para>A serial port is a cheap way to allow software developers
      to directly access the embedded computer.  This is invaluable
      for debugging.  Most chip sets designed for embedded computers
      have a serial port precisely for this purpose.</para><para>The shipping product need not present the
      <acronym>RS-232</acronym> port on an external connector.
      Alternatively the <acronym>RS-232</acronym> port is often used for
      downloading software updates.</para></listitem></varlistentry><varlistentry><term>Craft terminal for telecommunications equipment</term><listitem><para><systemitem class="osname" moreinfo="none">Linux</systemitem> is
      increasingly being used as the operating system inside
      telecommunications equipment.  The <ulink url="http://www.osdlab.org/projects/cgl/">Carrier Grade
      Linux</ulink> consortia hopes to accelerate and coordinate this
      trend.</para><para>Most telecommunications equipment is remotely managed from
      a distant computer.  However, site technicans (called
      <wordasword>craft personnel</wordasword> in telco-speak) need to
      access the equipment to test installation changes, check the
      status of reported faults, and so on.  The terminal used by the
      craft personnel is called the <wordasword>craft
      terminal</wordasword>.  The craft terminal plugs into the
      <wordasword>craft interface</wordasword> on the equipment.  The
      serial console makes an ideal craft interface.</para></listitem></varlistentry></variablelist><para>Unlike minicomputer systems, the
   <productname class="trade"><acronym>IBM</acronym>
   <acronym>PC</acronym></productname> was not designed to use a
   serial console.  This has two consequences.</para><para>Firstly, Power On Self-Test messages and Basic Input/Output
   System (<acronym>BIOS</acronym>) messages are sent to the screen
   and received from the keyboard.  This makes it difficult to use the
   serial port to reconfigure the <acronym>BIOS</acronym> and
   impossible to see Power On Self-Test errors.</para><para>An increasing number of manufacturers of rackable
   <emphasis>server</emphasis> equipment are altering their
   <acronym>BIOS</acronym>s to optionally use the
   <acronym>RS-232</acronym> port for BIOS configuration and test
   messages.  If you are buying a machine specifically for use with
   serial console you should seek this feature.  If you have an
   existing machine that definitely requires access to the
   <acronym>BIOS</acronym> from the serial port then there are
   hardware solutions such as <ulink url="http://www.realweasel.com/"><productname class="trade">PC Weasel
   2000</productname></ulink>.</para><para>Secondly, the <acronym>RS-232</acronym> port on the
   <productname class="trade"><acronym>IBM</acronym>
   <acronym>PC</acronym></productname> is designed for connecting to a
   modem.  Thus a null modem cable is needed when connecting the PC's
   serial port to a terminal.</para></section><section id="intro-word"><title>Alternative meanings of entconsoleent</title><para>Some authors use the word entconsoleent to refer to
   the keyboard and monitor that are attached to the system unit.
   This is described as a entphysical consoleent by some
   <systemitem class="osname" moreinfo="none">Linux</systemitem> documentation.  The
   console where system messages appear is described as the
   entlogical consoleent by that documentation.</para><para>As an illustration of the difference, <productname class="trade">X
   Windows</productname> should start on the physical console but
   system messages issued by failures when starting <productname class="trade">X
   Windows</productname> should be written to the logical
   console.</para><para>To avoid confusion this <citetitle>HOWTO</citetitle> uses the
   word entconsoleent to describe the place where system
   messages are printed.  This <citetitle>HOWTO</citetitle> uses the
   phrase entattached monitor and keyboardent rather than the
   confusing words entphysical consoleent.</para><para>These distinctions are also made in the naming of devices.
   The device <filename class="devicefile" moreinfo="none">/dev/console</filename> is
   used to send messages to the console.  The symbolic link <filename class="symlink" moreinfo="none">/dev/systty</filename> points to the device which
   is used by the attached monitor and keyboard, often <filename class="devicefile" moreinfo="none">/dev/tty0</filename>.</para><table frame="topbot" colsep="0" rowsep="0" id="intro-word-console"><title>Different ways of referring to the entconsoleent</title><tgroup cols="3"><thead><row><entry>Document</entry></row></thead><tbody><row><entry><para>This <citetitle>HOWTO</citetitle></para></entry><entry><para><quote>Console</quote></para></entry><entry><para><quote>Attached monitor and keyboard</quote></para></entry></row><row><entry><para>Some Linux documentation</para></entry><entry><para><quote>Logical console</quote></para></entry><entry><para><quote>Physical console</quote></para></entry></row><row><entry><para>Device names</para></entry><entry><para><filename class="devicefile" moreinfo="none">/dev/console</filename></para></entry><entry><para><filename class="devicefile" moreinfo="none">/dev/systty</filename></para></entry></row></tbody></tgroup></table></section><section id="intro-config"><title>Configuration overview</title><para>There are five major steps to configuring a serial
   console.</para><procedure><step performance="required"><para>Optionally, the <acronym>BIOS</acronym> may be configured
     to use the serial port.</para></step><step performance="required"><para>If needed, the boot loader may be configured to use the
     serial port.</para></step><step performance="required"><para>The Linux kernel must be configured to use the serial port
     as its console.  This is done by passing the kernel the
     <literal moreinfo="none">console</literal> parameter when the kernel is started
     by the boot loader.</para></step><step performance="required"><para>The <application moreinfo="none">init</application> system should keep a
     process running to monitor the serial console for logins.  The
     monitoring process is traditionally called
     <application moreinfo="none">getty</application>.</para></step><step performance="required"><para>A number of system utilities need to be configured to make
     them aware of the console, or configured to prevent them from
     disrupting the console.</para></step></procedure><para>Examples in this <citetitle>HOWTO</citetitle> are from
   <productname class="trade">Red Hat Linux</productname> versions
   <productnumber>7.1</productnumber> through to
   <productnumber>7.3</productnumber> (released 2001 through to 2002).
   The maintainer would appreciate updates when new versions of
   <productname class="trade">Red Hat Linux</productname> appear.  The maintainer
   would very much appreciate examples for <systemitem class="osname" moreinfo="none">Linux</systemitem> distributions that are dissimilar
   to <productname class="trade">Red Hat Linux</productname>; particularly
   <productname class="trade">Debian GNU/Linux</productname> and
   <productname class="trade">Slackware Linux</productname>.  All contributors are
   acknowledged in <xref linkend="about-credits"></xref>.</para></section></chapter><chapter id="preparation"><title>Preparation</title><para>This chapter ensures that access the existing console can be
  restored should the serial console fail to start.</para><para>This chapter then discusses the selection of the
  <acronym>RS-232</acronym> port and its parameters.</para><section id="preparation-fallback"><title>Create fallback position</title><para>Good system administrators always have a viable fallback
   plan to cope with failures.  A mistake configuring the serial
   console can make both the serial console and the attached monitor
   and keyboard unusable.  A fallback plan is needed to retrieve
   console access.</para><para>Many <systemitem class="osname" moreinfo="none">Linux</systemitem>
   distributions allow boot diskettes to be created.  Writing a boot
   diskette before altering the console configuration results in a
   boot diskette that passes good parameters to the kernel rather than
   parameters that may contain an error.</para><para>Under <productname class="trade">Red Hat Linux</productname> a boot
   diskette is created by determining the running kernel
   version</para><informalfigure float="0" id="preparation-fallback-kernelversion"><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">uname -r</command>
<computeroutput moreinfo="none">2.4.2-2</computeroutput></screen></informalfigure><para>and then using that version to create the boot
   diskette</para><informalfigure float="0" id="preparation-fallback-rhldisk"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">mkbootdisk ententdevice /dev/fd0 2.4.2-2</command></screen></informalfigure><para>Under <productname class="trade">Debian
   <acronym>GNU</acronym>/Linux</productname> the boot diskette is
   created by determining the version of the running kernel and then
   using that version to write the boot diskette</para><informalfigure float="0" id="preparation-fallback-debiandisk"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">mkboot /boot/vmlinuz-2.4.2-2</command></screen></informalfigure><para>An alternative fallback position is have a rescue diskette
   with the machine.  A common choice is <ulink url="http://www.toms.net/rb/">Tom's root boot</ulink>.</para></section><section id="preparation-setport"><title>Select a serial port </title><section id="preparation-setport-name"><title>Serial port names</title><para>Linux names its serial ports in the
    <productname class="trade">UNIX</productname> tradition.  The first serial port
    has the file name <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename>, the second serial port
    has the file name <filename class="devicefile" moreinfo="none">/dev/ttyS1</filename>, and so on.</para><para>This differs from the <productname class="trade"><acronym>IBM</acronym>
    <acronym>PC</acronym></productname> tradition.  The first serial
    port is named <filename class="devicefile" moreinfo="none">COM1:</filename>, the
    second serial port is named <filename class="devicefile" moreinfo="none">COM2:</filename>, and so on.  Up to four serial
    ports can be present on a <productname class="trade"><acronym>IBM</acronym>
    <acronym>PC/AT</acronym></productname> computer and its
    successors.</para><para>Most boot loaders have yet another naming scheme.  The first
    serial port is numbered <literal moreinfo="none">0</literal>, the second serial
    port is numbered <literal moreinfo="none">1</literal>, and so on.</para><para>If your distribution of <systemitem class="osname" moreinfo="none">Linux</systemitem> uses the
    <application moreinfo="none">devfs</application> device manager then the serial
    ports have yet another name.  The first serial port is <filename class="devicefile" moreinfo="none">/dev/tts/0</filename>, the second serial port
    is <filename class="devicefile" moreinfo="none">/dev/tts/1</filename>, and so
    on.</para><para>The result is that the first serial port is labeled
    <filename class="devicefile" moreinfo="none">COM1:</filename> on the chassis of
    the <productname class="trade"><acronym>IBM</acronym>
    <acronym>PC</acronym></productname>; is known as <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename> to <systemitem class="osname" moreinfo="none">Linux</systemitem>; is known as <filename class="devicefile" moreinfo="none">/dev/tts/0</filename> to <systemitem class="osname" moreinfo="none">Linux</systemitem> when configured with
    <application moreinfo="none">devfs</application>; and is known as port
    <literal moreinfo="none">0</literal> to many boot loaders.</para><para>The examples in this <citetitle>HOWTO</citetitle> use this
    first serial port, as that is the serial port which most readers
    will wish to use.</para><table frame="topbot" colsep="0" rowsep="0" id="preparation-setport-names-many"><title>Many names for the same serial port</title><tgroup cols="4" align="center"><thead valign="bottom"><row rowsep="1"><entry align="center" valign="bottom"><productname class="trade">IBM PC</productname></entry><entry align="center" valign="bottom"><systemitem class="osname" moreinfo="none">Linux</systemitem> kernel</entry><entry align="center" valign="bottom"><systemitem class="osname" moreinfo="none">Linux</systemitem> kernel with
        <application moreinfo="none">devfs</application></entry><entry align="center" valign="bottom">Most boot loaders</entry></row></thead><tbody><row><entry><filename class="devicefile" moreinfo="none">COM1:</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/ttyS0</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/tts/0</filename></entry><entry><literal moreinfo="none">0</literal></entry></row><row><entry><filename class="devicefile" moreinfo="none">COM2:</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/ttyS1</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/tts/1</filename></entry><entry><literal moreinfo="none">1</literal></entry></row><row><entry><filename class="devicefile" moreinfo="none">COM3:</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/ttyS2</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/tts/2</filename></entry><entry><literal moreinfo="none">2</literal></entry></row><row><entry><filename class="devicefile" moreinfo="none">COM4:</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/ttyS3</filename></entry><entry><filename class="devicefile" moreinfo="none">/dev/tts/3</filename></entry><entry><literal moreinfo="none">3</literal></entry></row></tbody></tgroup></table></section><section id="preparation-setport-interrupt"><title>Cannot share interrupt used for console's serial
    port</title><para>When used for a console the serial port cannot share an
    interrupt with another device.  The
    <productname class="trade"><acronym>IBM</acronym>
    <acronym>PC</acronym></productname> devices are usually installed
    as shown in <xref linkend="preparation-setport-ibmpc"></xref>.  If you
    use the serial port <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename> for the console then you
    should avoid sharing interrupt 4 by not installing a serial port
    <filename class="devicefile" moreinfo="none">/dev/ttyS2</filename> in your
    <acronym>PC</acronym>.  If <filename class="devicefile" moreinfo="none">/dev/ttyS2</filename> cannot be physically
    removed then disable it using the <command moreinfo="none">setserial</command>
    command, as shown in <xref linkend="preparation-setport-setserial"></xref>.</para><table frame="topbot" colsep="0" rowsep="0" id="preparation-setport-ibmpc"><title>Interrupts used for <productname class="trade"><acronym>IBM</acronym>
     <acronym>PC/AT</acronym></productname> <acronym>RS-232</acronym>
     ports</title><tgroup cols="3" align="center"><thead valign="bottom"><row rowsep="1"><entry align="center">Device</entry><entry align="center">Interrupt</entry><entry align="center">Port</entry></row></thead><tbody><row><entry><filename class="devicefile" moreinfo="none">/dev/ttyS0</filename></entry><entry>4</entry><entry>0x3f8</entry></row><row><entry><filename class="devicefile" moreinfo="none">/dev/ttyS1</filename></entry><entry>3</entry><entry>0x2f8</entry></row><row><entry><filename class="devicefile" moreinfo="none">/dev/ttyS2</filename></entry><entry>4</entry><entry>0x3e8</entry></row><row><entry><filename class="devicefile" moreinfo="none">/dev/ttyS3</filename></entry><entry>3</entry><entry>0x2e8</entry></row></tbody></tgroup></table><figure float="0" id="preparation-setport-setserial"><title>Using the <command moreinfo="none">setserial</command> command in
    <filename moreinfo="none">/etc/rc.serial</filename>to disable the serial port
    <filename class="devicefile" moreinfo="none">/dev/ttyS2</filename></title><programlisting format="linespecific"># Disable /dev/ttyS2 so interrupt 4 is not shared,
# then /dev/ttyS0 can be used as a serial console.
setserial /dev/ttyS2 uart none port 0x0 irq 0</programlisting></figure><para>Reading the source code suggests that the interrupt-sharing
    constraint applies to all computer architectures, not just Intel
    Architecture-32.</para></section></section><section id="preparation-setspeed"><title>Select a serial speed and parameters</title><para>This <citetitle>HOWTO</citetitle> does not discuss the
   <acronym>RS-232</acronym> standard, which is formally known as
   <citetitle><acronym>ANSI/TIA/EIA-232-F-1997</acronym> Interface
   Between Data Terminal Equipment and Data Circuit-Terminating
   Equipment Employing Serial Data Interchange</citetitle>.  For an
   explanation of entbits per secondent, entstart
   bitsent, entdata bitsent, entparityent,
   entstop bitsent and entflow controlent refer to the
   <ulink url="http://www.tldp.org/HOWTO/Serial-HOWTO.html"><citetitle>Serial-HOWTO</citetitle></ulink>
   and the <ulink url="http://www.tldp.org/HOWTO/Modem-HOWTO.html"><citetitle>Modem-HOWTO</citetitle></ulink>.</para><para>The description of the command syntax for setting the serial
   parameters in the kernel, boot loaders and login applications uses
   the following variables which describe <acronym>RS-232</acronym>
   parameters.</para><variablelist><varlistentry><term><replaceable>entspeedent</replaceable></term><listitem><para>The speed of the serial link in bits per second.</para><para>The <systemitem class="osname" moreinfo="none">Linux</systemitem> kernel
      on a modern <acronym>PC</acronym> supports a serial console
      speeds of 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200
      bits per second.</para><para>The kernel supports a much wider range of serial bit rates
      when the serial interface is not being used as a serial
      console.<footnote><para>There is no good reason for this
      difference.  Feel free to submit a patch to the linux-kernel
      mailing list to correct this oddity.</para></footnote></para><para>Very recent <systemitem class="osname" moreinfo="none">Linux</systemitem>
      kernels can also offer a serial console using a
      <acronym>USB</acronym> serial dongle at speeds of 1200, 2400,
      4800, 9600, 19200, 38400, 57600 and 115200 bits per
      second.</para><para>Most boot loaders only support a different range of speeds
      than are supported by the kernel.
      <productname class="trade">LILO</productname>
      <productnumber>21.7.5</productnumber> supports 110, 150, 300,
      600, 1200, 2400, 4800, 9600, 19200, 38400, 56000, 57600 and
      115200 bits per second.  <productname class="trade">SYSLINUX</productname>
      <productnumber>1.67</productnumber> supports 75 to 56000 bits
      per second.  <productname class="trade">GRUB</productname>
      <productnumber>0.90</productnumber> supports 2400, 4800, 9600,
      19200, 38400, 57600 and 115200 bits per second.</para><para>You must chose the same speed for both the boot loader and
      for the <systemitem class="osname" moreinfo="none">Linux</systemitem> kernel.
      An operating system may use more than one boot loader.  For
      example, <productname class="trade">Red Hat Linux</productname> uses
      <productname class="trade">SYSLINUX</productname> to install or upgrade the
      operating system; <productname class="trade">LILO</productname> as the boot
      loader for <productname class="trade">Red Hat Linux</productname>
      <productnumber>7.1</productnumber> and earlier; and
      <productname class="trade">GRUB</productname> as the boot loader for
      <productname class="trade">Red Hat Linux</productname>
      <productnumber>7.2</productnumber> and later.</para><para>If you are using a serial terminal or if you are using a
      dumb modem then the bit rate of the terminal or dumb modem must
      also match the bit rate selected in the boot loader and
      kernel.</para><para>If the serial console is connected to a Hayes-style modem
      slower than 9600<abbrev>bps</abbrev> then configure the serial
      console with the same speed as the modem.  Modems faster than
      9600<abbrev>bps</abbrev> will generally automatically
      synchronize to the speed of the serial port.</para><para>The selected bit rate must also be supported by the serial
      port's <acronym>UART</acronym> semiconductor chip.  Early
      <acronym>UART</acronym>s without on-chip receive buffers could
      only reliably receive at up to 14400<abbrev>bps</abbrev>, this
      includes models 8250A, 82510, 16450 and 16550 (with no
      <wordasword>A</wordasword>).  Recent <acronym>UART</acronym>s with
      receive buffers will work at all serial console bit rates, this
      includes models 16550A, 16552, 16650, 16654, 16750, 16850 and
      16950.</para><para>Unless you have good reason, use the popular bit rate of
      9600 bits per second.  This is the default bit rate of a great
      many devices.</para><para>The speeds that are supported by the kernel, the three
      common boot loaders, and all <productname class="trade"><acronym>IBM</acronym>
      <acronym>PC</acronym>s</productname> capable of running
      <systemitem class="osname" moreinfo="none">Linux</systemitem> are: 2400, 4800,
      9600 and 19200 bits per second.  This is a depressingly small
      selection: not slow enough to support a call over an
      international phone circuit and not fast enough to upload large
      files.  You may need to choose a speed that will result in a
      less robust software configuration.</para><figure float="0" id="preparation-setspeed-bps"><title>Syntax for serial bits per second rate, in extended
       Backus-Naur form</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entspeedent</replaceable> ::=  <replaceable>entdigitsent</replaceable>
<replaceable>entdigitsent</replaceable> ::= <replaceable>entdigitent</replaceable> | <replaceable>entdigitent</replaceable><replaceable>entdigitsent</replaceable>
<replaceable>entdigitent</replaceable> ::= <literal moreinfo="none">0</literal> | <literal moreinfo="none">1</literal> | ent | <literal moreinfo="none">9</literal></literallayout></figure></listitem></varlistentry><varlistentry><term><replaceable>entparityent</replaceable></term><listitem><para>Number of parity bits and the interpretation of a parity
      bit if one is present.</para><para>Allowed values are <literal moreinfo="none">n</literal> for no parity bit,
      <literal moreinfo="none">e</literal> for one bit of even parity and
      <literal moreinfo="none">o</literal> for one bit of odd parity.</para><para>Using no parity bit and eight data bits is
      recommended.</para><para>If parity is used then even parity is the common
      choice.</para><para>Parity is a simple form of error detection.  Modern modems
      have much better error detection and correction.  As a result
      the parity bit guards only the data on the cable between the
      modem and the serial port.  If this cable has a low error rate,
      and it should, then the parity bit is not required.</para><figure float="0" id="preparation-setspeed-parity"><title>Syntax for serial parity, in extended Backus-Naur
       form</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entparityent</replaceable> ::= <literal moreinfo="none">n</literal> | <literal moreinfo="none">e</literal> | <literal moreinfo="none">o</literal></literallayout></figure></listitem></varlistentry><varlistentry><term><replaceable>entdataent</replaceable></term><listitem><para>The number of data bits per character.</para><para>Allowed values are <literal moreinfo="none">7</literal> bits or
      <literal moreinfo="none">8</literal> bits, as Linux uses the
      <acronym>ASCII</acronym> character set which requires at least
      seven bits.</para><para>Eight data bits are recommended.  This allows the link to
      easily be used for file transfers and allows non-English text to
      be presented.</para><figure float="0" id="preparation-setspeed-data"><title>Syntax for serial data bits, in extended Backus-Naur
       form</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entdataent</replaceable> ::= <literal moreinfo="none">7</literal> | <literal moreinfo="none">8</literal></literallayout></figure></listitem></varlistentry><varlistentry><term><replaceable>entstopent</replaceable></term><listitem><para>The number of stop bit-times.<footnote><para>A <wordasword>bit-time</wordasword> is the time taken to
        transmit one bit.  The distinction between
        <wordasword>bit-times</wordasword> of signal and
        <wordasword>bits</wordasword> of data is apparent when you
        consider that 1.5 bit-times of signal is possible but that 1.5
        bits of data is impossible.</para></footnote></para><para>Allowed values are <literal moreinfo="none">1</literal> or
      <literal moreinfo="none">2</literal>.</para><para>One stop bit-time is recommended.</para><para>If the <acronym>RS-232</acronym> cable is very long then
      two stop bit-times may be needed.</para><para>You may occassionally see 1.5 stop bit-times.  The intent
      is to gain 4% more data throughput when a link is too long for
      one stop bit-time but is too short to require two stop
      bit-times.  1.5 stop bit-times is now rare enough to be a hazard
      to use.</para><figure float="0" id="preparation-setspeed-stop"><title>Syntax for serial stop bits, in extended Backus-Naur
       form</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entstopent</replaceable> ::= <literal moreinfo="none">1</literal> | <literal moreinfo="none">2</literal></literallayout></figure></listitem></varlistentry><varlistentry><term><replaceable>entflow_controlent</replaceable></term><listitem><para>The type of flow control to use.</para><para>The Linux kernel allows no flow control and
      <acronym>CTS</acronym>/<acronym>RTS</acronym> flow
      control.</para><para>No flow control is the default, this is indicated by
      omitting entflow_controlent.</para><para><acronym>CTS</acronym>/<acronym>RTS</acronym> flow control
      is recommended, especially if login access is also provided to
      the serial port.  This is indicated by a entflow_controlent of
      <literal moreinfo="none">r</literal>.</para><para><acronym>CTS</acronym>/<acronym>RTS</acronym> flow control
      regulates the flow of chatacters.  The computer does not send
      characters until Clear To Send is asserted by the modem.  If the
      computer is has enough buffering to recieve characters from the
      modem the computer asserts Ready to Send.  Thus neither the
      computer nor the modem's buffers are filled to
      overflowing.</para><caution><para>The kernel's
       <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control is
       currently buggy.  Machines can take a significant time to write
       console messages if flow control is enabled but
       <acronym>CTS</acronym> will never be asserted (as occurs when
       there is no call present on a modem or no session on a null
       modem cable or cable to a terminal server).  As a result of the
       large number of kernel messages when the kernel is started a
       machine configured with the kernel's
       <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control can
       take many minutes to reboot.</para><para>The kernel's
       <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control
       cannot be recommended at this time.  The
       <citetitle>HOWTO</citetitle>'s author has a kernel patch
       available which he is seeking to have included in the
       mainstream kernel source code.</para><para>The <acronym>CTS</acronym>/<acronym>RTS</acronym> flow
       control in user-space applications does not share the kernel's
       bugs and <acronym>CTS</acronym>/<acronym>RTS</acronym> flow
       control is still recommended for
       <application moreinfo="none">getty</application>.</para></caution><figure float="0" id="preparation-setspeed-flow"><title>Syntax for serial flow control, in extended Backus-Naur
       form</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entflow_controlent</replaceable> ::= <replaceable>entnilent</replaceable> | <literal moreinfo="none">r</literal></literallayout></figure></listitem></varlistentry></variablelist><para>At present the <acronym>RS-232</acronym> status lines are
   ignored by the kernel.  A kernel message will be printed even if
   Data Carrier Detect and Data Set Ready are not asserted.  This
   leads to the kernel messages being sent to a modem which is idle
   and in command mode.</para><para>The console's slack interpretation of <acronym>CTS</acronym>,
   <acronym>DSR</acronym> and <acronym>DCD</acronym> makes it
   impossible to connect a serial console to an
   <acronym>RS-232</acronym> multi-drop circuit.  Multi-drop circuits
   have more than two computers on the circuit; they are traditionally
   four-wire, satelite or wireless services.</para><para>The Linux kernel uses the syntax in <xref linkend="preparation-setspeed-modesyntax"></xref> to describe the serial
   parameters.  Many boot loaders use a variation of the syntax used
   by the Linux kernel.</para><figure float="0" id="preparation-setspeed-modesyntax"><title>Syntax for kernel serial parameters, in extended
    Backus-Naur form</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entmodeent</replaceable> ::= <replaceable>entspeedent</replaceable><replaceable>entparityent</replaceable><replaceable>entdataent</replaceable><replaceable>entflow_controlent</replaceable></literallayout></figure><para>Note that <replaceable>entmodeent</replaceable> does not
   include <replaceable>entstopent</replaceable>.  The kernel
   assumes the number of stop bits to be one.  This shortcoming needs
   to be considered when deploying long <acronym>RS-232</acronym>
   cables.</para><para>Most boot loaders default to <literal moreinfo="none">9600n8</literal>.  A
   common default found on older terminals is
   <literal moreinfo="none">9600e7</literal>.</para><para>Use <literal moreinfo="none">9600n8</literal> if possible, as this is the
   default for most Linux software and modern devices.</para><para>This <citetitle>HOWTO</citetitle> always configures the
   serial speed and parameters, even where not strictly necessary.
   This is so that people configuring parameters other than the
   recommended and common default value <literal moreinfo="none">9600n8</literal>
   will know what to alter.</para></section><section id="preparation-modem"><title>Configure the modem or the null-modem cable</title><para>If a modem is used, configure it to be a dumb modem at the
   port speed selected in <xref linkend="preparation-setspeed"></xref>.  If
   the modem accepts Hayes <acronym>AT</acronym> commands see <xref linkend="modem"></xref> to dumb-down the modem.</para><para>Alternatively if a terminal and a null-modem cable are used
   see <xref linkend="serial-pc-terminal"></xref>, which discusses the pinout
   of the null modem cable.</para></section><section id="preparation-terminal"><title>Configure the terminal or the terminal emulator</title><para>Configure the terminal to match the serial parameters.  The
   data bits, parity bits and stop bits must match.  If a modern
   entsmartent modem is used then the bit speeds need not
   match.  If a dumb modem or a null modem cable is used then the bit
   speeds must match.</para><para>Set <acronym>CTS</acronym>/<acronym>RTS</acronym> handshaking
   on, <acronym>DTR</acronym>/<acronym>DSR</acronym> handshaking off
   and <acronym>XON</acronym>/<acronym>XOFF</acronym> handshaking off.
   Your equipment may call
   <acronym>CTS</acronym>/<acronym>RTS</acronym> handshaking or
   <acronym>DTR</acronym>/<acronym>DSR</acronym> handshaking
   enthardware handshakingent and may call
   <acronym>XON</acronym>/<acronym>XOFF</acronym> handshaking
   entsoftware handshakingent.</para><para>Set automatic line wrapping on.  This allows all of a long
   console message to be read.</para><para>Set the received end of line characters to
   <acronym>CR</acronym> <acronym>LF</acronym> (carriage return then
   line feed).  Set the transmitted end of line characters to just
   <acronym>CR</acronym> (carriage return).</para><para>If you are using a terminal emulator then it is best to
   choose to emulate the popular <acronym>DEC</acronym>
   <productname class="trade">VT100</productname> or
   <productname class="trade">VT102</productname> terminal.  Later terminals in the
   <acronym>DEC</acronym> <acronym>VT</acronym> range are compatible
   with the <productname class="trade">VT100</productname>. If this terminal is not
   available then try to emulate another terminal that implements
   <citetitle><acronym>ANSI</acronym> <acronym>X3.64-1979</acronym>
   Additional Controls for Use with American National Standard Code
   for Information Interchange</citetitle> (or its successor
   <citetitle> <acronym>ISO</acronym>/<acronym>IEC</acronym> 6429:1992
   <acronym>ISO</acronym> Information technology ent Control
   functions for coded character sets</citetitle>).  For example, many
   emulators have a terminal called <literal moreinfo="none">ANSI BBS</literal> which
   uses the <productname class="trade">IBM PC</productname> character set, the 16
   <productname class="trade">IBM PC</productname> colors, a 80 column by 25 line
   screen and a selection of <citetitle>X3.64-1979</citetitle> control
   sequences.</para><para>See the <ulink url="http://www.tldp.org/HOWTO/Text-Terminal-HOWTO.html"><citetitle>Text-Terminal-HOWTO</citetitle></ulink>
   for much more information on configuring terminals.</para></section></chapter><chapter id="bios"><title>Optionally configure the <acronym>BIOS</acronym></title><para>Some <acronym>BIOS</acronym>s provide support for serial
  consoles.  If your computer's <acronym>BIOS</acronym> is one of
  these you should investigate the extent of the support provided.
  Depending upon the extent of serial console support you may not need
  to explicitly configure the boot loader to use the serial
  port.</para><para>The contributors to this <citetitle>HOWTO</citetitle> have
  encountered the following styles of <acronym>BIOS</acronym> support
  for serial consoles.</para><variablelist><varlistentry><term>Redirection of textual VGA output to the serial port</term><listitem><para>The <acronym>BIOS</acronym> takes the interrupt 0x10
     entvideoent requests used to write to the screen and
     sends the characters that would have appeared on the screen to
     the serial port.  Characters recieved from the serial port are
     used to supply characters to <acronym>BIOS</acronym> interrupt
     0x16 entread keyent requests.</para><para>Any 16-bit application which uses the
     <acronym>BIOS</acronym> functions for outputing text to the
     screen and reading from the keyboard is redirected to the serial
     port.  This includes the <acronym>BIOS</acronym> itself, the boot
     loader, and 16-bit operating systems (such as
     <productname class="trade"><acronym>MS-DOS</acronym></productname>).</para><para>When a 32-bit operating system (such as <systemitem class="osname" moreinfo="none">Linux</systemitem>, <systemitem class="osname" moreinfo="none">BSD</systemitem> or <systemitem class="osname" moreinfo="none">Windows NT/2000/XP</systemitem>) loads the 16-bit
     <acronym>BIOS</acronym> is no longer accessible and the
     <acronym>BIOS</acronym> can no longer be used for input and
     output.  The 32-bit operating system loads its own device drivers
     for this purpose.  These device drivers then need to provide the
     redirection of console <acronym>I/O</acronym> to the serial
     port.</para><para>If your <acronym>BIOS</acronym> uses this technique then
     you should:</para><procedure><step performance="required"><para>Configure the <acronym>BIOS</acronym> to redirect
       keyboard input and video output to the serial port.</para></step><step performance="required"><para>Do not configure the boot loader, as the
       <acronym>BIOS</acronym> will redirect this 16-bit application's
       input and output to the serial port.</para></step><step performance="required"><para>Configure <systemitem class="osname" moreinfo="none">Linux</systemitem>
       to use the serial port as a console, as <systemitem class="osname" moreinfo="none">Linux</systemitem> is a 32-bit operating
       system.</para></step></procedure></listitem></varlistentry><varlistentry><term><acronym>BIOS</acronym> configuration and power on self-test
    uses the serial port</term><listitem><para>These <acronym>BIOS</acronym>s use the serial port for
     configuration and the power-on self-test, but do not redirect the
     interrupt 0x10 entvideoent requests interrupt 0x16
     entread keyent requests to the serial port.</para><para>Some <acronym>BIOS</acronym>s which usually redirect all
     keyboard and video output to the serial port can be configured in
     only to redirect <acronym>BIOS</acronym> input and output.  Look
     for a <acronym>BIOS</acronym> configuration option similar to
     <guimenuitem moreinfo="none">Cease redirection after boot</guimenuitem>.</para><para>If your <acronym>BIOS</acronym> uses this technique or you
     choose to set <guimenuitem moreinfo="none">Cease redirection after
     boot</guimenuitem> then you should:</para><procedure><step performance="required"><para>Configure the <acronym>BIOS</acronym> to send its output
       to the serial port.</para></step><step performance="required"><para>Configure the boot loader to use the serial port.</para></step><step performance="required"><para>Configure <systemitem class="osname" moreinfo="none">Linux</systemitem>
       to use the serila port as the console, as <systemitem class="osname" moreinfo="none">Linux</systemitem> is a 32-bit operating
       system.</para></step></procedure></listitem></varlistentry><varlistentry><term>Redirection of graphical <acronym>VGA</acronym> output to
    the serial port</term><listitem><para>Some graphical 32-bit operating systems do not provide
     their own facilities to send console output to the serial port.
     Some BIOSs attempt to overcome this shortcoming, using a
     propietary serial protocol to send graphical output to a remote
     serial client.</para><para>As these machines cannot be connected to from a standard
     terminal emulator this facility is best left unconfigured when
     using the <systemitem class="osname" moreinfo="none">Linux</systemitem> operating
     system.</para><procedure><step performance="required"><para>Configure the <acronym>BIOS</acronym> not to send output
       to the serial port.</para></step><step performance="required"><para>Configure the boot loader to use the serial port.</para></step><step performance="required"><para>Configure <systemitem class="osname" moreinfo="none">Linux</systemitem>
       to use the serial port as the console.</para></step></procedure></listitem></varlistentry><varlistentry><term>No serial port facilities</term><listitem><para>The <acronym>BIOS</acronym> cannot be accessed from the
     serial port, so power-on self-test messages cannot be
     seen.</para><para>Note that <acronym>BIOS</acronym> may still be able to be
     configured remotely using the <filename class="devicefile" moreinfo="none">/dev/nvram</filename> device.  This takes some
     care.</para><procedure><step performance="required"><para>Configure the boot loader to use the serial port.</para></step><step performance="required"><para>Configure <systemitem class="osname" moreinfo="none">Linux</systemitem>
       to use the serial port as the console.</para></step></procedure></listitem></varlistentry></variablelist><para>If you need to configure the boot loader to use the serial
  port then continue to <xref linkend="configure-boot-loader"></xref>.
  Otherwise go directly to <xref linkend="configure-kernel"></xref> to
  configure the kernel; this is done by configuring the boot loader to
  pass boot parameters to the <systemitem class="osname" moreinfo="none">Linux</systemitem> kernel.</para></chapter><chapter id="configure-boot-loader"><title>Configure the boot loader</title><para>When a PC boots the CPU it runs code from Read-Only Memory.
  This code is the Basic Input/Output System, or
  <acronym>BIOS</acronym>.  The <acronym>BIOS</acronym> then loads a
  boot loader from the Master Boot Record of the first hard
  disk.<footnote><para>As usual with <productname class="trade"><acronym>IBM
    PC/AT</acronym></productname> hardware entloads a boot loader
    from the <acronym>MBR</acronym> of the first hard diskent is a
    simplification.  <acronym>BIOS</acronym> settings permitting, the
    <acronym>MBR</acronym> can be loaded from the first two detected
    hard disks of any controller card containing a
    <acronym>BIOS</acronym> extension.  Thus the
    <acronym>MBR</acronym> can be loaded from one of the first two
    detected <acronym>IDE</acronym> disks and one of the first two
    detected <acronym>SCSI</acronym> disks.</para></footnote>

  In turn, the boot loader reads the operating system into memory and
  then runs it.<footnote><para>Another simplification.  A 512 byte <acronym>MBR</acronym>
    is too small to contain a program big enough to load a complex
    operating system.  Thus most boot loaders have two stages, the
    first stage is located in the <acronym>MBR</acronym> and is only
    able to load the second stage of the boot loader from somewhere on
    a disk (such as the boot sector of the first partition).  The
    second stage of the boot loader presents the user interface and
    loads the operating system.</para></footnote></para><para>Neither the <acronym>BIOS</acronym> nor the boot loader are
  strictly necessary.  For example, there are <ulink url="http://www.acl.lanl.gov/linuxbios/">versions of Linux</ulink>
  that run directly from the flash memory which usually contains the
  <acronym>BIOS</acronym>.  Linux was originally designed to run
  without an interactive boot loader, by placing the kernel at
  particular sectors of the disk.</para><para>The benefits of using a boot loader are:</para><itemizedlist><listitem><para>Multiple operating systems can be booted.  See the <ulink url="http://www.tldp.org/HOWTO/Linux+Windows-HOWTO/"><citetitle><systemitem class="osname" moreinfo="none">Linux</systemitem> + <systemitem class="osname" moreinfo="none">Windows</systemitem> HOWTO</citetitle></ulink> for
    more information.</para></listitem><listitem><para>Parameters can be passed to the kernel interactively.  This
    is useful for solving hardware problems; for example, some
    interrupt lines can be disabled, direct memory access to some
    drives can be disabled, and so on.  See the <ulink url="http://www.tldp.org/HOWTO/BootPrompt-HOWTO.html"><citetitle><systemitem class="osname" moreinfo="none">Linux</systemitem>
    BootPrompt-HOWTO</citetitle></ulink> for a list of kernel
    parameters.</para></listitem><listitem><para>Differing kernels can be interactively loaded. This is
    useful when deploying a new kernel, as it provides simple fallback
    to a proven kernel.</para></listitem></itemizedlist><para>For these reasons systems administrators want to be able to
  interactively control the boot loader from the serial
  console.</para><para><application moreinfo="none">LILO</application>,
  <application moreinfo="none">GRUB</application> and
  <application moreinfo="none">SYSLINUX</application> are popular boot loaders for
  <productname class="trade"><acronym>IBM</acronym>
  <acronym>PC</acronym>s</productname>.  Find which of these boot
  loaders your <systemitem class="osname" moreinfo="none">Linux</systemitem>
  installation uses and then follow the instructions for your boot
  loader in the following section.</para><section id="configure-boot-loader-lilo"><title>Configure the <application moreinfo="none">LILO</application> boot
   loader</title><para><application moreinfo="none">LILO</application> is the Linux Boot Loader used
   on Intel machines.  Other boot loaders for Intel machines exist,
   common alternatives are <application moreinfo="none">GRUB</application> and
   <application moreinfo="none">SYSLINUX</application>.  Equivalents to
   <application moreinfo="none">LILO</application> exist for other processor
   architectures, their names are usually some play upon
   entLILOent.</para><para><application moreinfo="none">LILO</application> is documented in the
   <citetitle>lilo(8)</citetitle> and
   <citetitle>lilo.conf(5)</citetitle> manual pages; the
   <citetitle><application moreinfo="none">LILO</application> Generic boot loader for
   Linux ent User's Guide</citetitle> found in the file
   <filename moreinfo="none">/usr/share/doc/liloent/doc/User_Guide.ps</filename>;
   and the <ulink url="http://www.tldp.org/HOWTO/mini/LILO.html"><citetitle>LILO
   mini-HOWTO</citetitle></ulink>.</para><para>The <application moreinfo="none">LILO</application> configuration is kept in
   the file <filename moreinfo="none">/etc/lilo.conf</filename>.  The first part of
   the file applies to all images.  The following parts are
   <literal moreinfo="none">image</literal> descriptions for each kernel.</para><para>Set <application moreinfo="none">LILO</application> to use the serial port.
   The syntax of the serial line parameters follows that used by the
   kernel.</para><figure float="0" id="configure-boot-loader-lilo-syntax"><title>Syntax of <productname class="trade">LILO</productname>
    <command moreinfo="none">serial</command> command, in
    <acronym>EBNF</acronym></title><literallayout format="linespecific" linenumbering="unnumbered" class="normal">serial=<replaceable>entserial_portent</replaceable>[,<replaceable>entspeedent</replaceable>[<replaceable>entparityent</replaceable>[<replaceable>entdataent</replaceable>]]]</literallayout></figure><para>Where the variables are the same as used by the kernel (shown
   in <xref linkend="preparation-setspeed-modesyntax"></xref>) and:</para><figure float="0" id="configure-boot-loader-lilo-ebnf"><title><productname class="trade">LILO</productname> <command moreinfo="none">serial</command>
    <acronym>EBNF</acronym> variables</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entserial_portent</replaceable> ::= <literal moreinfo="none">0</literal> | <literal moreinfo="none">1</literal>| ent | <literal moreinfo="none">3</literal></literallayout></figure><para>Our examples use <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename>, which
   <application moreinfo="none">LILO</application> knows as port
   <literal moreinfo="none">0</literal>.</para><figure float="0" id="configure-boot-loader-lilo-configuration"><title><application moreinfo="none">LILO</application> boot loader sample configuration</title><programlisting format="linespecific">serial=0,9600n8
timeout=100
restricted
password=<replaceable>PASSWORD</replaceable></programlisting></figure><para>The parameters <literal moreinfo="none">restricted</literal> and
   <literal moreinfo="none">password</literal> are used to avoid someone dialing in,
   booting the machine, and stepping around the Linux access
   permissions by typing:</para><example id="configure-boot-loader-lilo-hack"><title>Using kernel parameters to avoid access permissions</title><screen format="linespecific"><prompt moreinfo="none">LILO:</prompt> <command moreinfo="none">linux init=/sbin/sash</command></screen></example><para>The password should be good, as it can be used to gain
   <systemitem class="username" moreinfo="none">root</systemitem> access.  The
   <application moreinfo="none">LILO</application> password is stored in plain text in
   the configuration file, so it should never be the same as any other
   password.  The permissions on the configuration file should be set
   so that only <systemitem class="username" moreinfo="none">root</systemitem> can
   read <filename moreinfo="none">/etc/lilo.conf</filename>.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">chmod u=rw,go= /etc/lilo.conf</command></screen></informalfigure><para><application moreinfo="none">LILO</application> has an option to display a
   boot message.  This does not work with serial consoles.  Remove any
   lines like:</para><informalfigure float="0" id="configure-boot-loader-lilo-remove-message"><programlisting format="linespecific">message=/boot/message</programlisting></informalfigure><para><application moreinfo="none">LILO</application> is now configured to use the
   serial console.  The kernels booted from
   <application moreinfo="none">LILO</application> are yet to be configured to use the
   serial console.</para></section><section id="configure-boot-loader-grub"><title>Configure the <application moreinfo="none">GRUB</application> boot
   loader</title><para><application moreinfo="none">GRUB</application> is a boot loader designed to
   boot a wide range of operating systems from a wide range of
   filesystems.  <application moreinfo="none">GRUB</application> is becoming popular
   due to the increasing number of possible root filesystems that can
   Linux can reside upon.</para><para><application moreinfo="none">GRUB</application> is documented in a
   <abbrev>GNU</abbrev> info file.  Type <command moreinfo="none">info grub</command>
   to view the documentation.</para><para>The <application moreinfo="none">GRUB</application> configuration file is
   <filename moreinfo="none">/boot/grub/menu.lst</filename>. Some distributions use
   another configuration file; for example, <productname class="trade">Red Hat
   Linux</productname> uses the file
   <filename moreinfo="none">/boot/grub/grub.conf</filename>.</para><para><application moreinfo="none">GRUB</application> configuration files are
   interpreted.  Syntax errors will not be detected until the machine
   is rebooted, so take care not to make typing errors.</para><para>Edit the <application moreinfo="none">GRUB</application> configuration file
   and remove any <command moreinfo="none">splashimage</command> entries.  If these
   entries are not removed <application moreinfo="none">GRUB</application> 0.90
   behaves very oddly, transferring control between the serial console
   and the attached monitor and keyboard.</para><para>If there is not already a <command moreinfo="none">password</command> command
   in the <application moreinfo="none">GRUB</application> configuration file then
   create a hashed password, see <xref linkend="configure-boot-loader-grub-md5"></xref>.  The password should be
   good, as it can be used to gain <systemitem class="username" moreinfo="none">root</systemitem> access.</para><figure float="0" id="configure-boot-loader-grub-md5"><title>Using <command moreinfo="none">md5crypt</command> to create a hashed
    password for <application moreinfo="none">GRUB</application> </title><screen format="linespecific"><prompt moreinfo="none">grubent</prompt> <command moreinfo="none">md5crypt</command>
<prompt moreinfo="none">Password</prompt>: <userinput moreinfo="none">**********</userinput>
<computeroutput moreinfo="none">Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb.</computeroutput></screen></figure><para>Use that hashed password in the
   <application moreinfo="none">GRUB</application> configuration file, this is shown
   in <xref linkend="configure-boot-loader-grub-password"></xref>.</para><figure float="0" id="configure-boot-loader-grub-password"><title><application moreinfo="none">GRUB</application> configuration to require a
    password</title><programlisting format="linespecific">password ententmd5 $1$U$JK7xFegdxWH6VuppCUSIb.</programlisting></figure><para>Define the serial port and configure
   <application moreinfo="none">GRUB</application> to use the serial port, as shown in
   <xref linkend="configure-boot-loader-grub-serial"></xref>.</para><figure float="0" id="configure-boot-loader-grub-serial"><title><application moreinfo="none">GRUB</application> configuration for serial
    console</title><programlisting format="linespecific">serial ententunit=0 ententspeed=9600 ententword=8 ententparity=no ententstop=1
terminal serial</programlisting></figure><para><literal moreinfo="none">ententunit</literal> is the number of the
   serial port, counting from zero, unit 0 being
   <literal moreinfo="none">COM1</literal>.</para><para>Note that the values of
   <literal moreinfo="none">ententparity</literal> are spelt out in full:
   <literal moreinfo="none">no</literal>, <literal moreinfo="none">even</literal> and
   <literal moreinfo="none">odd</literal>.  The common abbreviations
   <literal moreinfo="none">n</literal>, <literal moreinfo="none">e</literal> and <literal moreinfo="none">o</literal>
   are <emphasis>not</emphasis> accepted.</para><para>If there is mysteriously no output on the serial port then
   suspect a syntax error in the <command moreinfo="none">serial</command> or
   <command moreinfo="none">terminal</command> commands.</para><para>If you also want to use and attached monitor and keyboard as
   well as the serial port to control the
   <application moreinfo="none">GRUB</application> boot loader then use the
   alternative configuration in <xref linkend="configure-boot-loader-grub-serialconsole"></xref>.</para><figure float="0" id="configure-boot-loader-grub-serialconsole"><title><application moreinfo="none">GRUB</application> configuration for serial
    console and attached monitor and keybaord console</title><programlisting format="linespecific">password ententmd5 $1$U$JK7xFegdxWH6VuppCUSIb.
serial ententunit=0 ententspeed=9600 ententword=8 ententparity=no ententstop=1
terminal ententtimeout=10 serial console</programlisting></figure><para>When both the serial port and the attached monitor and
   keyboard are configured they will both ask for a key to be pressed
   until the timeout expires.  If a key is pressed then the boot menu
   is displayed to that device.  Disconcertingly, the other device
   sees nothing.</para><para>If no key is pressed then the boot menu is displayed on the
   whichever of <literal moreinfo="none">serial</literal> or
   <literal moreinfo="none">console</literal> is listed first in the
   <command moreinfo="none">terminal</command> command.  After the timeout set by the
   <command moreinfo="none">timeout</command> the default option set by
   <command moreinfo="none">default</command> is booted.</para><figure float="0" id="configure-boot-loader-grub-press"><title>GRUB output to default device when configured for serial
    and attached monior output</title><screen format="linespecific"><computeroutput moreinfo="none">Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.
Press any key to continue.

    GRUB  version 0.90  (639K lower / 162752K upper memory)

 +-------------------------------------------------------------------------+
 | [ Red Hat Linux (2.4.9-21)   ]                                          |  
 |                                                                         |
 |                                                                         |
 +-------------------------------------------------------------------------+
      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS or 'p' to enter a
      password to unlock the next set of features.

   The highlighted entry will be booted automatically in 10 seconds.</computeroutput></screen></figure><para>If you are not using a <acronym>VT100</acronym> terminal then
   the cursor keys may not work to select a
   <application moreinfo="none">GRUB</application> menu item.  The instructions shown
   in <xref linkend="configure-boot-loader-grub-press"></xref> are literally
   correct: <guilabel moreinfo="none">Use the ^ and v keys</guilabel> means that the
   caret key
   (<keycombo moreinfo="none"><keycap moreinfo="none">Shift</keycap><keycap moreinfo="none">6</keycap></keycombo>)
   moves the cursor up and letter vee key (<keycap moreinfo="none">V</keycap>) moves
   the cursor down.</para><para>Note when configuring <application moreinfo="none">GRUB</application> that
   there are two timeouts involved.  <computeroutput moreinfo="none">Press any key to
   continue</computeroutput> is printed for <command moreinfo="none">terminal
   --timeout=10</command> seconds, waiting for someone on the keyboard
   or terminal to press a key to get the input focus.  Then the menu
   is displayed for <command moreinfo="none">timeout 10</command> seconds before the
   default boot option is taken.</para><para>If the terminal attached to the serial port is not a real or
   emulated <productname class="trade">VT100</productname>, then force
   <application moreinfo="none">GRUB</application> to use it's command line interface.
   This interface is much more difficult to use than
   <application moreinfo="none">GRUB</application>'s menu interface; however, the
   command line interface does not assume the
   <productname class="trade">VT100</productname>'s terminal language.</para><figure float="0" id="configure-boot-loader-grub-dumb"><title><application moreinfo="none">GRUB</application> configuration for command
    line interface for terminals other than
    <productname class="trade">VT100</productname></title><programlisting format="linespecific">terminal ententtimeout=10 ententdumb serial console</programlisting></figure><para>This <citetitle>HOWTO</citetitle> does not discuss the use of
   <application moreinfo="none">GRUB</application>'s command line.  It is far too
   complex and error-prone to recommend for use on production
   machines.  Wizards will know to consult
   <application moreinfo="none">GRUB</application>'s <application moreinfo="none">info</application>
   manual for the commands required to boot the kernel.</para><para><application moreinfo="none">GRUB</application>'s menu's can be edited
   interactively after <keycap moreinfo="none">P</keycap> is pressed and the password
   supplied.  A better approach is to add menu items to boot the
   machine into alternative run levels.  A sample configuration
   showing a menu entry for the default run level and an alternative
   menu entry for single user mode (run level
   <wordasword>s</wordasword>) is shown in <xref linkend="configure-boot-loader-grub-runlevel"></xref>.  Remember to use
   the <command moreinfo="none">lock</command> command to require a password for
   single user mode, as single user mode does not ask for a
   <systemitem class="osname" moreinfo="none">Linux</systemitem> password.</para><figure float="0" id="configure-boot-loader-grub-runlevel"><title>Adding a single user mode option to the
    <application moreinfo="none">GRUB</application> menu</title><programlisting format="linespecific">password ententmd5 $1$U$JK7xFegdxWH6VuppCUSIb.
default 0
title Red Hat Linux (2.4.9-21)
        root (hd0,0)
        kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6
        initrd /initrd-2.4.9-21.img
title Red Hat Linux (2.4.9-21) single user mode
        lock
        root (hd0,0)
        kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 s
        initrd /initrd-2.4.9-21.img</programlisting></figure><para>File names in the <command moreinfo="none">kernel</command> and
   <command moreinfo="none">initrd</command> commands are relative to the
   <application moreinfo="none">GRUB</application> installation directory, which is
   usually <filename class="directory" moreinfo="none">/boot/grub</filename>.  So
   <filename moreinfo="none">/vmlinuz-2.4.9-21</filename> is actually the file
   <filename moreinfo="none">/boot/grub/vmlinuz-2.4.9-21</filename>.</para><para><application moreinfo="none">GRUB</application> is now configured to use the
   serial console.  The kernels booted from
   <application moreinfo="none">GRUB</application> are yet to be configured to use the
   serial console.</para></section><section id="configure-boot-loader-syslinux"><title>Configure the <application moreinfo="none">SYSLINUX</application> boot
   loader</title><para><ulink url="http://syslinux.zytor.com/"><productname class="trade"><application moreinfo="none">SYSLINUX</application></productname></ulink>
   is a boot loader that is installed on a MS-DOS floppy disk.  As
   directed by it's configuration file
   <filename moreinfo="none">\SYSLINUX.CFG</filename> it will load one of the files
   from the floppy disk as a Linux kernel.</para><para><application moreinfo="none">SYSLINUX</application> presents a simple text
   interface that can be used to select between canned configurations
   defined in the configuration file and can be used to add parameters
   to the kernel.</para><para><application moreinfo="none">ISOLINUX</application> and
   <application moreinfo="none">PXELINUX</application> are variants of
   <application moreinfo="none">SYSLINUX</application> for CD-ROMs and Intel's <ulink url="http://developer.intel.com/ial/wfm/"><productname class="trade">Preboot
   Execution Environment</productname></ulink>.</para><para><application moreinfo="none">SYSLINUX</application> supports a variety of
   serial port speeds, but it only supports eight data bits, no parity
   and one stop bit.  <application moreinfo="none">SYSLINUX</application> supports the
   serial ports <filename class="devicefile" moreinfo="none">COM1:</filename> through
   to <filename class="devicefile" moreinfo="none">COM4:</filename>, as with most boot
   loaders these are written as port <literal moreinfo="none">0</literal> through to
   port <literal moreinfo="none">3</literal>.</para><para>For <application moreinfo="none">SYSLINUX</application> to support a serial
   console add a new <emphasis>first line</emphasis> to
   <filename moreinfo="none">\SYSLINUX.CFG</filename>:</para><figure float="0" id="configure-boot-loader-syslinux-serial-syntax"><title>Syntax of <productname class="trade">SYSLINUX</productname>
    <command moreinfo="none">serial</command> command, in
    <acronym>EBNF</acronym></title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><literal moreinfo="none">serial</literal> <replaceable>entspaceent</replaceable> <replaceable>entserial_portent</replaceable> [ <replaceable>entspaceent</replaceable> <replaceable>entspeedent</replaceable> [ <replaceable>entspaceent</replaceable> <replaceable>entsyslinux_flow_controlent</replaceable> ] ]</literallayout></figure><para>The variables are the same as used by syntax descriptions in
   <xref linkend="preparation-setspeed-modesyntax"></xref> and <xref linkend="configure-boot-loader-lilo-ebnf"></xref> plus those in <xref linkend="configure-boot-loader-syslinux-ebnf"></xref>.</para><figure float="0" id="configure-boot-loader-syslinux-ebnf"><title><productname class="trade">SYSLINUX</productname>
    <command moreinfo="none">serial</command> <acronym>EBNF</acronym> variables</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entspaceent</replaceable> ::= ent<literal moreinfo="none"> </literal>ent
<replaceable>entsyslinux_flow_controlent</replaceable> ::= <replaceable>enthex_digitsent</replaceable>
<replaceable>enthex_digitsent</replaceable> ::= <literal moreinfo="none">0x</literal><replaceable>enthex_digitent</replaceable><replaceable>enthex_digitent</replaceable><replaceable>enthex_digitent</replaceable>
<replaceable>enthex_digitent</replaceable> ::= <literal moreinfo="none">0</literal> | <literal moreinfo="none">1</literal> | ent | <literal moreinfo="none">9</literal> | <literal moreinfo="none">a</literal> | <literal moreinfo="none">b</literal> | ent | <literal moreinfo="none">f</literal></literallayout></figure><para>The <replaceable>entsyslinux_flow_controlent</replaceable>
   variable controlling the <acronym>RS-232</acronym> status and flow
   control signals is optional.  If your null-modem cable does not
   present any status or handshaking signals then do not use it.  The
   value of <replaceable>entsyslinux_flow_controlent</replaceable>
   is calculated by adding the hexadecimal values for the desired flow
   control behaviours listed in <xref linkend="configure-boot-loader-syslinux-flowcontrol"></xref>.</para><para>The behaviours for a correctly-wired null-modem cable or a
   correctly configured modem are marked entRequired for full
   <acronym>RS-232</acronym> complianceent in the table.  The sum
   of these values is <literal moreinfo="none">0xab3</literal>.</para><table frame="topbot" colsep="0" rowsep="0" id="configure-boot-loader-syslinux-flowcontrol"><title><productname class="trade">SYSLINUX</productname> flow control
    bitmap</title><tgroup cols="3" align="center"><thead valign="bottom"><row rowsep="1"><entry><para>Flow control behaviour</para></entry><entry><para>Hex value</para></entry><entry><para>Required for full <acronym>RS-232</acronym>
       compliance?</para></entry></row></thead><tbody><row><entry align="left"><para>Assert DTR</para></entry><entry><para>0x001</para></entry><entry><para>Yes</para></entry></row><row><entry align="left"><para>Assert RTS</para></entry><entry><para>0x002</para></entry><entry><para>Yes</para></entry></row><row><entry align="left"><para>Wait for CTS assertion</para></entry><entry><para>0x010</para></entry><entry><para>Yes</para></entry></row><row><entry align="left"><para>Wait for DSR assertion</para></entry><entry><para>0x020</para></entry><entry><para>Yes</para></entry></row><row><entry align="left"><para>Wait for RI assertion</para></entry><entry><para>0x040</para></entry><entry><para>No</para></entry></row><row><entry align="left"><para>Wait for DCD assertion</para></entry><entry><para>0x080</para></entry><entry><para>Yes</para></entry></row><row><entry align="left"><para>Ignore input unless CTS asserted</para></entry><entry><para>0x100</para></entry><entry><para>No</para></entry></row><row><entry align="left"><para>Ignore input unless DSR asserted</para></entry><entry><para>0x200</para></entry><entry><para>Yes</para></entry></row><row><entry align="left"><para>Ignore input unless RI asserted</para></entry><entry><para>0x400</para></entry><entry><para>No</para></entry></row><row><entry align="left"><para>Ignore input unless DCD asserted</para></entry><entry><para>0x800</para></entry><entry><para>Yes</para></entry></row></tbody></tgroup></table><para>Our preferred configuration of 9600<abbrev>bps</abbrev>,
   port <literal moreinfo="none">0</literal>, full <acronym>RS-232</acronym> status
   signals and <acronym>CTS</acronym>/<acronym>RTS</acronym> flow
   control is written as:</para><informalexample><programlisting format="linespecific">serial 0 9600 0xab3</programlisting></informalexample><tip id="tip-syslinux-flowcontrol"><para>When using this configuration <acronym>SYSLINUX</acronym>
    will not display anything and will not accept any typed character
    until the <acronym>RS-232</acronym> status signals show a
    connected modem call (or a connected terminal if you are using a
    null-modem cable).</para></tip><para>If you have a null modem cable with no RS-232 status signals
   and no flow control then use:</para><informalexample><programlisting format="linespecific">serial 0 9600</programlisting></informalexample><para>Remember that the <command moreinfo="none">serial</command> command must be
   the first line in <filename moreinfo="none">\SYSLINUX.CFG</filename>.</para></section></chapter><chapter id="configure-kernel"><title>Configure <systemitem class="osname" moreinfo="none">Linux</systemitem>
  kernel</title><para>The <systemitem class="osname" moreinfo="none">Linux</systemitem> kernel is
  configured to select the console by passing it the
  <literal moreinfo="none">console</literal> parameter.  The
  <literal moreinfo="none">console</literal> parameter can be given repeatedly, but
  the parameter can only be given once for each console technology.
  So <literal moreinfo="none">console=tty0 console=lp0 console=ttyS0</literal> is
  acceptable but <literal moreinfo="none">console=ttyS0 console=ttyS1</literal> will
  not work.</para><para>When multiple consoles are listed output is sent to all
  consoles and input is taken from the last listed console.  The last
  <literal moreinfo="none">console</literal> is the one Linux uses as the <filename class="devicefile" moreinfo="none">/dev/console</filename> device.</para><para>The syntax of the <literal moreinfo="none">console</literal> parameter is
  given in <xref linkend="configure-kernel-syntax"></xref>.</para><figure float="0" id="configure-kernel-syntax"><title>Kernel <literal moreinfo="none">console</literal> syntax, in EBNF</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><literal moreinfo="none">console=ttyS</literal><replaceable>entserial_portent</replaceable>[<literal moreinfo="none">,</literal><replaceable>entmodeent</replaceable>]
<literal moreinfo="none">console=tty</literal><replaceable>entvirtual_terminalent</replaceable>
<literal moreinfo="none">console=lp</literal><replaceable>entparallel_portent</replaceable>
<literal moreinfo="none">console=ttyUSB</literal>[<replaceable>entusb_portent</replaceable>[<literal moreinfo="none">,</literal><replaceable>entmodeent</replaceable>]</literallayout></figure><para><replaceable>entserial_portent</replaceable> is the number
  of the serial port.  This is defined in <xref linkend="configure-boot-loader-lilo-ebnf"></xref> and discussed in <xref linkend="preparation-setport"></xref>.  The examples in this
  <citetitle>HOWTO</citetitle> use the first serial port, giving
  <replaceable>entserial_portent</replaceable> the value
  <literal moreinfo="none">0</literal>, which in turn gives kernel parameter
  <literal moreinfo="none">console=ttyS0</literal>.</para><para>If you are using the <application moreinfo="none">devfs</application> device
  filesystem with your Linux installation the kernel parameter for the
  first serial port is still <literal moreinfo="none">ttyS0</literal>, even though the
  first serial device is no longer known as <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename> but as <filename class="devicefile" moreinfo="none">/dev/ttys/0</filename>.</para><para><replaceable>entmodeent</replaceable> is defined in <xref linkend="preparation-setspeed-modesyntax"></xref> and is discussed in <xref linkend="preparation-setspeed"></xref>.  The examples in this
  <citetitle>HOWTO</citetitle> use 9600 bits per second, one start
  bit, eight data bits, no parity, one stop bit, and no
  <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control giving
  <replaceable>entmodeent</replaceable> the value of
  <literal moreinfo="none">9600n8</literal>.  When the current kernel flow control
  bugs are corrected this <citetitle>HOWTO</citetitle> will once again
  recommend the value <literal moreinfo="none">9600n8r</literal>.</para><para><replaceable>entusb_portent</replaceable> can specify the
  address of a <acronym>USB</acronym> dongle containing a serial port
  to be used as a serial console.<footnote><para>A serial console attached to a <acronym>USB</acronym> dongle
    is only available in Linux kernel version 2.5.7 and later.  The
    2.5 series of kernels are developer's kernels and are not ready
    for production use.</para></footnote>

  For example, the serial port <literal moreinfo="none">console=ttyS0,9600n8</literal>
  when moved to a <acronym>USB</acronym> serial dongle would be
  written as <literal moreinfo="none">console=ttyUSB0,9600n8</literal>. The
  <acronym>USB</acronym> subsystem is started rather late in the boot
  process, console messages printed during boot before the
  <acronym>USB</acronym> subsystem is loaded will be lost.</para><para>With no <literal moreinfo="none">console</literal> parameter the kernel will
  use the first virtual terminal, which is <filename class="devicefile" moreinfo="none">/dev/tty0</filename>.  A user at the keyboard
  uses this virtual terminal by pressing
  <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">F1</keycap></keycombo>.</para><para>If your computer contains a video card then we suggest that
  you also configure it as a console.  This is done with the kernel
  parameter <literal moreinfo="none">console=tty0</literal>.</para><para>For computers with both a video card and a serial console in
  the port marked ent<acronym>COM1:</acronym>ent this
  <citetitle>HOWTO</citetitle> suggests the kernel parameters:</para><figure float="0" id="configure-kernel-parameters-video"><title>Recommended kernel parameters, <acronym>PC</acronym>s with
   video card</title><programlisting format="linespecific">console=tty0 console=ttyS0,9600n8</programlisting></figure><para>Kernel messages will appear on both the first virtual terminal
  and the serial port.  Messages from the
  <application moreinfo="none">init</application> system and the system logger will
  appear only on the first serial port.  This can be slightly
  confusing when looking at the attached monitor: the machine will
  appear to boot and then hang.  Don't panic, the
  <application moreinfo="none">init</application> system has started but is now
  printing messages to the serial port but is printing nothing to the
  screen.  If a <application moreinfo="none">getty</application> has been configured
  then a <computeroutput moreinfo="none">login:</computeroutput> prompt will
  eventually appear on the attached monitor.</para><para>For <acronym>PC</acronym>s without a video card, this
  <citetitle>HOWTO</citetitle> suggests the kernel parameters:</para><figure float="0" id="configure-kernel-parameters-novideo"><title>Recommended kernel parameters, <acronym>PC</acronym>s
   without video card</title><programlisting format="linespecific">console=ttyS0,9600n8</programlisting></figure><para>These parameters are passed to the booting kernel by the boot
  loader.  Next we will configure the boot loader used by your
  <systemitem class="osname" moreinfo="none">Linux</systemitem> installation to pass
  the <literal moreinfo="none">console</literal> parameters to the kernel.</para><section id="configure-kernel-lilo"><title>Configure Linux kernel using
   <application moreinfo="none">LILO</application></title><para>For each <literal moreinfo="none">image</literal> entry in
   <filename moreinfo="none">/etc/lilo.conf</filename> add the line:</para><figure float="0" id="configure-kernel-lilo-parameters"><title>Recommended kernel parameters, <application moreinfo="none">LILO</application> configuration</title><programlisting format="linespecific">append=entconsole=tty0 console=ttyS0,9600n8ent</programlisting></figure><para>Sometimes the <literal moreinfo="none">append</literal> line will already
   exist.  For example</para><informalexample id="configure-kernel-lilo-append-exists"><programlisting format="linespecific">append=entmem=1024Ment</programlisting></informalexample><para>In this case, the existing <literal moreinfo="none">append</literal> line is
   modified to pass all the parameters.  The result is:</para><informalexample id="configure-kernel-lilo-append-merge"><programlisting format="linespecific">append=entmem=1024M console=tty0 console=ttyS0,9600n8ent</programlisting></informalexample><para>As a complete example, a typical
   <filename moreinfo="none">/etc/lilo.conf</filename> configuration from
   <productname class="trade">Red Hat Linux</productname>
   <productnumber>7.1</productnumber> is:</para><example id="configure-kernel-lilo-rhl-vendor"><title>Complete <application moreinfo="none">LILO</application> configuration, as
   installed by vendor</title><programlisting format="linespecific">boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
default=linux

image=/boot/vmlinuz-2.4.2-2
  label=linux
  read-only
  root=/dev/hda6
  initrd=/boot/initrd-2.4.2-2.img</programlisting></example><para>This is modified to</para><example id="configure-kernel-lilo-rhl-serial"><title>Complete <application moreinfo="none">LILO</application> configuration, modified for serial console</title><programlisting format="linespecific">boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
default=linux
# Changes for serial console on COM1: in global section
#   Deleted: message=/boot/message
serial=0,9600n8
timeout=100
restricted
password=de7mGPe3i8

image=/boot/vmlinuz-2.4.2-2
  label=linux
  read-only
  root=/dev/hda6
  initrd=/boot/initrd-2.4.2-2.img
  # Changes for serial console on COM1: in each image section
  append=entconsole=tty0 console=ttyS0,9600n8ent</programlisting></example><para>Now that we have finished configuring
   <application moreinfo="none">LILO</application>, use the <command moreinfo="none">lilo</command>
   command to install the new boot record onto the disk:</para><informalfigure float="0" id="configure-kernel-lilo-install"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">chown root:root /etc/lilo.conf</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">chmod u=rw,g=,o= /etc/lilo.conf</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">lilo</command>
<computeroutput moreinfo="none">Added linux *</computeroutput></screen></informalfigure></section><section id="configure-kernel-grub"><title>Configure Linux kernel using
   <application moreinfo="none">GRUB</application></title><para>Find each <literal moreinfo="none">title</literal> entry in the GRUB
   configuration file.  It will be followed by a
   <literal moreinfo="none">kernel</literal> line.  For example</para><informalfigure float="0" id="configure-kernel-grub-kernel-before"><programlisting format="linespecific">title Red Hat Linux (2.4.9-21)
  root (hd0,0)
  kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6
  initrd /initrd-2.4.9-21.img</programlisting></informalfigure><para>Modify each of the <literal moreinfo="none">kernel</literal> lines to append
   the parameters that inform the kernel to use a serial
   console.</para><figure float="0" id="configure-kernel-grub-kernel-after"><title>Recommened kernel parameters,
    <application moreinfo="none">GRUB</application> configuration</title><programlisting format="linespecific">title Red Hat Linux (2.4.9-21)
  root (hd0,0)
  kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8
  initrd /initrd-2.4.9-21.img</programlisting></figure><para>As a complete example, <xref linkend="configure-kernel-grub-rhl-vendor"></xref> is a typical GRUB
   configuration from <productname class="trade">Red Hat Linux</productname>
   <productnumber>7.2</productnumber>.</para><example id="configure-kernel-grub-rhl-vendor"><title>Complete <application moreinfo="none">GRUB</application> configuration, as
   installed by vendor</title><programlisting format="linespecific">default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
password --md5 $1$wwmIq64O$2vofKBDL9vZKeJyaKwIeT.
title Red Hat Linux (2.4.9-21)
root (hd0,0)
  kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6
  initrd /initrd-2.4.9-21.img</programlisting></example><para>The modified configuration file is shown in <xref linkend="configure-kernel-grub-rhl-serial"></xref>.</para><example id="configure-kernel-grub-rhl-serial"><title>Complete <application moreinfo="none">GRUB</application> configuration,
   modified for serial console</title><programlisting format="linespecific">default=0
timeout=10
password --md5 $1$wwmIq64O$2vofKBDL9vZKeJyaKwIeT.
serial --unit=0 --speed=9600 -word=8 --parity=no --stop=1
terminal --timeout=10 serial console
title Red Hat Linux (2.4.9-21)
  root (hd0,0)
  kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8
  initrd /initrd-2.4.9-21.img
title Red Hat Linux (2.4.9-21) single user mode
  lock
  root (hd0,0)
  kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8 s
  initrd /initrd-2.4.9-21.img</programlisting></example></section><section id="configure-kernel-syslinux"><title>Configure Linux kernel using
   <application moreinfo="none">SYSLINUX</application></title><para>Edit each <literal moreinfo="none">LABEL</literal> entry to add an
   <literal moreinfo="none">APPEND</literal> line containing the serial console
   parameter to pass to the Linux kernel.  Like
   <application moreinfo="none">LILO</application>, if a kernel already has
   parameters, then add our parameters to the list after
   <literal moreinfo="none">APPEND</literal>.</para><para>For example:</para><figure float="0" id="configure-kernel-syslinux-append"><title>Recommended kernel parameters,
    <application moreinfo="none">SYSLINUX</application> configuration</title><programlisting format="linespecific">APPEND console=tty0 console=ttyS0,9600n8</programlisting></figure><para>There are some traps for beginners in the differences between
   <application moreinfo="none">LILO</application> and
   <application moreinfo="none">SYSLINUX</application>.
   <application moreinfo="none">LILO</application> uses <literal moreinfo="none">append=</literal>,
   whereas <application moreinfo="none">SYSLINUX</application> uses just
   <literal moreinfo="none">append</literal>. <command moreinfo="none">lilo</command> needs to be run
   after each change to <filename moreinfo="none">/etc/lilo.conf</filename>, whereas
   <command moreinfo="none">syslinux</command> does not need to be run after changing
   <filename moreinfo="none">\SYSLINUX.CFG</filename>.</para></section></chapter><chapter id="getty"><title>Configure <productname class="trade">getty</productname></title><para><application moreinfo="none">getty</application> monitors serial lines,
  waiting for a connection.  It then configures the serial link, sends
  the contents of <filename moreinfo="none">/etc/issue</filename>, and asks the person
  connecting for their login name.  <application moreinfo="none">getty</application>
  then starts <application moreinfo="none">login</application> and
  <application moreinfo="none">login</application> asks the person for their password.
  If the user does nothing, <application moreinfo="none">getty</application> or
  <application moreinfo="none">login</application> hang up and
  <application moreinfo="none">getty</application> goes back to waiting.</para><para>The <application moreinfo="none">getty</application> command has been
  re-implemented numerous times.  There is a wide selection of
  <application moreinfo="none">getty</application> clones, each with slight
  differences in behavior and syntax.  We will describe the
  traditional <application moreinfo="none">getty</application>, and then some popular
  alternatives.</para><para>One of the jobs of a <application moreinfo="none">getty</application> is to
  set the <varname>TERM</varname> environment variable to indicate the
  make and model of the terminal which is connecting.  In this
  <citetitle>HOWTO</citetitle> we set the terminal to the commonly
  emulated <productname class="trade"><acronym>DEC</acronym>
  <acronym>VT100</acronym></productname>.  If you occassionally
  connect using a different terminal emulation then you can
  interactively change your choice of terminal by setting
  <varname>TERM</varname> to the appropiate terminal listed in
  <filename moreinfo="none">/etc/termcap</filename>.</para><figure float="0" id="getty-term"><title>Interactively altering the connecting terminal's make and
   model</title><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">TERM=kermit</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">tset -r</command></screen></figure><para>A <application moreinfo="none">getty</application> is also responsible for
  setting the time zone when a permanently-connected remote terminal
  is located beyond the machine's default time zone.  The
  <application moreinfo="none">getty</application> overrides the default timezone by
  setting the <envar>TZ</envar> environment variable.  As with the
  <envar>TERM</envar> environment variable, a user connecting from a
  modem can interactively override the default time zone.</para><figure float="0" id="getty-tz"><title>Interactively altering the connecting terminal's time zone</title><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">TZ=Australia/Adelaide</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">export TZ</command></screen></figure><para>If you do not know your time zone name, run the
  <command moreinfo="none">tzselect</command> utility to generate the appropiate
  contents for <envar>TZ</envar>.</para><para>But first, let's see how <application moreinfo="none">getty</application> gets
  started in the first place.</para><section id="getty-init"><title><productname class="trade">init</productname> system</title><para>The file <filename moreinfo="none">/etc/inittab</filename> contains the
   background programs that used to keep the system running.  One of
   these programs is one <application moreinfo="none">getty</application> process per
   serial port.</para><figure float="0" id="getty-init-inittab"><title><application moreinfo="none">getty</application> is started by
    <application moreinfo="none">init</application>, based upon an entry in
    <filename moreinfo="none">/etc/inittab</filename></title><screen format="linespecific">co:2345:respawn:/sbin/getty ttyS0 CON9600 vt102</screen></figure><para>Each field in <filename moreinfo="none">inittab</filename> is separated by a
   colon and contains:</para><variablelist><varlistentry><term><literal moreinfo="none">co</literal></term><listitem><para>Arbitrary entry for <filename moreinfo="none">inittab</filename>.  As long
      as this entry doesn't appear anywhere else in
      <filename moreinfo="none">inittab</filename>, you're okay.  We named this entry
      <literal moreinfo="none">co</literal> because it's for the console.</para><para><productname class="trade">Red Hat Linux</productname>
      <productnumber>7.3</productnumber> has a program called
      <application moreinfo="none">kudzu</application> which configures the system
      when it is booted.  <application moreinfo="none">kudzu</application> treats an
      <filename moreinfo="none">inittab</filename> entry of <literal moreinfo="none">co</literal>
      specially, setting it for the attached monitor and keyboard or
      the serial console.  Hardcoding the value of
      <filename moreinfo="none">co</filename> prevents this behaviour.</para></listitem></varlistentry><varlistentry><term><literal moreinfo="none">2345</literal></term><listitem><para>Run levels where this entry gets started.  Run levels 2,
      3, 4 and 5 can be used for an operational system,
      <application moreinfo="none">getty</application> should not be used in other run
      levels.  The serial console still works in run level 1 (or
      single user mode) even without a
      <application moreinfo="none">getty</application>.</para></listitem></varlistentry><varlistentry><term><literal moreinfo="none">respawn</literal></term><listitem><para>Re-run the program if it dies.  We want this to happen so
      that a new <prompt moreinfo="none">login</prompt> prompt will appear when you
      log out of the console.</para></listitem></varlistentry><varlistentry><term><literal moreinfo="none">/sbin/getty ttyS0 CON9600 vt102</literal></term><listitem><para>The command to run.  In this case, we're telling
      <application moreinfo="none">getty</application> to connect to <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename> using the settings for
      <literal moreinfo="none">CON9600</literal> which exists in
      <filename moreinfo="none">/etc/gettydefs</filename>.  This entry represents a
      terminal running at 9600<abbrev>bps</abbrev>. Initially assume
      that the terminal is a later-model
      <productname class="trade"><acronym>VT100</acronym></productname>.</para></listitem></varlistentry></variablelist><para>After changing <filename moreinfo="none">/etc/inittab</filename> restart
   <application moreinfo="none">init</application> with</para><informalfigure float="0"><screen format="linespecific"><command moreinfo="none">telinit q</command></screen></informalfigure><para>An alternative is to send the hangup signal to
   <application moreinfo="none">init</application> with the command <command moreinfo="none">kill -HUP
   1</command>.  This is not recommended: if you make a typing mistake
   and actually kill <application moreinfo="none">init</application> then your system
   will suddenly halt.</para><note><title>Comments in <filename moreinfo="none">inittab</filename> and Red Hat's
    <application moreinfo="none">kudzu</application></title><para><application moreinfo="none">kudzu</application> uses the
    <literal moreinfo="none">#</literal> line comment to activate and deactivate the
    <application moreinfo="none">getty</application>s for the attached monitor and
    keyboard and for the serial port.  To prevent a genuine comment
    from becoming confused with a line saved by
    <application moreinfo="none">kudzu</application> use <literal moreinfo="none">##</literal> at the
    start of a line of genuine comments.</para></note></section><section id="getty-getty"><title>Traditional <productname class="trade">getty</productname></title><para>Traditional <application moreinfo="none">getty</application> implementations
   include <application moreinfo="none">uugetty</application> and
   <application moreinfo="none">getty_ps</application>.</para><para>The traditional <application moreinfo="none">getty</application> is listed in
   <filename moreinfo="none">/etc/inittab</filename> with the name of a section in
   <filename moreinfo="none">/etc/gettydefs</filename> to use for its configuration.
   Our example in <xref linkend="getty-init-inittab"></xref> used the section
   <literal moreinfo="none">CON9600</literal>.</para><para>There is no <literal moreinfo="none">CON9600</literal> in the standard
   <filename moreinfo="none">gettydefs</filename>.  This is deliberate, as serial
   consoles sometimes require slight tweaking.  Copy the
   <literal moreinfo="none">DT9600</literal> entry and use it as your model.</para><figure float="0" id="getty-getty-gettydefs"><title>Define <literal moreinfo="none">CON9600</literal> in
    <filename moreinfo="none">gettydefs</filename></title><programlisting format="linespecific"># Serial console 9600, 8, N, 1, CTS/RTS flow control
CON9600# B9600 CS8 -PARENB -ISTRIP CRTSCTS HUPCL # B9600 SANE CS8 -PARENB -ISTRIP CRTSCTS HUPCL #@S @L login: #CON9600</programlisting></figure><para>Separate each line with a blank line.</para><para>Each configuration line has the syntax:</para><figure float="0" id="getty-getty-gettydefs-syntax"><title>Syntax of entries in <filename moreinfo="none">/etc/gettydefs</filename>,
    in EBNF</title><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><replaceable>entlabelent</replaceable># <replaceable>entinitial_flagsent</replaceable> # <replaceable>entfinal_flagsent</replaceable> #<replaceable>entlogin_promptent</replaceable>#<replaceable>entnext_labelent</replaceable></literallayout></figure><para>The <replaceable>entlabelent</replaceable> is referred to
   on the <application moreinfo="none">getty</application> command line.</para><para>The <replaceable>entnext_labelent</replaceable> is the
   definition used if a <acronym>RS-232</acronym> Break is sent.  As
   the console is always 9600<abbrev>bps</abbrev>, this points back
   to the original <replaceable>label</replaceable>.  See <xref linkend="security-sysrq"></xref> if you ever intend to have more one line
   for <literal moreinfo="none">CON9600</literal> in
   <filename moreinfo="none">gettydefs</filename>.</para><para><replaceable>entinitial_flagsent</replaceable> are the
   serial line parameters used by <application moreinfo="none">getty</application>.
   These are modeled on the <citetitle>stty(1)</citetitle> and
   <citetitle>termios(3)</citetitle> options and the full list varies
   depending upon your <application moreinfo="none">getty</application> variant.  The
   parameters in <xref linkend="getty-getty-gettydefs"></xref> ensure that a
   line at 9600<abbrev>bps</abbrev> with eight data bits and no
   parity is configured.</para><para><replaceable>entfinal_flagsent</replaceable> are the serial
   line parameters set by <application moreinfo="none">getty</application> before it
   calls login.  You will usually want to set a
   9600<abbrev>bps</abbrev> line, <literal moreinfo="none">SANE</literal> terminal
   handling, eight data bits, no parity and to hang up the modem when
   the login session is finished.</para><para>The <replaceable>entlogin_promptent</replaceable> for
   serial lines is traditionally the name of the machine, followed by
   the serial port, followed by <literal moreinfo="none">login:</literal> and a space.
   The macro that inserts the name of the machine and the serial port
   varies, see the documentation for your
   <application moreinfo="none">getty</application>.</para></section><section id="getty-agetty"><title><productname class="trade">agetty</productname></title><para><application moreinfo="none">agetty</application> is an entalternative
   gettyent.  It takes all of its parameters on the command line,
   with no use of <filename moreinfo="none">/etc/gettydefs</filename> or any other
   configuration file.  <application moreinfo="none">agetty</application> is
   documented in the manual page
   <citetitle>agetty(8)</citetitle>.</para><para><xref linkend="getty-agetty-inittab"></xref> shows how to invoke
   <application moreinfo="none">agetty</application> for use with a serial
   console.</para><figure float="0" id="getty-agetty-inittab"><title><filename moreinfo="none">/etc/inittab</filename> entry for
    <application moreinfo="none">agetty</application></title><programlisting format="linespecific">co:2345:respawn:/sbin/agetty -h -t 60 ttyS0 9600 vt102</programlisting></figure><para><literal moreinfo="none">ttyS0</literal> refers to the serial device
   <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename>.</para><para><literal moreinfo="none">9600</literal> is the bits per second of the serial
   link.  agetty will support multiple values, using the modem's
   <literal moreinfo="none">CONNECT</literal> message or the <acronym>RS-232</acronym>
   Break signal to select between them.  Only use one value, as serial
   consoles only have only one data rate.</para><para><literal moreinfo="none">vt102</literal> sets the <varname>TERM</varname>
   environment variable to indicate that a
   <productname class="trade"><acronym>VT100</acronym></productname> terminal is
   connecting.</para><para><literal moreinfo="none">-h</literal> activates CTS/RTS handshaking.</para><para><literal moreinfo="none">-t 60</literal> allows 60 seconds for someone to
   attempt to log in before the modem is hung up.  You should test
   this feature to ensure that <application moreinfo="none">init</application> is not
   restarting <application moreinfo="none">agetty</application> every 60 seconds when
   the link is idle.  Look for a continually changing process
   identifier for <application moreinfo="none">agetty</application>.</para><para><application moreinfo="none">agetty</application> uses escape sequences in
   <filename moreinfo="none">/etc/issue</filename> to insert information.  For
   example, <literal moreinfo="none">\n.\o \l</literal> will appear as
   <literal moreinfo="none">remote.example.edu.au ttyS0</literal>.</para><para>When you log out <application moreinfo="none">agetty</application> does not
   appear to lower the Data Terminal Ready signal to force the modme
   to hang up.  If having people automatically disconnected at the end
   of their login session matters to you then you might consider
   <application moreinfo="none">mgetty</application> instead.</para></section><section id="getty-mgetty"><title><productname class="trade">mgetty</productname></title><para><productname class="trade">mgetty</productname> is a modem-aware
   <application moreinfo="none">getty</application>.  It supports modems with the
   Hayes <acronym>AT</acronym> command set and is especially designed
   for supporting modems that are used to send faxes and to dial out
   as well as dial in.  These features are not required for a serial
   console.</para><para><application moreinfo="none">mgetty</application> does not require the
   traditional <filename moreinfo="none">/etc/gettydefs</filename> file.  As a result
   <application moreinfo="none">mgetty</application> is invoked from
   <filename moreinfo="none">/etc/inittab</filename> without supplying an entry in
   <filename moreinfo="none">/etc/gettydefs</filename>.</para><figure float="0" id="getty-mgetty-inittab"><title><filename moreinfo="none">/etc/inittab</filename> entry for
    <application moreinfo="none">mgetty</application></title><programlisting format="linespecific">co:2345:respawn:/sbin/mgetty ttyS0</programlisting></figure><para><application moreinfo="none">mgetty</application> is configured using the
   file <filename moreinfo="none">/etc/mgetty+sendfax/mgetty.config</filename>.  It
   should contain an entry for the port used by the serial
   console.</para><figure float="0"><title><application moreinfo="none">mgetty</application> configuration file
    <filename moreinfo="none">mgetty.config</filename></title><programlisting format="linespecific" id="getty-mgetty-mgettyconfig">port ttyS0
 speed 9600
 direct yes
 data-only yes
 toggle-dtr yes
 need-dsr yes
 port-owner root
 port-group root
 port-mode 600
 login-prompt @ \P login:\040
 login-time 60
 term vt102</programlisting></figure><para>All the options are documented in the
   <productname class="trade">PostScript</productname> file
   <filename moreinfo="none">/usr/share/doc/mgettyent/mgetty.ps</filename>.</para><para>We set <literal moreinfo="none">direct</literal>,
   <literal moreinfo="none">data-only</literal>, <literal moreinfo="none">need-dsr</literal> and
   <literal moreinfo="none">toggle-dtr</literal> so that the <acronym>RS-232</acronym>
   control lines are used correctly for a dumb modem.</para><para><literal moreinfo="none">port-owner</literal>, <literal moreinfo="none">port-group</literal>
   and <literal moreinfo="none">port-mode</literal> set the serial device to be
   accessible only by the <systemitem class="username" moreinfo="none">root</systemitem> user. Modem applications, which
   normally use the <systemitem class="groupname" moreinfo="none">uucp</systemitem>
   group, cannot now accidentally use the serial console.</para><para><literal moreinfo="none">login-prompt</literal> shows the machine
   (<literal moreinfo="none">@</literal>) and serial port (<literal moreinfo="none">\P</literal>)
   being used.  The text <literal moreinfo="none">\040</literal> is simply the octal
   code for a space after <literal moreinfo="none">login:</literal>.</para><para><literal moreinfo="none">term vt102</literal> gives the make and model of the
   terminal most likely to dial in.  This sets the
   <varname>TERM</varname> environment variable, which you can change
   if you are dialling in from another terminal type.</para><para>The remaining configuration files,
   <filename moreinfo="none">/etc/mgetty+sendfax/dialin.config</filename> and
   <filename moreinfo="none">/etc/mgetty+sendfax/login.config</filename>, do not need
   to be altered.</para><para>If you wish to alter the suggested configuration then note
   that <application moreinfo="none">mgetty</application>'s
   <literal moreinfo="none">blocking</literal> and <literal moreinfo="none">toggle-dtr</literal>
   parameters do not co-exist well.</para><para>If you have difficulties, activate debugging by adding
   <literal moreinfo="none">debug 8</literal> to <filename moreinfo="none">mgetty.config</filename>.
   <application moreinfo="none">mgetty</application>'s actions are then visible in the
   file <filename moreinfo="none">/var/log/mgetty.log.ttyS0</filename>.</para></section><section id="getty-mingetty"><title><productname class="trade">mingetty</productname></title><para><productname class="trade">mingetty</productname> is designed to be a
   minimal <application moreinfo="none">getty</application> for the virtual terminals
   on the the workstation's monitor and keyboard.  It has no support
   for serial lines.</para><para>You must not use <application moreinfo="none">mingetty</application> for the
   serial line in <filename moreinfo="none">/etc/inittab</filename>, but the current
   <application moreinfo="none">mingetty</application> entries for the virtual
   terminals can remain.</para><para>Each virtual terminal uses about 8<acronym>KB</acronym> of
   kernel memory.  If this matters, it is easy to allocate fewer
   virtual terminals.  In the <systemitem class="osname" moreinfo="none">Linux</systemitem> 2.4 kernel virtual terminals are
   created on demand, so not starting
   <productname class="trade">mingetty</productname> on the virtual terminal will
   not create the virtual terminal. If the machine does not have a
   video card then remove all the <application moreinfo="none">mingetty</application>
   entries from <filename moreinfo="none">/etc/inittab</filename>.</para><figure float="0" id="getty-mingetty-inittab"><title>Fewer virtual terminals. Removing
    <application moreinfo="none">mingetty</application> entries from
    <filename moreinfo="none">/etc/inittab</filename></title><programlisting format="linespecific">1:2345:respawn:/sbin/mingetty tty1
# Additional virtual terminals are not used
2:2345:off:/sbin/mingetty tty2
3:2345:off:/sbin/mingetty tty3
4:2345:off:/sbin/mingetty tty4
5:2345:off:/sbin/mingetty tty5
6:2345:off:/sbin/mingetty tty6</programlisting></figure><para>After restarting <application moreinfo="none">init</application> it would be
   wise to remove the unused device files.</para><figure float="0" id="getty-mingetty-devtty"><title>Fewer virtual terminals. Deallocating unused virtual
    terminals and removing their device files.</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">telinit q</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">deallocvt /dev/tty[2-9] /dev/tty[0-9][0-9]</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">rm /dev/tty[2-9] /dev/tty[0-9][0-9]</command>
</screen></figure></section><section id="getty-none"><title>No <productname class="trade">getty</productname></title><para>If you are using serial console simply to print console
   messages then do not run a <application moreinfo="none">getty</application> process
   on the serial port.</para><para><application moreinfo="none">getty</application> follows a locking convention
   that prevents other serial port applications from using the serial
   port.  Since we do not want other processes to use the serial port,
   but are not running <application moreinfo="none">getty</application>, manually
   create the lock file.</para><para>Create a file <filename moreinfo="none">/var/lock/LCK..ttyS0</filename> to
   contain the text <literal moreinfo="none">1</literal>.  This lets other potential
   serial port applications know that process 1 has the serial port in
   use.  Process 1 is always the <application moreinfo="none">init</application>
   process, and <application moreinfo="none">init</application> is always running, so
   the serial port is always locked.</para><para>The file is created upon each system boot, as lock files are
   often cleared when the system boots.  A convenient place to create
   the lock file is from <filename moreinfo="none">/etc/rc.serial</filename>.  It
   should contain:</para><figure float="0" id="getty-none-rcserial"><title>Contents of <filename moreinfo="none">/etc/rc.serial</filename> to lock
    console serial port when no <application moreinfo="none">getty</application>
    used</title><programlisting format="linespecific"># Lock /dev/ttyS0 as it is used by an output-only console
(umask 022 entent \
 rm -f '/var/lock/LCK..ttyS0' entent \
 echo '1' ent '/var/lock/LCK..ttyS0')</programlisting></figure></section></chapter><chapter id="misc"><title>Configure incidentals</title><para>A surprising number of other configuration files need small
  modifications before the serial console works well.</para><para>The configuration of many items depends upon your security
  requirements, especially depending upon the level of trust and
  corresponding need for security at the remote site.  By assuming a
  high need for security at the remote site this
  <citetitle>HOWTO</citetitle> can illustrate a large number of
  configuration items.</para><section id="misc-securetty"><title>Allow <systemitem class="username" moreinfo="none">root</systemitem> to
   login from serial console</title><para>The file <filename moreinfo="none">/etc/securetty</filename> controls the
   devices that the <systemitem class="username" moreinfo="none">root</systemitem>
   user can log in upon.</para><para>It is usually desirable to have <systemitem class="username" moreinfo="none">root</systemitem> be able to log in from the
   console, so add the basename of the serial console device to
   <filename moreinfo="none">/etc/securetty</filename>.</para><figure float="0" id="misc-secretty-ttys0"><title>Alter <filename moreinfo="none">securetty</filename> to allow <systemitem class="username" moreinfo="none">root</systemitem> to log in from the serial
    console</title><programlisting format="linespecific">ttyS0</programlisting></figure><para>Almost anyone can now dial into the modem and attempt to
   guess the <systemitem class="username" moreinfo="none">root</systemitem> password.
   Normally we do not allow <systemitem class="username" moreinfo="none">root</systemitem> to log in from a remote site,
   rather we have a normal user log in and then use
   <command moreinfo="none">su</command> or <ulink url="http://www.courtesan.com/sudo/"><command moreinfo="none">sudo</command></ulink>
   to become <systemitem class="username" moreinfo="none">root</systemitem>.  This
   gives some traceability.</para><para>Unfortunately, the <systemitem class="username" moreinfo="none">root</systemitem> user needs to be able to log in
   from the console to fix a full disk.  Disk subsystems typically
   reserve 5% of their space for root's exclusive use.<footnote><para>This is not as inefficient as it may appear.  The last 5%
     of a disk formatted with a general purpose filesystem always
     performs poorly and is best left empty.</para></footnote>

   This is enough space for the <systemitem class="username" moreinfo="none">root</systemitem> user to log in and start
   deleting the files that filled the disk.</para><note><title><filename moreinfo="none">securetty</filename> and Red Hat's
    <application moreinfo="none">kudzu</application></title><para><application moreinfo="none">kudzu</application> automatically adds the
    device being used as the console to
    <filename moreinfo="none">securetty</filename>.</para></note></section><section id="misc-init"><title>Change <application moreinfo="none">init</application> level to textual</title><para>There is little point in running the <productname class="trade">X Window
   System</productname> on a server with no screen. Edit
   <filename moreinfo="none">/etc/inittab</filename> finding the line containing
   <literal moreinfo="none">initdefault</literal>, such as</para><informalfigure float="0" id="misc-init-x"><programlisting format="linespecific">id:5:initdefault:</programlisting></informalfigure><para>Alter the default from run level 5 (multiuser with X Window
   System) to run level 3 (multiuser).</para><informalfigure float="0" id="misc-init-text"><programlisting format="linespecific">id:3:initdefault:</programlisting></informalfigure><para>The <command moreinfo="none">startx</command> command can be used if an
   occassional <productname class="trade">X Windows</productname> session is
   required upon an attached keyboard and monitor.</para><note><title>Run levels and Red Hat's
    <application moreinfo="none">kudzu</application></title><para><application moreinfo="none">kudzu</application> automatically updates the
    <literal moreinfo="none">initdefault</literal> entry in
    <filename moreinfo="none">inittab</filename> to use run level 3 if a serial device
    is being used as a console.</para></note><section id="misc-init-x11"><title>Continuing to run X</title><para>Sometimes a computer with a serial console and no attached
    monitor still needs to run the <application moreinfo="none">X Window
    System</application>.  For example, the computer might host a
    number of <application moreinfo="none">X</application> terminals.</para><para>In this case the computer should remain in run level 5, but
    should not run a <application moreinfo="none">X</application> server for any
    attached monitors.  Alter
    <filename moreinfo="none">/etc/X11/xdm/Xservers</filename> and remove any lines
    starting with a colon (which indicates an
    <application moreinfo="none">X</application> server on the local machine).  <xref linkend="misc-init-x11-xservers"></xref> shows an unaltered
    <filename moreinfo="none">Xservers</filename> file.</para><figure float="0" id="misc-init-x11-xservers"><title><filename moreinfo="none">Xservers</filename> from Red Hat Linux
     7.2</title><programlisting format="linespecific">:0 local /usr/X11R6/bin/X</programlisting></figure><para>If the operating system uses <acronym>GNOME</acronym>'s
    <application moreinfo="none">gdm</application> then alter its configuration file
    <filename moreinfo="none">/etc/X11/gdm/gdm.conf</filename>, removing any entries
    for local <application moreinfo="none">X</application> servers from the
    <literal moreinfo="none">[servers]</literal> section.  <xref linkend="misc-init-x11-gdmconf"></xref>shows an unaltered
    <literal moreinfo="none">[servers]</literal> section.</para><figure float="0" id="misc-init-x11-gdmconf"><title><literal moreinfo="none">[servers]</literal> section of
     <filename moreinfo="none">gdm.conf</filename> from Red Hat Linux 7.2</title><programlisting format="linespecific">[servers]
0=/usr/bin/X11/X</programlisting></figure></section></section><section id="misc-remove-ioctl-save"><title>Remove saved console settings</title><para>The file <filename moreinfo="none">/etc/ioctl.save</filename> contains the
   serial and terminal parameters to use in single user mode.  The
   serial and terminal parameters are usually set by
   <application moreinfo="none">getty</application> ent during single user mode no
   <application moreinfo="none">getty</application> runs and the contents of
   <filename moreinfo="none">/etc/ioctl.save</filename> are used to set the serial and
   terminal parameters.</para><para>As we are changing consoles, the saved settings are no longer
   correct.</para><figure float="0" id="remove-ioctl-save-rm"><title>Removal of <filename moreinfo="none">ioctl.save</filename> containing the
    saved console parameters</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">rm -f /etc/ioctl.save</command></screen></figure><para>We re-create this file once we can log in from the serial
   console.</para></section><section id="misc-devmodem"><title>Serial console is not <filename class="symlink" moreinfo="none">/dev/modem</filename></title><para>In many Linux distributions the file <filename class="symlink" moreinfo="none">/dev/modem</filename> is a symbolic link to the
   serial port containing a modem which is available for use.</para><para>Although the serial console is a serial port with a modem, we
   certainly don't want it used to place an outgoing call.</para><para>Check that <filename class="symlink" moreinfo="none">/dev/modem</filename>
   does not point to the serial port being used for the console, say
   <filename class="devicefile" moreinfo="none">/dev/ttyS0</filename>.  If it does,
   then remove the symbolic link.</para><figure float="0" id="misc-devmodem-example"><title>Remove <filename class="symlink" moreinfo="none">/dev/modem</filename> if
    it points to the serial console's port</title><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">ls -l /dev/modem</command>
<computeroutput moreinfo="none">lrwxrwxrwx 1 root root 10 Jan 01 00:00 /dev/modem -ent /dev/ttyS0</computeroutput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">rm /dev/modem</command></screen></figure></section><section id="misc-devsystty"><title>Alter target of <filename class="symlink" moreinfo="none">/dev/systty</filename></title><para>In many Linux distributions the file <filename class="symlink" moreinfo="none">/dev/systty</filename> is a symbolic link to the
   device which is used as the by the attached monitor and keyboard.
   See <xref linkend="intro-word"></xref> for a fuller description.</para><para>If there is no attached keyboard and monitor or no wish to
   give the attached keyboard and monitor greater capabilities then a
   text terminal, then alter <filename class="symlink" moreinfo="none">/dev/systty</filename> to point to the serial
   console.</para><para>Rather than directly altering this symbolic link, it is
   better to modify the configuration file used by
   <command moreinfo="none">MAKEDEV</command>, which is then run to recreate the
   symbolic link.  The configuration file is in the directory
   <filename class="directory" moreinfo="none">/etc/makedev.d</filename>.  The default
   configuration will point to the first virtual terminal, as shown in
   <xref linkend="misc-devsystty-default"></xref>.</para><figure float="0" id="misc-devsystty-default"><title>Default value of <filename class="symlink" moreinfo="none">/dev/systty</filename> in
    <filename moreinfo="none">/etc/makedev.d/linux-2.4.x</filename></title><programlisting format="linespecific">l systty tty0</programlisting></figure><para>Modify this to point to the serial port being used by the
   console, as shown in <xref linkend="misc-devsystty-serial"></xref>.</para><figure float="0" id="misc-devsystty-serial"><title>Alter value of <filename class="symlink" moreinfo="none">/dev/systty</filename> in
    <command moreinfo="none">MAKEDEV</command> configuration file</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">cd /etc/makedev.d</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">fgrep systty *</command>
<computeroutput moreinfo="none">linux-2.4.x:l systty tty0</computeroutput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">vi linux-2.4.x</command></screen><programlisting format="linespecific">l systty ttyS0</programlisting></figure><para>Now re-create <filename class="symlink" moreinfo="none">/dev/systty</filename> using its new definition, as
   shown in <xref linkend="misc-devsystty-create"></xref>.</para><figure float="0" id="misc-devsystty-create"><title>Installing new value of <filename class="symlink" moreinfo="none">/dev/systty</filename></title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">cd /dev</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">rm systty</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">./MAKEDEV systty</command></screen></figure></section><section id="misc-pam"><title>Configure Pluggable Authentication Modules</title><para>The <application moreinfo="none">Pluggable Authentication
   Module</application> system can be used to give special privileges
   to users that logged in through the console.  It is used to make
   devices like the floppy disk mountable by the console's user;
   usually they would need to become the super-user to mount a
   disk.</para><para>The <acronym>PAM</acronym> configuration file
   <filename moreinfo="none">/etc/security/console.perms</filename> contains the
   <literal moreinfo="none">entconsoleent</literal> variable.  For <productname class="trade">Red
   Hat Linux</productname> <productnumber>7.1</productnumber>
   <literal moreinfo="none">entconsoleent</literal> is the regular
   expression:</para><figure float="0" id="misc-pam-default-console"><title>Default <literal moreinfo="none">entconsoleent</literal> in
    <filename moreinfo="none">console.perms</filename> refers to attached keyboard and
    screen</title><programlisting format="linespecific">entconsoleent=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]</programlisting></figure><para>Later in the file the <literal moreinfo="none">entconsoleent</literal> user
   is granted permission to use some devices.  This is done by
   altering the devices' permissions upon login and logout.</para><figure float="0" id="misc-pam-default-dev"><title>Default device listing in
    <filename moreinfo="none">console.perms</filename></title><programlisting format="linespecific">entconsoleent  0660 entfloppyent     0660 root.floppy
entconsoleent  0600 entsoundent      0600 root
entconsoleent  0600 entcdroment      0660 root.disk
entconsoleent  0600 entpilotent      0660 root.uucp
entconsoleent  0600 entjazent        0660 root.disk
entconsoleent  0600 entzipent        0660 root.disk
entconsoleent  0600 entls120ent      0660 root.disk
entconsoleent  0600 entscannerent    0600 root
entconsoleent  0600 entcameraent     0600 root
entconsoleent  0600 entmemstickent   0600 root
entconsoleent  0600 entflashent      0600 root
entconsoleent  0600 entfbent         0600 root
entconsoleent  0600 entkbdent        0600 root
entconsoleent  0600 entjoystickent   0600 root
entconsoleent  0600 entv4lent        0600 root
entconsoleent  0700 entgpment        0700 root
entconsoleent  0600 entmainboardent  0600 root
entconsoleent  0600 entrio500ent     0600 root</programlisting></figure><para>There are two types of devices listed above: those devices
   required by someone connecting from an attached keyboard and
   monitor and those devices that allow convenient access to devices.
   The configuration file fails to make the distionction between
   logical and physical console noted in <xref linkend="intro-word"></xref>.
   The configuration file is modified to create that
   distinction.</para><figure float="0" id="misc-pam-serial-dev"><title>Devices in <filename moreinfo="none">console.perms</filename> required for
    attached keyboard and screen</title><programlisting format="linespecific">entconsoleent  0600 entfbent         0600 root
entconsoleent  0600 entkbdent        0600 root
entconsoleent  0600 entjoystickent   0600 root
entconsoleent  0600 entv4lent        0600 root
entconsoleent  0700 entgpment        0700 root</programlisting></figure><para>The remaining devices should be altered to give control only
   to people attaching from the serial console.  For example, we don't
   want an unprivileged user at a co-location site mounting a floppy
   disk.  Define a new console type for the serial console, say
   <literal moreinfo="none">entsconsoleent</literal>.</para><figure float="0" id="misc-pam-serial-sconsole"><title>Add <literal moreinfo="none">entsconsoleent</literal> in
    <filename moreinfo="none">console.perms</filename> to refer to serial
    console</title><programlisting format="linespecific">entsconsoleent=ttyS0</programlisting></figure><para>Now modify the remaining entries from
   <literal moreinfo="none">entconsoleent</literal> to
   <literal moreinfo="none">entsconsoleent</literal>.</para><figure float="0" id="misc-pam-serial-sdev"><title>Remaining devices in <filename moreinfo="none">console.perms</filename>
    altered to refer to serial console</title><programlisting format="linespecific">entsconsoleent  0660 entfloppyent     0660 root.floppy
entsconsoleent  0600 entsoundent      0600 root
entsconsoleent  0600 entcdroment      0660 root.disk
entsconsoleent  0600 entpilotent      0660 root.uucp
entsconsoleent  0600 entjazent        0660 root.disk
entsconsoleent  0600 entzipent        0660 root.disk
entsconsoleent  0600 entls120ent      0660 root.disk
entsconsoleent  0600 entscannerent    0600 root
entsconsoleent  0600 entcameraent     0600 root
entsconsoleent  0600 entmemstickent   0600 root
entsconsoleent  0600 entflashent      0600 root
entsconsoleent  0600 entmainboardent  0600 root
entsconsoleent  0600 entrio500ent     0600 root</programlisting></figure></section><section id="misc-configure-rhl"><title>Configure <productname class="trade">Red Hat Linux</productname></title><para><productname class="trade">Red Hat Linux</productname> stores parameters concerning system start up in
   the file <filename moreinfo="none">/etc/sysconfig/init</filename>.</para><para>Alter the parameter <literal moreinfo="none">BOOTUP</literal> to use
   terminal-independent commands to write the
   <computeroutput moreinfo="none">OK</computeroutput>,
   <computeroutput moreinfo="none">PASSED</computeroutput> and
   <computeroutput moreinfo="none">FAILED</computeroutput> messages.  These messages
   will no longer appear in green, yellow or red.  The comments in
   <filename moreinfo="none">/etc/sysconfig/init</filename> suggest that any value
   other than <literal moreinfo="none">color</literal> will do, but it seems that
   <literal moreinfo="none">BOOTUP</literal> must be set to
   <literal moreinfo="none">serial</literal>.</para><para>Alter the <literal moreinfo="none">PROMPT</literal> parameter to disallow
   interactive start up.  Allowing an unauthenticated keystroke to stop
   system services is not robust against line noise and allows anyone
   that dials in during system boot to deny services.</para><figure float="0" id="misc-configure-rhl-etc-syslinux-init"><title>Alterations to <filename moreinfo="none">/etc/sysconfig/init</filename> for
    <productname class="trade">Red Hat Linux</productname></title><programlisting format="linespecific">BOOTUP=serial
PROMPT=no</programlisting></figure><para><productname class="trade">Red Hat Linux</productname> runs a hardware
   discoverer, named <application moreinfo="none">kudzu</application>.  When
   attempting to identify a serial port
   <application moreinfo="none">Kudzu</application> resets the serial port.  This
   stops the serial console.  <application moreinfo="none">Kudzu</application> is
   configured from the file
   <filename moreinfo="none">/etc/sysconfig/kudzu</filename>.</para><para><application moreinfo="none">Kudzu</application> can be prevented from
   resetting hardware by setting the configuration parameter
   <literal moreinfo="none">SAFE</literal> to <literal moreinfo="none">yes</literal>.</para><figure float="0" id="misc-configure-rhl-etc-syslinux-kudzu"><title>Alterations to <filename moreinfo="none">/etc/sysconfig/kudzu</filename>
    for <productname class="trade">Red Hat Linux</productname></title><programlisting format="linespecific">SAFE=yes</programlisting></figure></section></chapter><chapter id="test"><title>Reboot and test</title><section id="test-verify"><title>Verify console operation</title><para>If possible, plug an <acronym>RS-232</acronym> breakout box
   into the serial port. During reboot the Data Terminal Ready line
   should become active and then the Transmit Data lights should flash
   as console messages appear.</para><para>Attach a modem, or a null modem cable and a terminal.
   Configure them to match the serial parameters used by the serial
   console port.  If using a modem, dial in to it from a terminal
   emulator.</para><informalfigure float="0" id="test-verify-operation-connect"><screen format="linespecific"><command moreinfo="none">+++</command>
<command moreinfo="none">AT Z</command>
<command moreinfo="none">AT DT 1234-5678</command>
<computeroutput moreinfo="none">CONNECT 9600</computeroutput></screen></informalfigure><para>Configure the terminal or terminal emulator to match the
   serial parameters used by the serial console.  If using a modern
   Hayes <acronym>AT</acronym>-style modem then the speed need not
   match.  If using a directly-attached terminal then the speed must
   match.</para><para>Reboot the computer.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">shutdown -r now</command></screen></informalfigure><para>During reboot the terminal should see the usual boot loader
   text, and then the default kernel booting, then the
   <application moreinfo="none">init</application> output, and finally the contents of
   <filename moreinfo="none">/etc/issue</filename> and
   <application moreinfo="none">getty</application> asking you to login.</para><informalfigure float="0"><screen format="linespecific">LILO:

Linux version ent
Kernel command line: auto BOOT_IMAGE=linux ro root=306 BOOT_FILE=/boot/vmlinuz-2.4.3-12 console=tty0 console=ttyS0,9600n8
ent
INIT version ent
ent
/etc/issue says "All your base are belong to us".
remote.example.edu.au ttyS0 login:</screen></informalfigure><para>If you do not see the <prompt moreinfo="none">login:</prompt> message then
   press <keycap moreinfo="none">Return</keycap> or <keycap moreinfo="none">Enter</keycap>.</para></section><section id="recreate-ioctl-save"><title>Re-create saved console settings</title><para>Log in as <systemitem class="username" moreinfo="none">root</systemitem> from
   the serial console and send the console into single user mode. The
   modem may hang up whilst doing this and you may need to
   re-connect.</para><para>Without a <filename moreinfo="none">/etc/ioctl.save</filename> containing the
   saved terminal settings, <application moreinfo="none">init</application> assumes a
   directly attached terminal running at 9600bps with 8 data bits, no
   parity, 1 stop bit and no flow control.  Configure your terminal
   with these settings.</para><informalfigure float="0" id="recreate-ioctl-save-login"><screen format="linespecific"><prompt moreinfo="none">remote.example.edu.au ttyS0 login:</prompt> <userinput moreinfo="none">root</userinput>
<prompt moreinfo="none">Password:</prompt> <userinput moreinfo="none">ent</userinput>
<prompt moreinfo="none">sh#</prompt> <command moreinfo="none">rm -f /etc/ioctl.save</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">telinit 1</command>
ent<computeroutput moreinfo="none">Telling INIT to go to single user mode.
INIT: Going single user
INIT: Sending processes the TERM signal</computeroutput>
<prompt moreinfo="none">sh#</prompt> <command moreinfo="none">stty sane -parenb cs8 crtscts brkint -istrip -ixoff -ixon</command></screen></informalfigure><para>As you use <command moreinfo="none">stty</command> to alter the Linux's
   terminal settings remember to also alter the settings of the
   attached terminal.</para><para>Exiting from single user mode back to the default run level
   will save the serial console termnial configuration into
   <filename moreinfo="none">/etc/ioctl.save</filename>.</para><informalfigure float="0" id="recreate-ioctl-save-login-text"><screen format="linespecific"><prompt moreinfo="none">sh#</prompt> <command moreinfo="none">exit</command>
ent
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">ls -l /etc/ioctl.save</command>
<computeroutput moreinfo="none">-rw------- 1 root root 60 Jan 1 00:00 /etc/ioctl.save</computeroutput></screen></informalfigure><para>The terminal settings saved in
   <filename moreinfo="none">/etc/ioctl.save</filename> will be used if the machine
   boots into single user mode for any reason.</para><para>If your attached terminal or modem cannot alter speed to
   9600bps then the above procedure cannot be followed.  <ulink url="http://www.aarnet.edu.au/network/software/ioctlsave/"><command moreinfo="none">ioctlsave</command></ulink>
   has been written for this special case.  It saves the current
   terminal settings to a file in the same format as
   <filename moreinfo="none">ioctl.save</filename>.  The procedure is shown in <xref linkend="recreate-ioctl-save-ioctlsave"></xref>.</para><figure float="0" id="recreate-ioctl-save-ioctlsave"><title>Using <command moreinfo="none">ioctlsave</command> to create
    <filename moreinfo="none">/etc/ioctl.save</filename> without entering single user
    mode</title><screen format="linespecific"><prompt moreinfo="none">remote.example.edu.au ttyS0 login:</prompt> <userinput moreinfo="none">root</userinput>
<prompt moreinfo="none">Password:</prompt> <userinput moreinfo="none">ent</userinput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">rm -f /etc/ioctl.save</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">ioctlsave -t /dev/ttyS0 /etc/ioctl.save</command></screen></figure></section><section id="test-console"><title>Test the console</title><para>Dial in from a machine, perhaps using
   <application moreinfo="none">Minicom</application>.</para><example id="test-console-session"><title>Dialing into a serial console</title><screen format="linespecific"><prompt moreinfo="none">localhost bash$</prompt> <command moreinfo="none">minicom</command></screen><screen format="linespecific"><computeroutput moreinfo="none">Initializing modem
Welcome to minicom 1.83.1
Press ALT-Z for help on special keys
AT S7=45 S0=0 L1 V1 X4 entC1 E1 Q0                     
OK</computeroutput>
<keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">D</keycap></keycombo> <guimenuitem moreinfo="none">remote.example.edu.au-ttyS0</guimenuitem>
<guilabel moreinfo="none">Dialing: remote.example.edu.au-ttyS0 At: 1234-5678</guilabel>
<guilabel moreinfo="none">Connected. Press any key to continue</guilabel>
<keycap moreinfo="none">Any</keycap>
<computeroutput moreinfo="none">CONNECT 115200/V34/LAPM/V42BIS/33600:TX/33600:RX</computeroutput></screen><screen format="linespecific"><keycap moreinfo="none">Enter</keycap>
<computeroutput moreinfo="none">/etc/issue says "All your base are belong to us".</computeroutput>
<prompt moreinfo="none">remote.example.edu.au ttyS0 login:</prompt> <userinput moreinfo="none">user</userinput>
<prompt moreinfo="none">Password:</prompt> <userinput moreinfo="none">********</userinput>
<computeroutput moreinfo="none">Message of the day is "be careful out there".</computeroutput>
<prompt moreinfo="none">remote bash$</prompt> <command moreinfo="none">stty -a</command>
<computeroutput moreinfo="none">speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = entundefent;
eol2 = entundefent; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab3 bs0 vt0 ff0
isig icanon -iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
-echoctl -echoke</computeroutput>
ent
<prompt moreinfo="none">remote bash$</prompt> <command moreinfo="none">logout</command></screen><screen format="linespecific"><computeroutput moreinfo="none">NO CARRIER</computeroutput>
<keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">X</keycap></keycombo>
<guimenu moreinfo="none">Leave Minicom?</guimenu> <guimenuitem moreinfo="none">Yes</guimenuitem>
<guilabel moreinfo="none">Resetting modem</guilabel></screen><screen format="linespecific"><prompt moreinfo="none">localhost bash$</prompt></screen></example><para>Interestingly the <command moreinfo="none">stty -a</command> command, used to
   display the terminal settings, reports that the link from the modem
   to the serial console is 9600<abbrev>bps</abbrev>.  The
   <literal moreinfo="none">CONNECT</literal> message reports that link between the
   two modems operates at 33600<abbrev>bps</abbrev>.  The constant
   speed modem-computer link is a very useful feature of the Hayes
   <acronym>AT</acronym>-style modems: the calling computer need not
   know in advance the line speed of the called serial console.</para></section><section id="end"><title>Where to next from here?</title><para>The serial console is now configured.  Check the security
   pointers given in <xref linkend="security"></xref> to complete the
   job.</para></section></chapter><chapter id="security"><title>Security</title><para>Using a serial console with a modem gives anyone the
  opportunity to connect to the console port.  This connection is not
  mediated by firewalls or intrusion detection sniffers.  It is
  important to prevent the misuse of the serial console by
  unauthorized people.</para><para>The resurgence of the <acronym>BBS</acronym>-era technique of
  entwar diallingent is described in @Stake's <ulink url="http://www.atstake.com/research/reports/acrobat/wardialling_brief.pdf"><citetitle>Wardialling
  Brief</citetitle></ulink> and reported upon by <citetitle>The
  Register</citetitle>, see an extract in <xref linkend="security-leyden"></xref>.</para><figure float="0" id="security-leyden"><title>Extract from <citetitle>Crackers favour war dialling and
   weak passwords</citetitle></title><blockquote><para>With all the talk about zero day exploits and sometimes
    esoteric vulnerabilities its easy to lose sight of the role of
    older, less sophisticated techniques as a mainstay of cracker
    activity.</para><para>During a hacking debate at InfoSecurity Europe yesterday
    [2002-04-25], black hat hacker KP said that when he broke into a
    network he did so 90 per cent of the time through an unprotected
    modem, often through war dialling.</para><para>War dialling involves systematically trying to locate the
    numbers associated with corporate modems through testing each
    extension of a corporate phone system in turn.</para><para>entIntrusion detection systems are no real deterrent for
    me because I get in through the back door,ent he
    said. entMany networks are constructed like Baked Alaska
    ent crunchy on the outside and soft in the
    middle.ent</para><para>KP often takes advantage of weak or default passwords to
    break into networksent</para></blockquote><literallayout format="linespecific" linenumbering="unnumbered" class="normal"><citetitle>Crackers favour war dialling and weak passwords</citetitle>
John Leyden, <ulink url="http://www.theregister.co.uk/content/55/25044.html"><citetitle>The Register</citetitle></ulink>, 2002-04-26.</literallayout></figure><section id="security-password"><title>Use good passwords</title><para>Anyone that can guess the <acronym>BIOS</acronym> password,
   the boot loader password, or the <systemitem class="username" moreinfo="none">root</systemitem> password can get full control of
   the machine.  These should be different, unrelated, excellent
   passwords.  Random text and digits are by far the best choice.  You
   should never use a password that you think would return a hit from
   a search engine.<footnote><para>But don't submit your proposed password to a search engine!
     Sending passwords in plain text across the Internet isn't good,
     nor the possibility of having them appear in the logs of a search
     engine.</para></footnote></para><para>Guessing a user's password is only slightly less severe, as a
   hacker can obtain <systemitem class="username" moreinfo="none">root</systemitem>
   access simply by waiting.  The hacker waits for a entlocal
   exploitent for a flaw in the operating system to appear and
   uses that exploit before the machine is patched.</para><para>Severely limit the number of users on the machine.  Ensure
   that only good passwords are chosen by using a fascist password
   checker such as a <ulink url="http://www.users.dircon.co.uk/~crypto/"><application moreinfo="none">cracklib</application></ulink>-based
   <ulink url="http://www.kernel.org/pub/linux/libs/Linux-PAM-html/pam.html"><application moreinfo="none">PAM</application></ulink>
   module.</para><para>You should write down the <acronym>BIOS</acronym> password,
   the boot loader password and the <systemitem class="username" moreinfo="none">root</systemitem> password.  Now you don't need to
   remember them, so there is no reason for them not to be totally
   random, unrelated, excellent passwords.  Fold the page, put it in
   an envelope and seal it.</para><para>Now we have turned a computer security problem into a
   physical security problem.  We know how to solve those problems:
   locks, keys, alarms, safes, guards, regular inspections.  If your
   site has staffed security then a good option is to leave the
   envelope in the care of the guard post with instructions to treat
   the envelope with the same procedures used for the site's master
   keys.  Smaller sites can use a safe, a cash box or a locked drawer.
   A thief forcing a locked drawer still leaves shows more apparent
   signs of entry and more clues to their identity than is left by a
   hacker behind a modem.</para><para>These three passwords are an important corporate asset.  If
   the machine is secure then forgetting the major passwords for the
   machine should result in a machine whose configuration cannot be
   altered by actions short of disassembly.  You should have written
   procedures controlling the generation, storage, lifetime and use of
   major passwords.</para></section><section id="security-dtr"><title>Obey Data Terminal Ready and Data Carrier Detect</title><para>The <acronym>RS-232</acronym> Data Terminal Ready signal is
   lowered when the computer wishes the modem to hang up.  The
   computer wishes to hang up when people have ended their login
   session ends or when they fail to respond to the
   <prompt moreinfo="none">login:</prompt> prompt.</para><para>Using a modem cable that has <acronym>DTR</acronym> wired and a
   modem that is configured to obey <acronym>DTR</acronym> is essential
   to prevent denial of service attacks upon the access to the
   console.</para><para>Without <acronym>DTR</acronym> a caller can simply hold the
   modem line open, denying system administrators access to the
   console.</para><para>The <acronym>RS-232</acronym> Data Carrier Detect signal is
   lowered when the user hangs up.</para><para>Using a modem cable that has <acronym>DCD</acronym> wired and
   a modem that is configured to assert <acronym>DCD</acronym> is
   essential to prevent people dialling in after a user has hang up
   and from carrying on their session.</para><para>Without <acronym>DCD</acronym> the session is not cleared when
   an accidental disconnection occurs.  This allows any subsequent
   caller to resume the previous session.  The machine is totally
   compromised if the previous user was <systemitem class="username" moreinfo="none">root</systemitem>.</para></section><section id="security-dumb"><title>Use or configure a dumb modem</title><para>Most modems use the Hayes <acronym>AT</acronym> command set.
   The modem's attention is gained by sending <literal moreinfo="none">+++</literal>
   surrounded by some idle time.  Commands are then sent prefixed by
   <literal moreinfo="none">AT</literal>.</para><para>Unfortunately, if the modem sees <literal moreinfo="none">+++</literal>
   during a call it may revert to command mode.  The modem can then be
   configured by the caller.  For example, the modem could be set to
   permit incoming calls only from the number ent0ent, this
   would deny the system administrators access to the modem.</para><para>The attention command can be removed using <command moreinfo="none">AT
   S2=255</command>.  Of course once that is done no more
   <acronym>AT</acronym> commands can be given to the modem, so any
   other configuration of the modem needs to be done prior to that
   command.</para><para>Unfortunately, when power to the modem is applied the modem
   starts in command mode.  So a carefully chosen console message
   could disable the modem.</para><para>The best solution is to select a modem that has a
   entdumbent or entselect profileent
   <acronym>DIP</acronym> switch or jumper.  These switches disable
   command mode and load the modem's saved configuration when they
   start.</para></section><section id="security-messages"><title>Restrict console messages</title><section id="security-messages-log"><title>Restrict console messages from the system log</title><para>Generating a stready stream of console messages can easily
    overwhelm a 9600<abbrev>bps</abbrev> link.</para><para>Although displaying all <application moreinfo="none">syslog</application>
    messages on the console appears to be a good idea, this actually
    provides the unprivileged user a simple method to deny effective
    use of the remote console.</para><para>Configure system log messages to the console to the bare
    minimum. Look in <filename moreinfo="none">/etc/syslog.conf</filename> for lines
    ending with <filename class="devicefile" moreinfo="none">/dev/console</filename>.</para><para>Consider sending all log messages to another machine for
    recording and analysis.  <xref linkend="security-messages-syslogconf"></xref> shows the standard
    <filename moreinfo="none">/etc/syslog.conf</filename> from <productname class="trade">Red Hat
    Linux</productname> <productnumber>7.2</productnumber> modified to
    record log messages to a log server.  Each line of
    <filename moreinfo="none">syslog.conf</filename> has been repeated to send a copy
    of the message to the log server.  The log server has the
    <acronym>DNS</acronym> alias <systemitem class="systemname" moreinfo="none">loghost.example.edu.au</systemitem>; using a
    <acronym>DNS</acronym> alias allows the log server to be moved
    without updating the configuration of all the remote machines.
    The local copy of the log message is no longer the only means of
    determining the cause of a system failure, so we can gain some
    performance advantage by disabling synchronous file writes,
    although this increases the odds of an inconsistent filesystem (an
    issue with filesystems that do not do journalling).  Placing a
    <literal moreinfo="none">-</literal> before the filename disables synchronous file
    writes.</para><figure float="0" id="security-messages-syslogconf"><title><filename moreinfo="none">/etc/syslog.conf</filename> modified to copy log
     messages to a log server</title><programlisting format="linespecific"># Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none  @loghost.example.edu.au
*.info;mail.none;authpriv.none;cron.none  -/var/log/messages

# The authpriv file has restricted access.
authpriv.*                                @loghost.example.edu.au
authpriv.*                                /var/log/secure

# Log all the mail messages in one place.
mail.*                                    @loghost.example.edu.au
mail.*                                    -/var/log/maillog

# Log cron stuff
cron.*                                    @loghost.example.edu.au
cron.*                                    -/var/log/cron

# Everybody gets emergency messages
*.emerg                                   @loghost.example.edu.au
*.emerg                                   *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                            @loghost.example.edu.au
uucp,news.crit                            -/var/log/spooler

# Save boot messages also to boot.log
local7.*                                  @loghost.example.edu.au
local7.*                                  -/var/log/boot.log</programlisting></figure><para>A log server is configured using the standard
    <filename moreinfo="none">/etc/syslog.conf</filename> configured to allow the
    reception of remote <application moreinfo="none">syslog</application> messages.
    This configuration for <productname class="trade">Red Hat Linux</productname> is
    shown in <xref linkend="security-messages-sysconfig"></xref>.  In
    addition to configuring the system log daemon, also prevent denial
    of service attacks by configuring <application moreinfo="none">IP
    Tables</application> to restrict the sources of the syslog
    messages; and also improve performance by checking that
    <application moreinfo="none">nscd</application> is running to cache reverse
    <acronym>DNS</acronym> lookups.</para><figure float="0" id="security-messages-sysconfig"><title>Allowing remote log messages by setting options in
     <filename moreinfo="none">/etc/sysconfig/syslog</filename></title><programlisting format="linespecific"># Red Hat Linux default value, does not write timer mark messages
SYSLOGD_OPTIONS="-m 0"
# Add option to accept remote syslog messages
SYSLOGD_OPTIONS="${SYSLOGD_OPTIONS} -r"</programlisting></figure><figure float="0" id="security-messages-iptables"><title>Restrict <application moreinfo="none">syslog</application> messages to
     <systemitem class="systemname" moreinfo="none">remote.example.edu.au</systemitem></title><screen format="linespecific"><prompt moreinfo="none"> bash#</prompt> <userinput moreinfo="none">chkconfig iptables on</userinput>
<prompt moreinfo="none"> bash#</prompt> <userinput moreinfo="none">/etc/init.d/iptables restart</userinput>
# Allow all IP traffic from this machine
<prompt moreinfo="none"> bash#</prompt> <userinput moreinfo="none">iptables --append INPUT --source 127.0.0.0/8 --in-interface lo --jump ACCEPT</userinput>
# Perhaps filter other traffic
ent
# Accept syslog messages from remote.example.edu.au
<prompt moreinfo="none"> bash#</prompt> <userinput moreinfo="none">iptables --append INPUT --source remote.example.edu.au --protocol udp --destination-port syslog -j ACCEPT</userinput>
# Silently drop unexpected syslog messages
<prompt moreinfo="none"> bash#</prompt> <userinput moreinfo="none">iptables --append INPUT --protocol udp --destination-port syslog -j DROP</userinput>
# Save the running configuration
<prompt moreinfo="none"> bash#</prompt> <userinput moreinfo="none">/etc/init.d/iptables save</userinput></screen></figure><figure float="0" id="security-messages-nscd"><title>Using <application moreinfo="none">nscd</application> to cache reverse
     <acronym>DNS</acronym> lookups</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <userinput moreinfo="none">chkconfig nscd on</userinput>
<prompt moreinfo="none">bash#</prompt> <userinput moreinfo="none">/etc/init.d/nscd restart</userinput></screen></figure></section><section id="security-mesasges-wall"><title>Restrict broadcast messages to the console</title><para>Users that are logged into the serial console should not
    accept broadcast messages.  Add new files to <filename class="directory" moreinfo="none">/etc/profile.d</filename> to do this.  <xref linkend="security-messages-shlong"></xref> shows a file for use by the
    Bourne shell.</para><figure float="0" id="security-messages-shlong"><title>Restrict sending of messages to console user</title><programlisting format="linespecific">#
# Do we have files referred to?
if [ -x /usr/bin/mesg -a -x /usr/bin/tty ]
then
  # Are we on serial console?
  if [ `/usr/bin/tty` = /dev/ttyS0 ]
  then
    # Do not accept broadcast messages
    /usr/bin/mesg n
  fi
fi</programlisting></figure><para>As this file is run frequently, we use a faster but less
    readable version of <xref linkend="security-messages-shlong"></xref>,
    shown in <xref linkend="security-messages-sh"></xref>.</para><figure float="0" id="security-messages-sh"><title>Restrict sending of messages to console user,
     <filename moreinfo="none">/etc/profile.d/mesg.sh</filename></title><programlisting format="linespecific">#
# /etc/profile.d/mesg.sh -- prevent people hassling the serial console user
[ -x /usr/bin/mesg -a -x /usr/bin/tty -a `/usr/bin/tty` = /dev/ttyS0 ] entent /usr/bin/mesg n</programlisting></figure><para>We also need a C shell version, shown in <xref linkend="security-messages-csh"></xref>.</para><figure float="0" id="security-messages-csh"><title>Restrict sending of messages to console user,
     <filename moreinfo="none">/etc/profile.d/mesg.csh</filename></title><programlisting format="linespecific">#
# /etc/profile.d/mesg.csh -- prevent people hassling the serial console user
if (-X mesg entent -X tty entent `tty` == /dev/ttyS0) then
  mesg n
endif</programlisting></figure><para>Although <filename moreinfo="none">mesg.sh</filename> and
    <filename moreinfo="none">mesg.csh</filename> are included by the parent shell
    rather than executed, the files need the execute permission
    set. The procedure in <xref linkend="security-messages-install"></xref>
    installs the files and sets the permissions.</para><figure float="0" id="security-messages-install"><title>Install files into <filename class="directory" moreinfo="none">/etc/profile.d</filename></title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">cp mesg.*sh /etc/profile.d/</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">chown root:root /etc/profile.d/mesg.*sh</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">chmod u=rwx,g=rx,o=rx /etc/profile.d/mesg.*sh</command></screen></figure></section></section><section id="security-modem"><title>Modem features to restrict usage</title><para>Most modems support the addition of a password.  This is not
   particularly useful as it has the same strengths and weaknesses of
   all other password authentication schemes.  We already have
   password authentication in the <acronym>BIOS</acronym>, in the boot
   loader and in <application moreinfo="none">login</application>.</para><para>Many modems support call-back.  The modem is called and a few
   seconds after hang-up it calls a pre-configured number.  This
   limits the locations that can gain access to the console. </para><para>Many modems support checking the calling line identification
   (CLI) against a predefined list.  If the calling number is not on
   the list then the call is cleared.  The phone line to the modem
   must be configured to send CLI, this may incur an additional charge
   from the phone company.  Not all calling phones can send CLI and
   some valid callers may have asked their phone company to suppress
   the sending of CLI.</para><para>Many modems can be configured to log the calling line
   identification.  This is useful when tracing misuse.</para><para>Many modems support encryption.  Some modems allow multiple
   keys.  This gives a neat solution: only authorized modems can dial
   in, but they can do so from any location.  The modems usually need
   to be of the same make, and perhaps of the same model.</para><warning id="warning-crypto"><title>Encryption dual-use technology</title><para>Possessing, using, buying, selling, importing or exporting
    modems with encryption features is a serious criminal offense in
    some countries.</para><para>You must acquiant yourself with the laws in your
    jurisdiction and the laws of jurisdictions you may travel
    through.</para></warning><para>Many telephone services or <acronym>PBX</acronym> lines can
   be set to allow only incoming calls.  This is useful as it prevents
   misuse of the modem should the computer be compromised.  A
   entdemon diallerent can call many numbers seeking an
   answering modem and the cost of these calls can be
   significant.</para></section><section id="security-bios"><title><acronym>BIOS</acronym> features</title><para>Most <acronym>BIOS</acronym>s can be configured with a
   entconfiguration passwordent.  This should set and tested.
   Some motherboards will require a jumper to be set to allow the
   password to take effect.  Some <acronym>BIOS</acronym>s have
   well-known entmaster passwordsent, use a search engine to
   ensure that your <acronym>BIOS</acronym> is not one of these.  The
   password should not be the same as the boot loader or <systemitem class="username" moreinfo="none">root</systemitem> passwords.</para><para>The <acronym>BIOS</acronym> configuration will have a
   entboot orderent setting.  It should be set to boot from
   the hard disk before any other media.  This prevents someone
   inserting a rescue diskette, booting the machine, and gaining
   access to the filesystems as <systemitem class="username" moreinfo="none">root</systemitem>.</para></section><section id="security-bootloader"><title>Use a boot loader password</title><para>Configure the boot loader to request a password when booting a
   non-default image or when supplying parameters from the command
   line.</para><para>This prevents someone from dialing in during the boot
   sequence and booting the kernel with options to take control of the
   machine, as in <xref linkend="configure-boot-loader-lilo-hack"></xref>.</para><para>The password should not be the same as the
   <acronym>BIOS</acronym> or <systemitem class="username" moreinfo="none">root</systemitem> passwords.</para></section><section id="security-rhl-prompt"><title>Non-interactive boot sequence</title><para><productname class="trade">Red Hat Linux</productname> has an
   entinteractive bootent option that can be used to prevent
   services from being started.  This may not be pleasant if the
   purpose of the machine is web serving and the
   <acronym>HTTP</acronym> daemon is interactively prevented from
   starting by an unauthenticated person.</para><para>Edit <filename moreinfo="none">/etc/sysconfig/init</filename> to contain the
   line</para><informalfigure float="0"><programlisting format="linespecific">PROMPT=no</programlisting></informalfigure></section><section id="security-sysrq"><title>Magic <keycap moreinfo="none">SysRq</keycap> key</title><para>The entmagic <keycap moreinfo="none">SysRq</keycap> keyent is a key
   sequence that allows some basic commands to be passed directly to
   the kernel.  Kernel software developers use this interface to debug
   their software.  Under most circumstances it can also be used to
   uncleanly reboot the computer, something that is otherwise
   difficult or expensive to do remotely.</para><para>For computers that are not used for kernel software
   development the magic <keycap moreinfo="none">SysRq</keycap> key makes an ideal
   denial of service device.  A few unauthenticated keystrokes and the
   computer is dead in the water.  The console, serial or otherwise,
   must be in an area with access limited to trusted people.</para><para>The serial console uses the <acronym>RS-232</acronym> break
   function as the entmagic <keycap moreinfo="none">SysRq</keycap> keyent.  A
   entbreakent is a period of no transmission on the serial
   line, on traditional terminals it is activated by pressing a key
   labeled <keycap moreinfo="none">Break</keycap>.</para><para>Anyone can dial into a modem and send a break, so if the
   serial console is attached to a modem we need to disable the magic
   <keycap moreinfo="none">SysRq</keycap> key .  If the serial console is attached to
   a terminal server which asks for authentication, or is attached
   directly to another terminal using a null modem cable then you may
   decide to activate the magic <keycap moreinfo="none">SysRq</keycap> key.</para><para>The magic <keycap moreinfo="none">SysRq</keycap> key can be disabled by
   setting a kernel variable or by not compiling support for the
   key.</para><para>Writing a <literal moreinfo="none">0</literal> into
   <filename moreinfo="none">/proc/sys/kernel/sysrq</filename> will disable the magic
   <keycap moreinfo="none">SysRq</keycap> key.  The command <command moreinfo="none">sysctl</command>
   can also be used:</para><figure float="0" id="security-sysrq-sysctl"><title>Using <command moreinfo="none">sysctl</command> to defeat the magic
    <keycap moreinfo="none">SysRq</keycap> key</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">sysctl -w kernel.sysrq=0</command></screen></figure><para>Your Linux distribution may have a file
   <filename moreinfo="none">/etc/sysctl.conf</filename> which is used to run
   <command moreinfo="none">sysctl</command> during the boot of the machine.  Add the
   lines:</para><figure float="0" id="security-sysrq-sysctlconf"><title>Configuring <filename moreinfo="none">/etc/sysctl.conf</filename> to defeat
    the magic <keycap moreinfo="none">SysRq</keycap> key</title><programlisting format="linespecific"># Disables the magic SysRq key
kernel.sysrq = 0</programlisting></figure><para>Even when setting the magic <keycap moreinfo="none">SysRq</keycap> key off in
   <filename moreinfo="none">/etc/sysctl.conf</filename> there is a period of
   vulnerability after the kernel boots but before contents of the
   file are applied.</para><para>It is much better to compile your own kernel and set the
   following configuration parameter:</para><figure float="0" id="security-sysrq-menuconfig"><title>Kernel <command moreinfo="none">make menuconfig</command> showing disabled
    <keycap moreinfo="none">SysRq</keycap> key</title><screen format="linespecific">Kernel hacking  ---ent
 [ ] Magic SysRq key</screen></figure><para>This should place the following configuration parameter in
    <filename moreinfo="none">/usr/src/linux/.config</filename>.</para><figure float="0" id="security-sysrq-dotconfig"><title>Kernel <filename moreinfo="none">.config</filename> showing disabled
    <keycap moreinfo="none">SysRq</keycap> key</title><programlisting format="linespecific"># CONFIG_MAGIC_SYSRQ is not set</programlisting></figure></section><section id="security-ctrlaltdel"><title>Adjust behaviour of <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo></title><para>The <productname class="trade">IBM PC</productname> used <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo> to launch a reboot of the computer.  Linux traps this
   key chord and makes it available to the
   <application moreinfo="none">init</application> system.  This is done by sending
   the <application moreinfo="none">init</application> process a
   <literal moreinfo="none">SIGINT</literal> signal (although <command moreinfo="none">ctrlaltdel
   hard</command> can undo this trap and make the key chord reboot the
   comptuer immediately).  The <application moreinfo="none">init</application> system
   uses <filename moreinfo="none">/etc/inittab</filename> to determine how to handle
   the signal generated by the <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo> key
   chord.</para><para>Most distributions cleanly reboot the system, mimicing the
   behaviour that most users expect.  <xref linkend="security-ctrlaltdel-telinit-default"></xref> shows how this is
   done.</para><figure float="0" id="security-ctrlaltdel-telinit-default"><title>Default handling of <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo> in
    <filename moreinfo="none">/etc/inittab</filename></title><programlisting format="linespecific"># Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now</programlisting></figure><para>Depending upon each individual site you may wish to disable
   <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo>.  This is shown in <xref linkend="security-ctrlaltdel-telinit-ignore"></xref>.</para><figure float="0" id="security-ctrlaltdel-telinit-ignore"><title>Ignoring <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo> in
    <filename moreinfo="none">/etc/inittab</filename></title><programlisting format="linespecific"># Trap CTRL-ALT-DELETE and do nothing
ca::ctrlaltdel:</programlisting></figure><para>Alternatively, you may wish to cleanly shut down the
   computer.  This is very easy to explain to operators and
   instructions can be displayed on the monitor using
   <filename moreinfo="none">/etc/issue</filename> or a <productname class="trade">Post-it
   Note</productname>.  If the computer uses <productname class="trade">Advanced
   Power Management</productname> (or <acronym>APM</acronym>) then
   shutting down the computer will also remove the power.</para><figure float="0" id="security-ctrlaltdel-telinit-halt"><title>Shut down cleanly upon  <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Delete</keycap></keycombo> in
    <filename moreinfo="none">/etc/inittab</filename></title><programlisting format="linespecific"># Trap CTRL-ALT-DELETE and shut down
ca::ctrlaltdel:/sbin/shutdown -t3 -h now</programlisting></figure></section><section id="security-log"><title>Log attempted access</title><para>Look in the system logs for the output of
   <application moreinfo="none">getty</application>.  Add the monitoring of these
   messages to your log-watching procedures.</para></section><section id="security-interception"><title>Countering interception of telephony links</title><para>Modems calls over telephones can be intercepted.  This can be
   an issue if you do not trust a telecommunications carrier in your
   call's path, or if you do not trust the law enforcement agencies
   that may request interception facilities from that carrier.</para><para>International calls are particularly exposed.  Calls which
   are routed across satellite or wireless links can be intercepted by
   readily-available radio receivers.  Calls routed across undersea
   links are much more expensive to intercept, so this is probably
   limited to national governments, such as those using the <ulink url="http://cryptome.org/cryptout.htm#Echelon">Echelon
   system</ulink>.</para><para>If you do not pass sensitive data over the link, then the
   major exposure is typing in your user name and password.  Look into
   <ulink url="http://freshmeat.net/projects/pam_skey/"><application moreinfo="none"><acronym>S/KEY</acronym></application></ulink>
   or look into <ulink url="http://inner.net/opie/"><application moreinfo="none"><acronym>OPIE</acronym></application></ulink>
   and its related <ulink url="http://www.tho.org/~andy/pam-opie.html"><application moreinfo="none">An
   <acronym>OPIE</acronym> for
   <acronym>PAM</acronym></application></ulink>.</para><para>These one-time password systems have flaws, a good summary of
   these is <citetitle>Vulnerabilities in the
   <productname class="trade"><acronym>S/KEY</acronym></productname> one time
   password system</citetitle> by Peiter entmudgeent
   Zatko.</para><warning id="security-interception-keys"><title>Cryptographic key material</title><para>Possessing cryptographic key material, such as a one-time
    password generator or list of one-time passwords, is a serious
    criminal offense in some countries.</para><para>You must acquiant yourself with the laws in your
    jurisdiction and the laws of jurisdictions you may travel
    through.</para></warning><warning id="security-interception-law"><title>Defeating telecommunications interception</title><para>Taking steps to defeat or avoid legislatively-approved
    telecommunications interception is a serious criminal offense in
    some countries.</para><para>You must acquiant yourself with the laws in your
    jurisdiction and the laws of jurisdictions you may travel
    through.</para></warning></section></chapter><chapter id="kernelcompile"><title>Configuring a kernel to support serial console</title><para>Most <systemitem class="osname" moreinfo="none">Linux</systemitem> kernels
  shipped by distributors are configured to allow the serial console
  to be enabled.  However system administrators will almost certainly
  encounter some problems best solved by recompiling a kernel.  In
  these cases configure the kernel to support the serial console.  The
  usual virtual terminal console is also configured, as we normally
  want console messages to go a monitor as well as the serial
  port.</para><section id="kernelcompile-25"><title>Linux kernel version 2.5</title><para>Kernel version 2.5 is under active development, so this
   section may be out of date.  Version 2.5 includes support for the
   console to a serial port attached to a USB dongle.  The
   <literal moreinfo="none">-dj</literal> patch to the version 2.5 kernel has a
   rewritten console layer; it is not known if the rewritten layer
   effects the user-space use of the serial console.</para><para>When configuring the kernel set the following configuration
   parameters:</para><figure float="0" id="kernelcompile-25-menuconfig"><title>Kernel configuration for serial console using <command moreinfo="none">make
    menuconfig</command></title><screen format="linespecific">Character devices  entententent
 [*] Virtual terminal
  [*]   Support for console on virtual terminal
 ent*ent Standard/generic (8250/16550 and compatible UARTs) serial support
  [*]   Support for console on serial port</screen></figure><para>This should set the following configuration parameters in
   <filename moreinfo="none">/usr/src/linux/.config</filename>.</para><figure float="0" id="kernelcompile-25-dotconfig"><title>Kernel configuration for serial console using
   <filename moreinfo="none">.config</filename></title><programlisting format="linespecific">CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y</programlisting></figure><para>If you also want to use a serial port attached to a
   <acronym>USB</acronym> bus, then in addition to the usual
   <acronym>USB</acronym> configuration, configure the kernel to load
   the <acronym>USB</acronym> console driver and one of the
   <acronym>USB</acronym> serial dongles (our example uses the generic
   serial dongle).</para><figure float="0" id="kernelcompile-25-usb-menuconfig"><title>Kernel configuration for <acronym>USB</acronym> dongle
    serial console using <command moreinfo="none">make menuconfig</command></title><screen format="linespecific">USB Serial Converter support entententent
 entMent USB Serial Converter support
 [M] USB Serial Console device support
 [M] USB Generic Serial Driver</screen></figure><para>This should set the following configuration parameters in
   <filename moreinfo="none">/usr/src/linux/.config</filename></para><figure float="0" id="kernelcompile-25-usb-dotconfig"><title>Kernel configuration for <acronym>USB</acronym> dongle
    serial console using <filename moreinfo="none">.config</filename></title><programlisting format="linespecific">CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_CONSOLE=m
CONFIG_USB_SERIAL_GENERIC=m</programlisting></figure><para>You should also configure the kernel without the magic
   <keycap moreinfo="none">SysRq</keycap> key, as described in <xref linkend="security-sysrq"></xref>.</para></section><section id="kernelcompile-24"><title>Linux kernel version 2.4</title><para>When configuring the kernel set the following configuration
   parameters:</para><figure float="0" id="kernelcompile-24-menuconfig"><title>Kernel configuration for serial console using <command moreinfo="none">make
    menuconfig</command></title><screen format="linespecific">Character devices  entententent
 [*] Virtual terminal
  [*]   Support for console on virtual terminal
 ent*ent Standard/generic (8250/16550 and compatible UARTs) serial support
  [*]   Support for console on serial port</screen></figure><para>This should set the following configuration parameters in
   <filename moreinfo="none">/usr/src/linux/.config</filename>.</para><figure float="0" id="kernelcompile-24-dotconfig"><title>Kernel configuration for serial console using
   <filename moreinfo="none">.config</filename></title><programlisting format="linespecific">CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_SERIAL_CONSOLE=y</programlisting></figure><para>You should also configure the kernel without the magic
   <keycap moreinfo="none">SysRq</keycap> key, as described in <xref linkend="security-sysrq"></xref>.</para></section><section id="kernelcompile-22"><title><systemitem class="osname" moreinfo="none">Linux</systemitem> kernel version
   2.2</title><para>The later <systemitem class="osname" moreinfo="none">Linux</systemitem> 2.2
   kernels use the same build parameters and parameter syntax as the
   <systemitem class="osname" moreinfo="none">Linux</systemitem> version 2.4
   kernels.</para><para>For earlier kernels see the <ulink url="http://www.linuxjournal.com/article.php?sid=2040">article</ulink>
   by Francesco Conti in issue 36 of <ulink url="http://www.linuxjournal.com/"><citetitle>Linux
   Journal</citetitle></ulink> published in April 1997.</para><para>This article included some patches for the kernel, which have
   been extended in the notes below to use a broader range of serial
   port speeds.</para><para>Choose to use the serial console by adding a couple of
   <literal moreinfo="none">#defines</literal> at the start of
   <filename moreinfo="none">/usr/src/linux/drivers/char/console.c</filename>:</para><informalfigure float="0"><programlisting format="linespecific">#define CONFIG_SERIAL_ECHO
#define SERIAL_ECHO_PORT 0x3f8  /* COM1 port address */</programlisting></informalfigure><para>Alternatively, to use <literal moreinfo="none">ttyS1</literal> use these
   lines:</para><informalfigure float="0"><programlisting format="linespecific">#define CONFIG_SERIAL_ECHO
#define SERIAL_ECHO_PORT 0x2f8  /* COM2 port address */</programlisting></informalfigure><para>The kernel assumes a serial link speed of
   9600<abbrev>bps</abbrev>.  If you are using a differing bit rate
   then find these two lines:</para><informalfigure float="0"><programlisting format="linespecific">serial_echo_outb(0x00, UART_DLM); /* 9600 baud */
serial_echo_outb(0x0c, UART_DLL);</programlisting></informalfigure><para>and change <literal moreinfo="none">0x0c</literal> to one of the values in
   <xref linkend="kernelcompile-22-divisors"></xref>.</para><table frame="topbot" colsep="0" rowsep="0" id="kernelcompile-22-divisors"><title><acronym>IBM-PC/AT</acronym> serial port bit rates and
    their bit-clock divisors</title><tgroup cols="2"><colspec colname="bps" colsep="0" rowsep="0" align="center"></colspec><colspec colname="divisor" colsep="0" rowsep="0" align="center"></colspec><thead><row rowsep="1" valign="bottom"><entry colname="bps" align="center">Bit Rate</entry><entry colname="divisor" align="center">Divisor</entry></row></thead><tbody><row><entry colname="bps">115200<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x01</literal></entry></row><row><entry colname="bps">57600<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x02</literal></entry></row><row><entry colname="bps">38400<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x03</literal></entry></row><row><entry colname="bps">19200<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x06</literal></entry></row><row><entry colname="bps">9600<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x0c</literal></entry></row><row><entry colname="bps">4800<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x18</literal></entry></row><row><entry colname="bps">2400<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x30</literal></entry></row><row><entry colname="bps">1200<abbrev>bps</abbrev></entry><entry colname="divisor"><literal moreinfo="none">0x60</literal></entry></row></tbody></tgroup></table></section></chapter><chapter id="serial"><title>Serial cabling</title><section id="serial-jargon"><title>Jargon</title><para><acronym>RS-232</acronym> cables were originally intended to
   link terminals to modems.  The terminal is formally named a Data
   Terminal Equipment, abbreviated to <acronym>DTE</acronym>.  The modem
   is formally named a Data Communications Equipment, abbreviated to
   <acronym>DCE</acronym>.</para><para>A standard <acronym>RS-232</acronym> cable has a 25-pin
   D-type socket, which connects to the <acronym>DTE</acronym>, and a
   25-pin D-type plug, which connects to the <acronym>DCE</acronym>.
   All 25 pins are connected, with pin 1 on the plug wired to pin 1 on
   the socket, pin 2 on the plug wired to pin 2 on the socket, and so
   on.  The shielding of the cable is attached to the metallic cover
   on the socket.</para><para><acronym>RS-232</acronym> signaling is much more robust than
   the signalling of many other communications standards.  Pins can be
   shorted, not connected or drive more than one output.</para><para>Signals are named from the point of view of the Data Terminal
   Equipment.  So Transmit Data on the <acronym>DTE</acronym> is
   connected to Transmit Data on the <acronym>DCE</acronym>.  The
   Transmit Data pin on the <acronym>DTE</acronym> actually transmits
   data, whereas Transmit Data pin on the <acronym>DCE</acronym>
   actually recieves data.</para></section><section id="serial-pc-modem"><title>Cable from console port to modem</title><para>The <acronym>RS-232</acronym> standard defines the
   interconnection of computers and modems, so there is little to go
   wrong here by simply purchasing a pre-assembled cable.  There are
   two types of cable: cables with connectors for a standard 25-pin D
   connector on the computer; and cables with connectors for a
   proprietary 9-pin D connector used on the <acronym>IBM</acronym>
   <productname class="trade"><acronym>PC/AT</acronym></productname> and many other
   computers.  The cables have titles like
   <citetitle><acronym>RS-232</acronym> 25-pin computer
   (<acronym>DTE</acronym>) to 25-pin modem
   (<acronym>DCE</acronym>)</citetitle> or
   <citetitle><acronym>RS-232</acronym> 9-pin <acronym>IBM</acronym>
   <productname class="trade"><acronym>PC/AT</acronym></productname> computer
   (<acronym>DTE</acronym>) to 25-pin modem
   (<acronym>DCE</acronym>)</citetitle>.  Most modems are packaged
   with a suitable cable.</para><para>If you need to manufacture your own cables, see the
   <citetitle>Serial-HOWTO</citetitle> for the
   <acronym>RS-232</acronym> pinout for your computer.  Connect
   Transmit Data on the computer to Transmit Data on the modem,
   Receive Data on the computer to Receive Data on the modem, and so
   on for Signal Ground, Clear to Send, Ready to Send, Data Set Ready,
   Data Terminal Ready and Data Carrier Detect.</para><para>For professional computer room installations consider routing
   the serial cable through an <acronym>RJ-45</acronym> patch panel.
   There are two common pinouts on used on the
   <acronym>RJ-45</acronym> connector: <ulink url="http://yost.com/Computers/RJ45-serial/">Yost</ulink> and
   <ulink url="http://www.cisco.com/warp/public/701/14.html">Cisco
   2500-series</ulink>.</para><para>If you create your own pinout for unshielded twisted pair
   cable then be sure that your pinout twists a Signal Ground wire
   with the Transmit Data wire and another Signal Ground wire with the
   Receive Data wire.  Although the <acronym>RS-232</acronym> signals
   are not balanced, this twist will result in the least amount of
   signal degradation and noise pickup.</para></section><section id="serial-pc-terminal"><title>Cable from console port to terminal (or another PC)</title><para>The <acronym>RS-232</acronym> standard allows for, but does
   not specify, the interconnection of two computers without
   intervening modems.  A special cable is required, called a
   entnull modement cable.</para><para>The wiring within the null modem cable depends upon the
   handshaking and control signals that are needed.  Differing
   manufacturers have differing views on this topic, so don't buy a
   null modem cable that does not come with a wiring diagram.</para><para>Linux needs all of the flow control and modem control signals
   to be correctly wired.  The correct wiring of a null modem cable is
   shown in <xref linkend="serial-pc-terminal-cable-good1"></xref> with an
   alternative shown in <xref linkend="serial-pc-terminal-cable-good2"></xref>.</para><para>Linux uses <acronym>CTS</acronym> and <acronym>RTS</acronym> to
   do handshaking, preventing the computer from overrunning the
   terminal and preventing the terminal from overrunning the computer.
   If you are connecting two computers together, then you will not get
   reliable file transfers without
   <acronym>CTS</acronym>/<acronym>RTS</acronym> handshaking.</para><para>Linux uses <acronym>DSR</acronym> and <acronym>DCD</acronym> to
   sense that a terminal is connected.  It will then request a login.
   If a session is established and <acronym>DCD</acronym> falls then
   Linux will log out the user.</para><para>Linux uses <acronym>DTR</acronym> to force the link to be
   cleared.  It does this after a user logs off to free up the
   communications channel.</para><para>Either of the null modem designs in <xref linkend="serial-pc-terminal-cable-good1"></xref> or <xref linkend="serial-pc-terminal-cable-good2"></xref> meets the requirements of
   the Linux kernel.  <xref linkend="serial-pc-terminal-cable-good2"></xref>
   may be marginally better when both computers are remotely located,
   as the differing states of <acronym>DSR</acronym> and
   <acronym>DCD</acronym> can be used to determine which end of the
   null modem cable has become faulty.</para><para>All null modem designs have a common flaw.  Computers
   interconnected with real modems modem will drop Data Set Ready for
   some time after the local modem is reset by the local computer
   dropping Data Terminal Ready.  Most software is designed to
   accomodate this slight difference between modem links and null
   modem links.</para><para>Major security exposures and significant loss of reliability
   can occur with incorrectly wired null modem cables, including the
   cables in <xref linkend="serial-pc-terminal-cable-bad"></xref>, <xref linkend="serial-pc-terminal-cable-ugly1"></xref> and <xref linkend="serial-pc-terminal-cable-ugly2"></xref>.</para><figure float="1" pgwide="1" id="serial-pc-terminal-cable-good1"><title>Null modem cable with full status and handshaking</title><programlisting format="linespecific">      Signal ground ---------------------- Signal ground

       Receive data ---------------------- Transmit data

      Transmit data ---------------------- Receive data

      Ready to send ---------------------- Clear to send

      Clear to send ---------------------- Ready to send

Data terminal ready -----------------+---- Data carrier detect
                                     |
                                     +---- Data set ready

Data carrier detect ----+----------------- Data terminal ready
                        |
     Data set ready ----+

    Ring indication -- not connected

                          not connected -- Ring indication</programlisting></figure><figure float="1" pgwide="1" id="serial-pc-terminal-cable-good2"><title>Variation on null modem cable with full status and
    handshaking</title><programlisting format="linespecific">      Signal ground ---------------------- Signal ground

       Receive data ---------------------- Transmit data

      Transmit data ---------------------- Receive data

      Ready to send ---------------------- Clear to send

      Clear to send ---------------------- Ready to send

Data terminal ready ----+----------------- Data carrier detect
                        |
     Data set ready ----+

                                     +---- Data set ready
                                     |
Data carrier detect ----+------------+---- Data terminal ready

    Ring indication -- not connected

                          not connected -- Ring indication</programlisting></figure><para>Unfortunately not all <systemitem class="osname" moreinfo="none">Linux</systemitem> boot loaders support the control
   signals required by the <systemitem class="osname" moreinfo="none">Linux</systemitem> operating system.  This odd state
   of affairs may force you to do away with control signals and
   handshaking if you need to issue commands to the boot
   loader.</para><para>There are two ways of defeating the <acronym>RS-232</acronym>
   handshaking: software and hardware.</para><para>If you have a modem then by far the best technique is to
   disable the control signals and handshaking by using
   <acronym>AT</acronym> commands to configure the modem's software.
   This allows the handshaking to be restored when the boot loader
   authors correct their support for serial connections.</para><para>For a null modem cable the best approach is to disable
   handshaking in your terminal emulation software.</para><para>In the worst case for a null modem you will need a cable that
   falsifies the handshaking and control signals.  Try not to use
   these cables in a production environment.</para><figure float="1" pgwide="1" id="serial-pc-terminal-cable-bad"><title>Null modem cable with falsified status and
    handshaking</title><programlisting format="linespecific">      Signal ground ---------------------- Signal ground

       Receive data ---------------------- Transmit data

      Transmit data ---------------------- Receive data

Data terminal ready ---+              +--- Data terminal ready
                       |              |
      Clear to send ---+              +--- Clear to send
                       |              |
Data carrier detect ---+              +--- Data terminal ready
                       |              |
     Data set ready ---+              +--- Data set ready

      Ready to send -- not connected

                          not connected -- Ready to send

    Ring indication -- not connected

                          not connected -- Ring indication</programlisting></figure><para>If you are happy with a quick hack, perhaps just to use a
   serial console to grab a kernel oops message, then you can
   configure some <application moreinfo="none">getty</application> programs to ignore
   the <acronym>RS-232</acronym> status signals.  For example,
   <application moreinfo="none">mgetty</application> has the <literal moreinfo="none">direct</literal>
   option in <filename moreinfo="none">mgetty.conf</filename>.  In this case only a
   three-wire or two-wire <acronym>RS-232</acronym> null modem cable
   is needed.</para><figure float="1" pgwide="1" id="serial-pc-terminal-cable-ugly1"><title>Null modem cable with no status or handshaking</title><programlisting format="linespecific">Signal ground ---------------------- Signal ground

 Receive data ---------------------- Transmit data

Transmit data ---------------------- Receive data</programlisting></figure><figure float="1" pgwide="1" id="serial-pc-terminal-cable-ugly2"><title>One-way null modem cable with no status or handshaking</title><programlisting format="linespecific">Signal ground ---------------------- Signal ground

Transmit data ---------------------- Receive data</programlisting></figure><para>Don't use these cables in a production environment.</para></section><section id="serial-distance"><title>Lengths of serial cables</title><para>The <acronym>RS-232</acronym> standard 9600bps port will
   drive 15 metres of shielded cable.  More precisely, an
   <acronym>RS-232</acronym> line driver will operate against a
   capacitance of up to 2500 picoFarad with low enough skew to allow a
   9600bps signal to be recovered.</para><para>If you select a cable with lower capacitance you can drive
   further distances.  For example,
   <citetitle><acronym>ANSI/TIA/EIA-568-A</acronym></citetitle>
   unshielded twisted pair category 5 cable has a maximum capacitiance
   of 55<acronym>pF</acronym> per metre, so this popular
   ent<acronym>UTP</acronym> cat 5ent cable can be safely
   driven up to 45m.  Beyond that you should check the cable
   manufacturers specifications for the actual entshunt
   capacitanceent (a common figure is 47.5
   <acronym>pF/m</acronym>, giving a maximum cable length of about
   50<acronym>m</acronym>).  However long runs of unshielded cable
   will pick up noise easily, as the <acronym>RS-232</acronym> signals
   are not balanced.  Some cable manufacturers offer shielded low
   capacitance cables which can be driven up to
   100<acronym>m</acronym>.</para><para>Similarly, if you select a lower data rate you can drive
   further distances.  <xref linkend="serial-manufacture-distance"></xref>
   shows the maximum distances over standard shielded cable at
   differing data rates.</para><table frame="topbot" colsep="0" rowsep="0" id="serial-manufacture-distance"><title>Data rates and the maximum distances recommended in
    <citetitle>RS-232</citetitle></title><tgroup cols="2"><colspec colname="bps" align="center"></colspec><colspec colname="m" align="center"></colspec><thead><row><entry colname="bps">Data rate (bps)</entry><entry colname="m">Distance (m)</entry></row></thead><tbody><row><entry colname="bps"><para>2400</para></entry><entry colname="m"><para>60</para></entry></row><row><entry colname="bps"><para>4800</para></entry><entry colname="m"><para>30</para></entry></row><row><entry colname="bps"><para>9600</para></entry><entry colname="m"><para>15</para></entry></row><row><entry colname="bps"><para>19200</para></entry><entry colname="m"><para>7.6</para></entry></row><row><entry colname="bps"><para>38400</para></entry><entry colname="m"><para>3.7</para></entry></row><row><entry colname="bps"><para>56000</para></entry><entry colname="m"><para>2.6</para></entry></row></tbody></tgroup></table><para>If you are comfortable in working beyond specifications then
   you might note that the experience of enterprise network operators
   has been that structured cabling layout in buildings is limited by
   the 100m distance limitation of fast ethernet over category 5
   cable, not by the practical distances achieved by RS-232
   asynchronous signals at 9600bps over category 5 cable.</para><para>For longer distances use an <acronym>RS-232</acronym> line
   driver; these will typically drive up to 2000 meters over category
   3 <acronym>UTP</acronym> cable.  For greater distances consider
   using fiber optical modems, the global telephony system, the mobile
   telephony system, satellite or radio.</para></section><section id="serial-manufacture"><title>Making serial cables</title><para>If you use a serial console for densely-racked computers you
   will end up making a lot of null-modem serial cables.  This section
   has some hints on making serial cables.  If you are making more
   than ten cables and live in a city you will probably find it
   economic to have the cables made by a specialty cabling
   firm.</para><para>Attempt to minimise noise in your cabling design.  Many BIOSs
   and boot loaders will wait forever if they receive a single
   character of line noise.  You might choose to use shielded UTP
   cables (these require special RJ-45 plugs but use standard RJ-45
   sockets).</para><para>If the environment has a lot of radio frequency noise then
   use traditional shielded cable and metal RS-232 connector shells.
   Connect the shield in the cable to the computer at
   <emphasis>one</emphasis> end.  This can be done by connecting the
   drain wire of the shield it to the Protective Ground (if present)
   or by soldering the drain wire to the shell of the connector.  If
   there is a substantial amount of noise also place a ferrite core
   over the shielded cable at both ends of the cable.  Follow the
   usual good practices of making the cable to the correct length and
   screwing home the D connectors into the chassis.</para><para>If you are making one of these cables and have some soldering
   skill, you can easily do the jumpering of the signal wires within
   the backshell of the <acronym>DB9</acronym> or
   <acronym>DB25</acronym> connector.</para><para>If you are making a large number of cables then crimping
   systems are much faster than soldering.  Again, pin jumpering can
   be done within the backshell.</para><para>No matter what system is adopted, use the Resistance setting
   of a multimeter to check for dead and shorted pins.  A minute here
   can save hours later.</para><para>For structured cabling systems, space is tight within
   <acronym>DB9/RJ-45</acronym> backshells, so the jumpering is better
   done behind the patch panel.  The <acronym>DB9/RJ-45</acronym>
   connectors present the <productname class="trade"><acronym>IBM</acronym>
   <acronym>PC</acronym></productname> pinout at the DB9 connector and
   present the Yost or Cisco pinout at the <acronym>RJ-45</acronym>
   connector.</para><caution id="caution-structuredcabling"><title>Incompatible devices in structured cabling systems</title><para>Take care to connect only <acronym>RS-232</acronym> devices
    to <acronym>RS-232</acronym> devices when patching structured
    cabling systems.  Other cables may be carrying ethernet,
    <acronym>ISDN</acronym>, telephony, alarm and
    <acronym>DC</acronym> power voltages.  Connecting incompatible
    voltages may destroy equipment.</para></caution></section></chapter><chapter id="modem"><title>Modem configuration</title><section id="modem-minicom"><title>Using <productname class="trade">Minicom</productname> to give commands to
   a modem</title><para><application moreinfo="none">Minicom</application> is a full-screen serial
   terminal emulation package, very much like the classic
   <application moreinfo="none">Telix</application> terminal emulator for
   <productname class="trade">MS-DOS</productname>.</para><para>Firstly, start <application moreinfo="none">Minicom</application> in
   configuration mode with the command:</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">minicom -o -s</command></screen></informalfigure><para>The following menu appears:</para><informalfigure float="0"><screen format="linespecific"><guimenuitem moreinfo="none">Filenames and paths</guimenuitem>
<guimenuitem moreinfo="none">File transfer protocols</guimenuitem>
<guimenuitem moreinfo="none">Serial port setup</guimenuitem>
<guimenuitem moreinfo="none">Modem and dialing</guimenuitem>
<guimenuitem moreinfo="none">Screen and keyboard</guimenuitem>
<guimenuitem moreinfo="none">Save setup as dfl</guimenuitem>
<guimenuitem moreinfo="none">Save setup as..</guimenuitem>
<guimenuitem moreinfo="none">Exit</guimenuitem>
<guimenuitem moreinfo="none">Exit from Minicom</guimenuitem></screen></informalfigure><para>Select <guimenuitem moreinfo="none">Serial port setup</guimenuitem> and
   set</para><informalfigure float="0"><screen format="linespecific"><guimenuitem moreinfo="none">A - Serial Device:</guimenuitem> <userinput moreinfo="none">/dev/ttyS0</userinput>
<guimenuitem moreinfo="none">B - Lockfile Location:</guimenuitem> <userinput moreinfo="none">/var/lock</userinput>
<guimenuitem moreinfo="none">C - Callin Program:</guimenuitem>
<guimenuitem moreinfo="none">D - Callout Program:</guimenuitem>
<guimenuitem moreinfo="none">E - Bps/Par/Bits:</guimenuitem> <userinput moreinfo="none">9600 8N1</userinput>
<guimenuitem moreinfo="none">F - Hardware Flow Control:</guimenuitem> <userinput moreinfo="none">Yes</userinput>
<guimenuitem moreinfo="none">G - Software Flow Control:</guimenuitem> <userinput moreinfo="none">No</userinput></screen></informalfigure><para>Now save the configuration</para><informalfigure float="0"><screen format="linespecific"><guilabel moreinfo="none">Give name to save this configuration?</guilabel>
<prompt moreinfo="none">ent</prompt> <userinput moreinfo="none">console</userinput></screen></informalfigure><para>and exit <application moreinfo="none">Minicom</application>.</para><para>To configure a modem use the command <command moreinfo="none">minicom -o
   console</command> to start Minicom without sending an
   initialization string to the modem.  Now issue the
   <literal moreinfo="none">AT</literal> commands to configure the modem.</para><para>When finished use the <guimenuitem moreinfo="none">Quit</guimenuitem> option
   to leave <application moreinfo="none">Minicom</application> without sending a reset
   string to the modem; this option is
   <keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">Q</keycap></keycombo>.</para><para>Sometimes <application moreinfo="none">Minicom</application> will use
   <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">A</keycap></keycombo> rather
   than <keycap moreinfo="none">Alt</keycap> to access the menu system, look for a
   hint in <application moreinfo="none">Minicom</application>'s start up
   message:</para><informalfigure float="0" id="modem-minicom-startup"><screen format="linespecific">Press ALT-Z for help on special keys</screen><screen format="linespecific">Press CTRL-A Z for help on special keys</screen></informalfigure></section><section id="modem-dumb"><title>Configure dumb modem</title><para>Linux, like most <productname class="trade">UNIX</productname>-like
   operating systems, expects a serial console to be connected to a
   dumb modem.  Dumb modems are not seen much these days, perhaps only
   on exotic hardware such as <acronym>ISDN</acronym> terminal adapters
   or satellite ground terminals.</para><para>A dumb modem is configured using hardware. <xref linkend="modem-dumb-front"></xref> shows the front panel of a fanciful
   dumb modem.  In reality the speed and mode settings are likely to
   be done using jumpers or DIP switches.</para><figure float="1" id="modem-dumb-front"><title>Front panel of a dumb modem</title><programlisting format="linespecific">+-----------------------------+
|                             |
|    SPEED       MODE         |
|  [ ]  300    [ ] Originate  |
|  [ ]  600    [X] Answer     |
|  [ ] 2400                   |
|  [X] 9600                   |
|                             |
+-----------------------------+</programlisting></figure><para>The modem's speed is set to the desired bit rate, in our case
   9600<abbrev>bps</abbrev>.  The modem's mode is set to Answer,
   that is, to wait for incoming calls and to answer them.</para><para>If the <acronym>RS-232</acronym> control line Data Terminal
   Ready is low, the modem will not answer a call.  The computer is
   off or the computer's serial interface is not yet initialized.
   Once <acronym>DTR</acronym> is high the modem will answer incoming
   calls.</para><para>Once an incoming call is established the modem raises the
   Data Carrier Detect control line.  Only when DCD is high is
   received data valid (data receieved from a dumb modem when DCD is
   not asserted is probably line noise).  Only when DCD is high is
   transmitted data passed through the link.</para><para><application moreinfo="none">getty</application> on the Linux computer has
   been waiting for <acronym>DCD</acronym> to come high, and
   <application moreinfo="none">getty</application> welcomes the user and requests
   them to log in.</para><para>Whilst the user is logged in and data is flowing, Clear to
   Send and Ready to Send are used between the modem and the computer
   to prevent data being sent too soon.  The computer lowers Clear to
   Send when it is too busy to receive a character.  The modem lowers
   Ready to Send when it is too busy to receive a character.</para><para>When the user hangs up, Data Carrier Detect falls and the
   hang up signal is sent to all processes associated with the dial in
   session.</para><para>Alternatively, the user can log out.  When the shell dies,
   the computer pulls Data Terminal Ready low, causing the modem to
   hang up.  When the <application moreinfo="none">getty</application> brings Data
   Terminal Ready high again, the modem will accept more incoming
   calls.</para><para>We have not yet described Data Set Ready.  This line is low
   if the modem is off or if the modem has not yet initialized.  When
   DSR is low all other signals from the modem are undefined.  For
   example, if DSR is low but DCD "floats" to the high voltage then
   software should behave as if DCD is not asserted.</para></section><section id="modem-hayes"><title>Configure modem with <acronym>AT</acronym> commands</title><para>Most modems today are smart modems based upon the Hayes
   modems and their command sets.  But as discussed above, the
   <systemitem class="osname" moreinfo="none">Linux</systemitem> serial console is
   designed to operate with a dumb modem.</para><para>Thus the smart modem is dumbed-down until it resembles a dumb
   modem.  Some expensive modems will have a <acronym>DIP</acronym>
   switch or board jumper to put them into dumb mode.</para><para>It is essential to have a manual for the modem which describes
   that modem's <literal moreinfo="none">AT</literal> commands.  Although most modems
   agree on the more popular <literal moreinfo="none">AT</literal> commands, they
   differ in the more technical commands.</para><section id="modem-hayes-bps"><title>Configure port speed</title><para>Hayes <acronym>AT</acronym>-style modems can maintain a
    static speed between the computer and the modem, no matter what
    speed the dialing modem uses.</para><para>For most modems this is set automatically based upon the
    speed of the first characters sent after power-on.</para><para>Power cycle the modem and connect to it with the command
    <command moreinfo="none">minicom -o console</command>.  Press
    <keycap moreinfo="none">Enter</keycap> a few times.  The modem should now be
    running at the same bit rate used by
    <application moreinfo="none">Minicom</application>, which we set to the speed of
    the serial console in <xref linkend="modem-minicom"></xref>.</para><para>You can check the port speed by asking the modem to generate
    some output.</para><figure float="0" id="modem-hayes-bps-ati"><title>Testing the modem's port speed</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">minicom -o console</command>
Welcome to minicom
Press CTRL-A Z for help on special keys

<keycap moreinfo="none">Enter</keycap> <keycap moreinfo="none">Enter</keycap> <keycap moreinfo="none">Enter</keycap>

<command moreinfo="none">ATI</command> <keycap moreinfo="none">Enter</keycap>
56k V.90 Series 3 External V2.20

<keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">A</keycap></keycombo> <keycap moreinfo="none">Q</keycap>
<guimenu moreinfo="none">Leave without reset?</guimenu> <guimenuitem moreinfo="none">Yes</guimenuitem></screen></figure><para>Some modems have an <acronym>AT</acronym> command to
    re-establish the port speed, look in your modem's manual for the
    <command moreinfo="none">ATentB1</command> command.  Some modems have a command
    to explicitly set the port speed, look in you modem's manual for
    the <command moreinfo="none">ATB</command> command.</para></section><section id="modem-hayes-answer"><title>Configure answer mode</title><para>The modem will answer an incoming call on the second ring
    using the command <command moreinfo="none">ATS0=2</command>.</para><para>Don't answer the phone on the first ring as this may
    invalidate the certification of the modem in some telephony
    jurisdictions.</para></section><section id="modem-hayes-ctsrts"><title>Configure <acronym>CTS</acronym>/<acronym>RTS</acronym> handshaking</title><para><acronym>CTS</acronym>/<acronym>RTS</acronym> handshaking
    prevents lost characters.</para><para>The <literal moreinfo="none">AT</literal> command is
    <command moreinfo="none">ATentK3</command>.</para></section><section id="modem-hayes-dcd"><title>Configure Data Carrier Detect</title><para>Data Carrier Detect should follow the presence or absence of
    a calling modem.</para><para>The <acronym>AT</acronym> command is
    <command moreinfo="none">ATentC1</command>.</para></section><section id="modem-hayes-dtr"><title>Configure Data Terminal Ready</title><para>Data Terminal Ready should control the modem.  If
    <acronym>DTR</acronym> is high the modem is ready to receive calls.
    If <acronym>DTR</acronym> is low the modem should not receive any
    more calls and should hang up any existing call.</para><para>The <acronym>AT</acronym> command is
    <command moreinfo="none">ATentD2</command>.</para></section><section id="modem-hayes-connect"><title>Configure no <computeroutput moreinfo="none">CONNECT</computeroutput>
    messages</title><para>A Hayes <acronym>AT</acronym>-style modem usually outputs a
    message when a call is received.  For example:</para><informalfigure float="0" id="modem-hayes-connect-example"><screen format="linespecific"><computeroutput moreinfo="none">CONNECT 9600</computeroutput></screen></informalfigure><para>The modem has a entquiet modeent that disables these
    messages.</para><para>The <acronym>AT</acronym> command is
    <command moreinfo="none">ATQ1</command>.  There will be no
    <computeroutput moreinfo="none">OK</computeroutput> printed in response to this
    command.</para></section><section id="modem-hayes-echo"><title>Configure no echo of commands</title><para>Echoing commands can confuse the console, so turn off
    command echoing.</para><para>The <literal moreinfo="none">AT</literal> command is
    <command moreinfo="none">ATE0</command>.</para></section><section id="modem-hayes-speaker"><title>Optionally, configure silent connection</title><para>Most modems have a speaker.  By default this is connected
    whilst a modem is connecting and negotiating a common protocol and
    speed.  This is very useful for a dialing modem, as it prevents a
    human being accidentally repeatedly called.  The speaker can be
    annoying on answering modems.</para><para>If a quieter computer room is desirable, use the
    <command moreinfo="none">ATM0</command> command to turn off the speaker.</para></section><section id="modem-hayes-dtrdrop"><title>Optionally, configure DTR delay</title><para>Data Terminal Ready drops when the semiconductor that
    supports the <acronym>RS-232</acronym> link is reset.  This then
    hangs up the modem.  This can be annoying.  If the
    <application moreinfo="none">getty</application> supports a parameter similar to
    <application moreinfo="none">mgetty</application>'s
    <literal moreinfo="none">toggle-dtr-waittime</literal> then it is possible to
    extend the time that the modem will ignore <acronym>DTR</acronym>.
    The time that <application moreinfo="none">getty</application> holds
    <acronym>DTR</acronym> low to force a hang up is extended beyond the
    modem's setting.  The result is that resetting the semiconductor
    does not hang up the modem, but <application moreinfo="none">getty</application>
    can still hang up the modem at the end of a login session.</para><para>Check your modem's documentation.  Our example modem uses
    S-register 25 to contain the threshold for noticing a change in
    <acronym>DTR</acronym>.  The value is in one-hundreds of a second.
    By setting the modem with <command moreinfo="none">ATS25=150</command> (1.5
    seconds) and setting <application moreinfo="none">mgetty</application> with
    <literal moreinfo="none">toggle-dtr-waittime 2000</literal> (2 seconds) we ignore
    small blips in <acronym>DTR</acronym>.</para></section><section id="modem-hayes-attention"><title>Configure no attention sequence</title><para>Once the modem is correctly configured and works well,
    disable the <literal moreinfo="none">+++</literal> sequence that gives access to
    the modem's command mode.</para><para>The <acronym>AT</acronym> command is
    <command moreinfo="none">ATS2=255</command>.</para><para>If this command is accidentally given see <xref linkend="modem-hayes-reset"></xref> to reset the modem to its factory
    default parameters and start again.</para></section><section id="modem-hayes-example"><title>Configuration example</title><figure float="0" id="modem-hayes-example-config"><title>Configure modem using <acronym>AT</acronym>
     commands</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">minicom -o console</command>
<computeroutput moreinfo="none">Welcome to minicom
Press CTRL-A Z for help on special keys</computeroutput>

<command moreinfo="none">AT entF</command> <keycap moreinfo="none">Enter</keycap>
<computeroutput moreinfo="none">OK</computeroutput>

<command moreinfo="none">AT Z</command> <keycap moreinfo="none">Enter</keycap>
<computeroutput moreinfo="none">OK</computeroutput>

<command moreinfo="none">AT entC1 entD2 entK3 S0=2 M0</command> <keycap moreinfo="none">Enter</keycap>
<computeroutput moreinfo="none">OK</computeroutput>

<command moreinfo="none">AT E0 Q1 S2=255 entW</command> <keycap moreinfo="none">Enter</keycap>

<keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">A</keycap></keycombo> <keycap moreinfo="none">Q</keycap>
<guimenu moreinfo="none">Leave without reset?</guimenu> <guimenuitem moreinfo="none">Yes</guimenuitem></screen></figure></section><section id="modem-hayes-reset"><title>Resetting the modem</title><para>If you need to issue more <acronym>AT</acronym> commands to
    the modem then power cycle the modem.  This should place the modem
    into command mode.</para><para>Now issue the following commands to restore the modem's
    factory configuration.</para><figure float="0" id="modem-hayes-attention-regain"><title>Resetting a Hayes <acronym>AT</acronym>-style
     modem</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">minicom -o console</command>
<computeroutput moreinfo="none">Welcome to minicom
Press CTRL-A Z for help on special keys</computeroutput>

<command moreinfo="none">AT entF entY0 entW entW1</command> <keycap moreinfo="none">Enter</keycap>
OK
<command moreinfo="none">AT Z</command> <keycap moreinfo="none">Enter</keycap>
OK

<keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">A</keycap></keycombo> <keycap moreinfo="none">Q</keycap>
<guimenu moreinfo="none">Leave without reset?</guimenu> <guimenuitem moreinfo="none">Yes</guimenuitem></screen></figure><para>If this fails then you will need to clear the modem's
    configuration memory.  The procedure for this varies by
    manufacturer, and probably requires the disassembly of the
    modem.</para></section></section><section id="modem-internal"><title>Internal modems</title><para>An internal modem is basically an external modem and serial
   port mounted upon a <acronym>PC</acronym> bus card.  These are
   cheaper than external modems as they do not require a power supply
   or a chassis.</para><para>Internal modems work fine for remote serial console
   applications.  They are especially attractive for computers at
   co-location sites, as those sites charge according to space and
   power consumption.</para><para>Check that your internal modem preserves its setting across a
   power cycle.</para><para>Ensure that the interrupt line and port address space used by
   the internal modem's serial port do not conflict with that used by
   any other pre-existing serial ports.  Alternatively, ensure that
   the internal serial port can be disabled, freeing its interrupt
   line and port address space for use by the internal modem.</para><para>Be careful not to confuse an internal modem with a WinModem.
   An internal modem does not need a special device driver, but
   appears to <systemitem class="osname" moreinfo="none">Linux</systemitem> as a
   stardard serial port.</para></section><section id="modem-dsp"><title>WinModems</title><para>If you look at a modem, with it's small central processing
   unit and special-purpose digital signal processor, and then look at
   a modern <acronym>PC</acronym>, with it's large <acronym>CPU</acronym>
   and general-purpose <acronym>DSP</acronym> on the sound card, you may
   wonder if the hardware duplication of an external modem is
   necessary.</para><para>A entWinModement incorporates the
   <acronym>CPU</acronym> and <acronym>DSP</acronym> of the modem into
   the slightly-enhanced fabric of a <acronym>PC</acronym>.  They are
   called "WinModems" because they originally only shipped with
   <productname class="trade">Microsoft <systemitem class="osname" moreinfo="none">Windows</systemitem></productname> device
   drivers. These device drivers presented the illusion of a serial
   port attached to a Hayes <acronym>AT</acronym>-style modem.  For a
   long time only <systemitem class="osname" moreinfo="none">Windows</systemitem>
   versions of these drivers where available.  Some manufacturers now
   provide <systemitem class="osname" moreinfo="none">Linux</systemitem> versions of
   their device drivers as well, these modems are jokingly called
   entLinModemsent.</para><para>It is probably possible to use a LinModem as a <systemitem class="osname" moreinfo="none">Linux</systemitem> console.  At the most this would
   require altering the source code to dumb-down the AT command
   emulation of the modem and recompiling the kernel.</para><para>Boot loaders, however, work in a very confined software
   environment and struggle to support a simple serial chip.
   Considering that some boot loaders do not even handle interrupts,
   handling the complex <acronym>DSP</acronym> of a LinModem is well
   beyond what is practical.</para></section></chapter><appendix id="bugs"><title>Bugs and annoyances</title><section id="bugs-kernelp"><title>Flow control in <systemitem class="osname" moreinfo="none">Linux</systemitem> kernel</title><para>The Linux kernel can be asked to do
   <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control using
   the <literal moreinfo="none">r</literal> option on the <literal moreinfo="none">console=</literal>
   parameter.  For example, a serial link at 9600bps with 8 data bits,
   no parity and <acronym>CTS</acronym>/<acronym>RTS</acronym> flow
   control is configured as shown in <xref linkend="bugs-kernelp-config"></xref>.</para><figure float="0" id="bugs-kernelp-config"><title>A kernel <literal moreinfo="none">console</literal> parameter with
    <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control</title><programlisting format="linespecific">console=9600n8r</programlisting></figure><para>Because the Linux kernel only ever sends data,
   <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control is
   implemented by checking that Clear to Send is not asserted.  The
   code which does is found in
   <filename moreinfo="none">/usr/src/linux/drivers/char/serial.c</filename>, the
   relevant portion can be seen in <xref linkend="bugs-kernelp-serialc"></xref>.</para><figure float="0" id="bugs-kernelp-serialc"><title>Kernel source code for console
    <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control</title><programlisting format="linespecific">static inline void wait_for_xmitr(struct async_struct *info)
{
ent
  /* Wait for flow control if necessary */
  if (info-entflags ent ASYNC_CONS_FLOW) {
    tmout = 1000000;
    while (--tmout entent
           ((serial_in(info, UART_MSR) ent UART_MSR_CTS) == 0));
  }       
}</programlisting></figure><para>The loop driven by the <varname>tmout</varname> value of
   1000000 results in a wait of about one second for the
   <acronym>CTS</acronym> line to become asserted.</para><para>This code ignores the status of the <acronym>RS-232</acronym>
   Data Set Ready and Data Carrier Detect status lines.  This has a
   number of consequences.</para><itemizedlist><listitem><para>If the <acronym>RS-232</acronym> cable is unplugged or the
     terminal server port is idle then the code waits for
     <acronym>CTS</acronym> to be asserted for about one second for
     every character written to the console.  So the huge number of
     characters written to the console when booting a machine can
     result in a very long wait for a reboot.</para></listitem><listitem><para>Clear to Send is only validly asserted if Data Carrier
     Detect and Data Set Ready are asserted.  The code should allow
     for an unpowered device which allows <acronym>CTS</acronym> to float.</para></listitem><listitem><para>After looping one million times, if Clear to Send is not
     assrted then the character is sent in any case.  Thus the kernel
     cannot be used on multidrop <acronym>RS-232</acronym> lines.  The
     character should be dropped instead.</para></listitem><listitem><para>The character is sent even if Data Carrier Detect is not
     asserted.  Thus the attached modem may be in command mode.  This
     results in a security flaw if an attacker can get arbitrary text
     placed in a console messages.  As many console messages contain
     error text derived from user events, it would not be too
     difficult to place <command moreinfo="none">ATentF</command> in a console
     message and unprogram the modem's auto-answer
     configuration.</para></listitem></itemizedlist><para>As a result of these bugs this <citetitle>HOWTO</citetitle>
   no longer recommends the use of kernel-level flow control.  The
   author has a kernel patch which fixes all current-reported bugs and
   is attempting to get that patch integrated into the mainline
   kernel.  Once the kernel bugs are corrected this
   <citetitle>HOWTO</citetitle> will once again recommend kernel-level
   flow control.</para></section><section id="bugs-rhl71"><title><productname class="trade">Red Hat <systemitem class="osname" moreinfo="none">Linux</systemitem></productname>
   <productnumber>7.1</productnumber> and SysVinit</title><para>The System V <application moreinfo="none">init</application> system shipped
   with <productname class="trade">Red Hat Linux</productname>
   <productnumber>7.1</productnumber> does not support serial console
   correctly in single user mode.  See Red Hat advisory
   <citetitle><acronym>RHBA-2001:085-02</acronym> <ulink url="http://www.redhat.com/support/errata/RHBA-2001-085.html"><citetitle>New
   SysVinit package to fix hangs on serial
   console</citetitle></ulink></citetitle>.  The advisory announces an
   update to the package
   <filename moreinfo="none">SysVinit-2.78-15.i386.rpm</filename> that is shipped on
   the <productname class="trade">Red Hat Linux</productname>
   <productnumber>7.1</productnumber> <acronym>CD</acronym>.</para></section><section id="bugs-video"><title><acronym>BIOS</acronym>s, keyboards and video cards</title><para>Some <acronym>BIOS</acronym>s will not boot if the keyboard is
   not installed.</para><informalfigure float="0" id="bugs-video-keyboard"><screen format="linespecific"><computeroutput moreinfo="none">Keyboard faulty, press F1</computeroutput></screen></informalfigure><para>Most <acronym>BIOS</acronym>s have settings that will allow
   them to boot without a keybaord.</para><para>Some odd <acronym>BIOS</acronym>s will not boot if no video
   card is installed.</para></section><section id="bugs-reboot"><title>Modem hangs up upon reboot</title><para>During reboot the serial controller is reset.  This drops the
   modem control line Data Terminal Ready.  This in turn instructs the
   modem to hang up.</para><para>Avoid the temptation to configure the modem to ignore
   <acronym>DTR</acronym>.  This leads to a worse bug, where the
   telephone line does not clear down correctly, the modem is engaged,
   and there is no way to clear it.  Ignoring <acronym>DTR</acronym>
   also gives no way to clear hostile callers from the line.</para><para>You may wish to record the amount of time that the computer
   takes from <computeroutput moreinfo="none">Restarting system</computeroutput> to
   the boot loader prompt.</para><para>The modem may also hang up during the boot process (as the
   serial chip is reset) or when the <application moreinfo="none">init</application>
   run level is changed (as <application moreinfo="none">getty</application> is
   restarted).</para></section><section id="bugs-monitor"><title><application moreinfo="none">init</application> and
   <application moreinfo="none">syslog</application> output does not display on
   secondary consoles</title><para>The kernel can be configured to output messages to the serial
   port and to the attached monitor.  However messages from
   <application moreinfo="none">init</application> and
   <application moreinfo="none">syslog</application> only appear on the last-listed
   console device, in our case the serial port.</para><para>This can confuse someone looking at the attached monitor, as
   the messages on the monitor suggest that the machine has hung just
   before starting <application moreinfo="none">init</application>.  Eventually the
   machine will finish booting and <application moreinfo="none">getty</application>
   will display a <prompt moreinfo="none">login:</prompt> request.  A Post-it Note on
   the monitor may reassure the impatient.</para></section><section id="bugs-whereami"><title>The console is unresponsive after connecting</title><para>The terminal's screen may be blank after connecting to the
   machine.  Pressing <keycap moreinfo="none">Enter</keycap> will usually bring up a
   <prompt moreinfo="none">login:</prompt> request.</para><para>If no characters appear upon the screen after pressing
   <keycap moreinfo="none">Enter</keycap> do not panic.  The machine must have power
   and the operating system must have booted: for our call to be
   answered by the modem Data Terminal Ready must be active.</para><para>The most likely thing is that the machine booted and is
   running a <command moreinfo="none">fsck</command> filesystem check.  These checks
   can take some considerable time, all with no or very little
   output.</para><para>It will help your peace of mind considerably to record in the
   system log book the time <command moreinfo="none">fsck</command> takes to check
   each filesystem.</para><para>If you see garbled text after pressing <keycap moreinfo="none">Enter</keycap>
   then there are mismatched bit rates or parity parameters.  Correct
   your terminal emulator's configuration.</para></section><section id="bugs-setserial"><title>Modem hangs up during initialization</title><para>Using <command moreinfo="none">setserial</command> will reset the serial
   port.  This will hang up the modem.</para><para><command moreinfo="none">setserial</command> is sometimes used during the
   boot process, resulting in the output seen in <xref linkend="bugs-setserial-init"></xref>.  Look into the file
   <filename moreinfo="none">/etc/rc.serial</filename> and remove any references to
   the port which is being used as the serial console.</para><figure float="0" id="bugs-setserial-init"><title><command moreinfo="none">setserial</command> causes a modem to hang up as
    the machine initializes</title><screen format="linespecific"><computeroutput moreinfo="none">ent
Mounting local filesystems:  [  OK  ]
Turning on user and group quotas for local filesystems:  [  OK  ]
Enabling swap space:  [  OK  ]
/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A

NO CARRIER</computeroutput></screen></figure></section><section id="bugs-bootloaderflow"><title>Boot loader has no flow control</title><para>Most boot loaders do not support
   <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control.  This can
   cause some data loss where large speed mis-matches exist, as is
   often the case with a modern modem connected into a
   9600<abbrev>bps</abbrev> fixed-speed port.</para><para><application moreinfo="none">SYSLINUX</application> 1.66 supports flow
   control.</para></section><section id="bugs-bootloadernoise"><title>Boot loaders are vulnerable to line noise</title><para>Most boot loaders will sit at their prompt forever after
   receiving a single character of line noise.</para><para>Some modems will let the <acronym>RS-232</acronym> signals
   "float", sending noise when there is no caller.  Because the modem
   is not asserting Data Carrier Detect it expects the receiver to
   discard the noise characters.</para><para>The combination of an unfortunate boot loader with an
   unfortunate modem can result in a machine that will regularly hang
   during booting.</para><para>If you cannot configure your boot loader to obey
   <acronym>DCD</acronym> then be careful to test any modem you intend
   to purchase to ensure that it does not generate characters when
   their is no caller.  At the present only
   <application moreinfo="none">SYSLINUX</application> implements full
   <acronym>RS-232</acronym> status signals.</para></section><section id="bugs-apm"><title><productname class="trade">Advanced Power Management</productname></title><para><acronym>APM</acronym> allows control of the power from
   software.  This can be a blessing and a curse.</para><para>The blessing is that the machine can be cleanly and totally
   shut down remotely.  You may want to do this if the remote site is
   maintaining their power supply.</para><para>The curse is that once powered down the machine will not
   start up again until the <keycap moreinfo="none">Power</keycap> button is
   physically pressed.  Some machines have a <acronym>BIOS</acronym> or
   motherboard setting to defeat this unhelpful behaviour.</para><caution id="caution-shutdown"><title>Errors when typing <command moreinfo="none">shutdown</command> are worse
    with <acronym>APM</acronym></title><para>Be careful not to confuse <command moreinfo="none">shutdown -r
    now</command>, which cleanly reboots the machine, with
    <command moreinfo="none">shutdown -h now</command>, which cleanly powers down the
    machine.  Someone will need to physically press the
    <keycap moreinfo="none">Power</keycap> button if you choose wrongly.</para></caution><para>If you are serious about remote site computing then you
   should investigate remote power switches from companies like <ulink url="http://www.wti.com/">Western Telematic</ulink>, <ulink url="http://www.servertech.com/">Server Technology</ulink> and many
   others.  Some models include built-in terminal servers, built-in
   modems and <acronym>RS-232</acronym> lines to simulate a
   <acronym>UPS</acronym> input power failure (and thus shut the
   <systemitem class="osname" moreinfo="none">Linux</systemitem> system down cleanly
   before removing power).</para></section><section id="bugs-international"><title>Modems and overseas telecommunications requirements</title><para>There is no world-wide approval processes to certify that a
   modem is suitable for connection to the telephone network.  This is
   despite the presence of a common set of technical standards that
   modems must meet for use on the global switched telephone network.
   There is little or no recognition of one nation's approvals by
   other national regulators.</para><para>There are national technical requirements concerning the use
   of modems. Common requirements are to set the modem and its
   software to answer after the second ring and never to dial the same
   engaged or faulty number more than five times in a row.</para><warning id="warning-approval"><title>Telecommunications device approvals</title><para>Using or importing unapproved telecommications equipment is
    a criminal offense in most countries.</para><para>Additionally, the operator of some types of equipment may
    require certification.</para></warning><para>Privacy laws may control what can be done with calling line
   identification records.</para><para>Do not assume that Touch Tone dialling is globally available.
   There is no common standard for decadic dialling: some countries
   have the longest sequence for zero, other countries have the
   shortest sequence for zero.</para><para>There is little coordination of national numbering plans.  Be
   careful not to call a national emergency services number when
   intending to dial the international access code.  Common emergency
   services numbers are: 112, 911, 000.  International access codes
   vary by country.</para><para>Intelligent network features such as toll-free numbers are
   usually not available to calls originating from abroad.</para><para>International calls may be routed through fiber optical
   submarine cable, satelite or High Frequency radio.  The possible
   bit rates vary considerably between these options.  Expect the
   maximum throughput with no errors from fiber optical submarine
   cable.  Expect 1200<abbrev>bps</abbrev> to
   2400<abbrev>bps</abbrev> with some errors from satelite.  Expect
   75<abbrev>bps</abbrev> to 300<abbrev>bps</abbrev> with many
   errors from <acronym>HF</acronym> radio.</para><para>There will be considerable latency depending upon the
   distance.  If the latency becomes greater than the modem's error
   correction window then you will get better
   <productname class="trade">Zmodem</productname> file transfer performance if you
   disable the <acronym>HDLC</acronym>-based error correction in the
   modems.</para><para>International calls may have their signal altered
   considerably.  Traditionally, international calls are placed
   through analogue conditioning circuits to minimise echo.  This
   conditioning limits the maximum bit rate a modem can achieve,
   probably to less than 9600<abbrev>bps</abbrev>.  You may be able to program a
   <wordasword>guard tone</wordasword> to disable analogue
   conditioning, this will vary by carrier and the commands to send
   the guard tone vary by modem.</para><para>On some modern international circuits, particularly those
   accessed by international calling cards, digital voice compression
   is used.  No reliable modem connection can be established over
   these digitally-compressed circuits.  The best current tactic for
   identifying these digitally compressed circuits is to listen to the
   background noise ent when no-one is speaking the real
   background noise will be replaced by a synthesized background noise
   (a compression technique called <wordasword>silence
   suppression</wordasword>).</para></section></appendix><appendix id="upload"><title>Uploading files from a serial console</title><para>There are many scenarios where the machine is dead in the
  water and you need to upload a file to correct that.  In many of
  these scenarios the only way to upload the file is via the serial
  port being used as the console.</para><para>Moving files about over serial links has a long history in
  microcomputing and this section goes back in time to uncover the
  tools commonly used in the pre-Internet age of the Bulletin Board
  System.</para><section id="upload-logging"><title>Disable logging to console</title><para>Before attempting to upload or download files it is a good
   idea to prevent messages from appearing on the console.  These
   messages will corrupt files moved using <command moreinfo="none">cat</command> and
   will cause <application moreinfo="none">Xmodem</application> and similar protocols
   to take much, much longer.</para><para>Alter your system's configuration to give
   <application moreinfo="none">klogd</application> the <literal moreinfo="none">-c 1</literal>
   parameter, inhibiting the display of kernel messages directly to
   the console.  Kernel messages will still go to the system
   logger.</para><figure float="0"><title>Supressing kernel messages to the console in Red Hat
    Linux</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">vi /etc/sysconfig/syslog</command></screen><programlisting format="linespecific">KLOGD_OPTIONS="-2 -c 1"</programlisting><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">/etc/init.d/syslog restart</command></screen></figure><para>Also modify the system logger's configuration not to send
   messages to the console.  Edit
   <filename moreinfo="none">/etc/syslog.conf</filename>, altering lines sending
   output to <filename class="devicefile" moreinfo="none">/dev/console</filename>.
   Send this output to a file instead.</para></section><section id="upload-cat"><title><acronym>ASCII</acronym> upload and <command moreinfo="none">cat</command></title><para><command moreinfo="none">cat</command> is available on every
   <acronym>UNIX</acronym>-like system.  It copies the data received
   from the keyboard to a file.  Minicom and other terminal emulators
   have an ent<acronym>ASCII</acronym> uploadent facility that
   will send a file up the serial link as though it had been
   typed.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">remote bash$</prompt> <command moreinfo="none">cat ent upload.txt</command></screen><screen format="linespecific"><keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">S</keycap></keycombo> <guimenu moreinfo="none">Upload</guimenu> <guimenuitem moreinfo="none">ascii</guimenuitem>
<guilabel moreinfo="none">[ascii upload - Press CTRL-C to quit]</guilabel></screen><literallayout format="linespecific" linenumbering="unnumbered" class="normal">Wait for upload to completeent</literallayout><screen format="linespecific"><guilabel moreinfo="none">ASCII upload of "upload.txt"
10.0 Kbytes transferred at 3900 CPS... Done.
READY: press any key to continue...</guilabel></screen><screen format="linespecific"><keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">D</keycap></keycombo>
<prompt moreinfo="none">remote bash$</prompt></screen></informalfigure><para>Without hardware flow control <acronym>ASCII</acronym> upload
   will drop the occassional character.</para><para>To upload binary files encode them into
   <acronym>ASCII</acronym>, upload them, and then decode them into
   binary again.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">localhost bash$</prompt> <command moreinfo="none">uuencode upload.bin ent upload.bin ent upload.txt</command></screen><screen format="linespecific"><keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">S</keycap></keycombo> <guimenu moreinfo="none">Upload</guimenu> <guimenuitem moreinfo="none">ascii</guimenuitem>
<guilabel moreinfo="none">[ascii upload - Press CTRL-C to quit]</guilabel></screen><literallayout format="linespecific" linenumbering="unnumbered" class="normal">Wait for upload to completeent</literallayout><screen format="linespecific"><guilabel moreinfo="none">ASCII upload of "upload.txt"
10.0 Kbytes transferred at 3900 CPS... Done.
READY: press any key to continue...</guilabel></screen><screen format="linespecific"><keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">D</keycap></keycombo>
<prompt moreinfo="none">remote bash$</prompt></screen><screen format="linespecific"><prompt moreinfo="none">remote bash$</prompt> <command moreinfo="none">uudecode ent upload.txt</command></screen></informalfigure><para>You can detect transmission errors by using a checksum
   program such as <command moreinfo="none">sum</command>, <command moreinfo="none">cksum</command> or
   <command moreinfo="none">md5sum</command>.  Print the ckecksum of the file before
   it is sent from the local machine and after it is recieved upon the
   remote machine.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">localhost bash$</prompt> <command moreinfo="none">cksum upload.bin</command>
<computeroutput moreinfo="none">1719761190 76 upload.bin</computeroutput></screen><screen format="linespecific"><prompt moreinfo="none">remote bash$</prompt> <command moreinfo="none">cksum upload.bin</command>
<computeroutput moreinfo="none">1719761190 76 upload.bin</computeroutput></screen></informalfigure><para>There are a number of checksumming programs.  The
   <command moreinfo="none">sum</command> command should be used with caution, as
   there are versions for <acronym>BSD</acronym> and
   <productname class="trade">System V <acronym>UNIX</acronym></productname> which
   give differing results.  <command moreinfo="none">cksum</command> is the attempt by
   the <acronym>POSIX</acronym> standards developers to correct that
   mess: it gives the same result for the same file on all
   <acronym>POSIX</acronym> machines.</para><para>If the checksums of the original and uploaded files do not
   match then the file will have to be uploaded again.  If the link is
   noisy and the file is big then you may never get a successful
   upload.  What is needed in this case is to divide the file into
   many small parts, upload a part, check its checksum, and if it is
   fine proceed to the next part.</para><para>This sounds like something that should be automated.
   Entering from stage left is <application moreinfo="none">Xmodem</application>.</para></section><section id="upload-zmodem"><title><application moreinfo="none">Xmodem</application>,
   <application moreinfo="none">Ymodem</application> and
   <application moreinfo="none">Zmodem</application></title><para><application moreinfo="none">Xmodem</application> sends 128 bytes and a
   checksum, waits for a Acknowledgment to say all is well and sends
   the next block.  If a negative acknowledgement is received or if no
   <acronym>ACK</acronym> or <acronym>NAK</acronym> ever appears then
   the block is sent again.</para><para><application moreinfo="none">Xmodem</application> is a simple protocol, as
   you would expect of a program written for 8-bit computers running
   <systemitem class="osname" moreinfo="none">CP/M</systemitem>. It has lots of
   inefficiencies and minor problems, such as rounding up the file
   size to the next 128 byte boundary.  These deficiencies lead to an
   evolution of the protocol with revisions of
   <application moreinfo="none">Xmodem</application>, then
   <application moreinfo="none">Ymodem</application> and finishing with
   <application moreinfo="none">Zmodem</application>.
   <application moreinfo="none">Zmodem</application> is substantially faster than
   <application moreinfo="none">Xmodem</application> and has no niggling problems.
   The <application moreinfo="none">Zmodem</application> protocol is substantially
   more complex than the <application moreinfo="none">Xmodem</application> protocol,
   but since we only seek to at most compile the code, that complexity
   need not concern us.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">remote bash$</prompt> <command moreinfo="none">rz</command>
<computeroutput moreinfo="none">... waiting to receive.**B0100000023be50</computeroutput></screen><screen format="linespecific"><keycombo moreinfo="none"><keycap moreinfo="none">Alt</keycap><keycap moreinfo="none">S</keycap></keycombo> <guimenu moreinfo="none">Upload</guimenu> <guimenuitem moreinfo="none">zmodem</guimenuitem>
<guilabel moreinfo="none">[zmodem upload - Press CTRL-C to quit]
Sending: upload.bin
Bytes Sent:   3072/  10000   BPS:2185     ETA 00:09</guilabel></screen></informalfigure><para>If an upload fails and you are left with
   <command moreinfo="none">rz</command> waiting to recieve a file then typing
   <keycombo moreinfo="none"><keycap moreinfo="none">Ctrl</keycap><keycap moreinfo="none">X</keycap></keycombo> a
   number of times will return you to the command prompt.  This also
   works for <application moreinfo="none">Xmodem</application>'s <command moreinfo="none">rx</command>
   and <application moreinfo="none">Ymodem</application>'s
   <command moreinfo="none">ry</command>.</para><para>Useful <application moreinfo="none">Zmodem</application> abilities are
   resuming failed uploads and sending multiple files in a single
   upload session.</para><para>An implementation of <application moreinfo="none">Xmodem</application>,
   <application moreinfo="none">Ymodem</application> and
   <application moreinfo="none">Zmodem</application> for <acronym>POSIX</acronym>
   computers is available from <ulink url="http://www.ohse.de/uwe/software/lrzsz.html">http://www.ohse.de/uwe/software/lrzsz.html</ulink>.
   <productname class="trade">Red Hat Linux</productname> distribute this in the
   <filename moreinfo="none">lrzsz</filename> <acronym>RPM</acronym> package.
   <application moreinfo="none">lrzsz</application> is a enhanced free software branch
   of the public domain version of <ulink url="ftp://ftp.cs.pdx.edu/pub/zmodem/rzsz.zip"><application moreinfo="none">rzsz</application></ulink>
   from <ulink url="http://www.omen.com/">Omen
   Technology</ulink>.</para></section><section id="upload-kermit"><title><application moreinfo="none">Kermit</application></title><para><ulink url="http://www.kermit-project.org/"><application moreinfo="none">Kermit</application></ulink>
   is a terminal emulator and file transfer program delevoped by
   <ulink url="http://www.columbia.edu/">Columbia University</ulink>.
   It's popularity springs from the large range of computers that
   <application moreinfo="none">Kermit</application> could be used to access, from
   <acronym>IBM</acronym> mainframes to
   <productname class="trade"><acronym>MS-DOS</acronym></productname>
   <acronym>PC</acronym>s.</para><para>A <application moreinfo="none">Kermit</application> variant named <ulink url="http://www.columbia.edu/kermit/gkermit.html"><application moreinfo="none">G-Kermit</application></ulink>
   was released under the <citetitle>GNU Public License</citetitle>.
   This is available in most <productname class="trade">Linux</productname>
   distributions.</para><para>The recent <application moreinfo="none">Kermit</application> and
   <application moreinfo="none">Zmodem</application> protocols are built upon the same
   technologies.  <application moreinfo="none">Zmodem</application> has better
   performance in calls with high error rates.
   <application moreinfo="none">Kermit</application> has been ported to more host
   platforms.</para></section></appendix><appendix id="rhl"><title>Upgrading <productname class="trade">Red Hat Linux</productname> from a
  serial console</title><para>Upgrades to Linux distributions are frequently released.  A
  machine is not remotely manageable unless these upgrades can be
  installed without needing to physically touch the machine.</para><para>This section examines the remote installation and remote
  upgrade of <productname class="trade">Red Hat Linux</productname>.</para><para><productname class="trade">Red Hat Linux</productname> can be installed over
  the network from a <acronym>HTTP</acronym> server using an install
  diskette.  We modify this diskette to use the serial console.  If we
  can control whether to boot from this diskette or from the hard disk
  then we can remotely upgrade the Red Hat Linux distribution from the
  serial port.  If a blank diskette is placed in the drive when the
  machine is deployed then no on-site intervention is needed to
  upgrade the operating system.</para><para>If you have upgrade procedures for other
  <systemitem class="osname" moreinfo="none">Linux</systemitem> distributions please contribute
  them to the <citetitle>HOWTO</citetitle> maintainer.</para><section id="rhl-selectboot"><title>Select boot disk</title><para>The key to a remote upgrade is to be able to boot from floppy
   disk to perform the upgrade, and then to reboot from the hard disk.
   The possibilities are:</para><orderedlist inheritnum="ignore" continuation="restarts"><listitem><para>Most <acronym>BIOSs</acronym> allow the boot disk order to be
     controlled through the <acronym>BIOS</acronym>' configuration.  If
     the <acronym>BIOS</acronym> supports a serial console then the
     machine can be upgraded whilst leaving the floppy disk in the
     drive.  No one need attend the site to upgrade the operating
     system</para></listitem><listitem><para>Someone can insert a floppy disk before the upgrade and
     remove it afterwards.  Most co-location sites will provide this
     level of entboard-swapent technical support.</para></listitem><listitem><para>Two records of the CMOS memory which stores the
     <acronym>BIOS</acronym> configuration can be made: one for booting
     from floppy and another for booting from hard disk.
     Unfortunately the nvram device driver does not yet work on a wide
     enough variety of machines for this HOWTO to pursue this option
     further.</para></listitem></orderedlist></section><section id="rhl-biosserial"><title>Configure the <acronym>BIOS</acronym> to use the serial
   port</title><para>Many servers allow the <acronym>BIOS</acronym> to be configured
   from the serial port, especially on systems designed for rack
   mounting.  At the moment few machines designed to be used as
   desktop systems allow the <acronym>BIOS</acronym> to be accessed from
   the serial port.</para><para>Refer to your vendor's documentation to set the
   <acronym>BIOS</acronym> to use the serial port.  Some vendors call
   this feature entconsole redirectionent.  Unfortunately, the
   meaning of this term varies by vendor.  Some vendors use it to mean
   the redirection of the <acronym>VGA</acronym> output and keyboard
   to a remote <acronym>PC</acronym> using a proprietary serial
   protocol.  This feature can only be used in conjunction with the
   <systemitem class="osname" moreinfo="none">Linux</systemitem> serial console if the
   <acronym>BIOS</acronym> can be instructed to disable the serial
   redirection after booting.</para><para>As an example of the confusion, Dell uses entconsole
   redirectionent when describing the <productname class="trade">Dell
   2400</productname> and the <productname class="trade">Dell 2450</productname>.
   The <productname class="trade">Dell 2450</productname> <acronym>BIOS</acronym>
   can be configured from the serial port.  The <productname class="trade">Dell
   2400</productname>'s entconsole redirectionent is
   additional hardware that remotely replicates the computer's
   <acronym>VGA</acronym> monitor and keyboard.</para><para>An example of a <acronym>BIOS</acronym> configuration is given
   in <xref linkend="rhl-biosserial-example"></xref>.</para><figure float="0" id="rhl-biosserial-example"><title>Configuring <acronym>BIOS</acronym> to use serial link</title><screen format="linespecific">BIOS setup console redirection

Enter BIOS setup during boot when
  Keyboard:     [Ctrl+Alt+Esc pressed]
  Serial port:  ["HAL" is typed]

Serial port
  Port:         [COM1]
  Speed         [9600] bps
  Data:         [8] bits
  Parity:       [None]
  Stop:         [1] bits
  Handshaking:  [Full CTS/RTS handshaking]
  Terminal:     [Dumb]</screen></figure><para>Many <acronym>BIOSs</acronym> will enter their configuration
   dialogs if a particular terminal key is pressed during the
   <acronym>BIOS</acronym> boot.  This can be a problem if the modem
   link is noisy.</para><para>For normal operation, set the boot order to attempt to boot
   from the hard disk first.</para><figure float="0" id="rhl-biosserial-bootorder"><title>Configuring BIOS to boot from hard disk</title><screen format="linespecific">BIOS setup boot order

First:  [Hard disk]
Second: [CD-ROM]
Third:  [Floppy disk]</screen></figure></section><section id="rhl-ignoredtr"><title>Configure modem to ignore <acronym>DTR</acronym> and assert
   <acronym>DCD</acronym></title><para>The computer reboots a few times during the upgrade.  These
   reboots hang up the modem. Having to dial in a number of times
   during the upgrade can become annoying. Altering the modem's
   configuration to ignore Data Terminal Ready will cause the modem
   not to hang up when the computer is rebooted.  To ignore
   <acronym>DTR</acronym> send the command
   <command moreinfo="none">ATentD0</command> to the modem.</para><para>We may also wish to disconnect during the install to reduce
   transmission charges.  Configuring the modem to hold Data Carrier
   Detect on will prevent any disconnection and reconnection from
   being apparent to the installer.  Use the command
   <command moreinfo="none">ATentC0</command> to always hold <acronym>DCD</acronym>
   high.</para><para>Apply these changes using the procedure in <xref linkend="modem-hayes"></xref>, retaining all of the other
   <literal moreinfo="none">AT</literal> commands.</para></section><section id="rhl-preparefloppy"><title>Prepare a network install floppy diskette</title><para>The <productname class="trade">Red Hat Linux</productname> web site has a
   floppy diskette image for a network installation.  For
   <productname class="trade">Red Hat Linux</productname>
   <productnumber>7.1</productnumber> the image is <ulink url="ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/images/bootnet.img"><filename moreinfo="none">ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/images/bootnet.img</filename></ulink>.</para><para>Install this image on a floppy disk.</para><informalfigure float="0" id="rhl-preparefloppy-image"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">mkfs -t msdos -c /dev/fd0</command>
<computeroutput moreinfo="none">mkfs.msdos 2.2 (06 Jul 1999)</computeroutput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">dd if=bootnet.img of=/dev/fd0 bs=1440k</command>
<computeroutput moreinfo="none">1+0 records in
1+0 records out</computeroutput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">sync</command></screen></informalfigure><para>Now mount the diskette and check that the installer files are
   present.</para><informalfigure float="0" id="rhl-preparefloppy-mount"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">mount -t vfat /dev/fd0 /mnt/floppy</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">ls /mnt/floppy</command>
<computeroutput moreinfo="none">boot.msg    general.msg  ldlinux.sys  rescue.msg    vmlinuz
expert.msg  initrd.img   param.msg    syslinux.cfg</computeroutput></screen></informalfigure><para>This floppy disk uses the
    <application moreinfo="none">SYSLINUX</application> boot loader which was
    discussed in <xref linkend="configure-boot-loader-syslinux"></xref> and
    in <xref linkend="configure-kernel-syslinux"></xref>.  Firstly, we alter
    the boot loader configuration file
    <filename moreinfo="none">/mnt/floppy/syslinux.cfg</filename> to use the serial
    port.  If you are going to use the <application moreinfo="none">vi</application>
    editor to alter this file, use the <literal moreinfo="none">-n</literal> option to
    avoid writing a swap file to the floppy disk.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">vi -n /mnt/floppy/syslinux.cfg</command></screen><programlisting format="linespecific">serial 0 9600</programlisting></informalfigure><para>Secondly we add a new boot option.  This is modeled upon the
    other boot options in the file.  Our variant passes the serial
    console parameters to the kernel, the same parameters that we pass
    during normal operation when using serial console. "serial" seems
    an appropriate name for the boot option.</para><informalfigure float="0"><programlisting format="linespecific">label serial
 kernel vmlinuz
 append initrd=initrd.img lang= text serial expert devfs=nomount console=ttyS0,9600n8</programlisting></informalfigure><para><literal moreinfo="none">text</literal>, <literal moreinfo="none">serial</literal> and
   <literal moreinfo="none">expert</literal> are parameters to the Red Hat
   <application moreinfo="none">anaconda</application> installer.  Specifying
   <literal moreinfo="none">text</literal> ensures that the graphical installer does
   not start.  Specifying <literal moreinfo="none">serial</literal> prevents scans for
   possibly non-existent video hardware.  You will need to run
   <application moreinfo="none">Xconfigurator</application> manually if you do have a
   video card.  Specifying <literal moreinfo="none">expert</literal> allows all the
   configuration options to be seen, giving one floppy image that can
   be used for all purposes.</para><para>Thirdly, we make this new configuration start automatically.
   As there is no-one at the site, there's no need to issue a
   <prompt moreinfo="none">boot:</prompt> prompt.</para><informalfigure float="0"><programlisting format="linespecific">default serial
prompt 0</programlisting></informalfigure><para>Fourthy, we write the new configuration to diskette.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">umount /mnt/floppy</command></screen></informalfigure><para>Check that the diskette boots.  If it does not then write a
   new boot sector by downloading and running the most recent
   <application moreinfo="none">SYSLINUX</application>.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">syslinux /dev/fd0</command></screen></informalfigure><para>Finally, create a new boot image for copying to the
    computers to be upgraded.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">dd if=/dev/fd0 of=bootserialnet.img bs=1440k</command>
<computeroutput moreinfo="none">1+0 records in
1+0 records out</computeroutput></screen></informalfigure><para>If you test the new boot floppy on a machine with a serial
    console you should briefly see <application moreinfo="none">SYSLINUX</application>
    booting</para><informalfigure float="0"><screen format="linespecific"><computeroutput moreinfo="none">SYSLINUX 1.52 2001-02-07  Copyright (C) 1994-2001 H. Peter Anvin</computeroutput></screen></informalfigure><para>and then presenting the <filename moreinfo="none">boot.msg</filename> file
    and then the <systemitem class="osname" moreinfo="none">Linux</systemitem> kernel should be
    loaded</para><informalfigure float="0"><screen format="linespecific"><computeroutput moreinfo="none">Loading initrd.img..............
Loading vmlinuz............. ready.</computeroutput></screen></informalfigure><para>and run.</para><informalfigure float="0"><screen format="linespecific"><computeroutput moreinfo="none">Linux version 2.4.2-2BOOT (root@porky.devel.redhat.com) (gcc version 2.96 200001</computeroutput></screen></informalfigure><para>Next the <application moreinfo="none">init</application> system flashes
   by</para><informalfigure float="0"><screen format="linespecific"><computeroutput moreinfo="none">Greetings.
Red Hat install init version 7.0 starting
mounting /proc filesystem... done
mounting /dev/pts (unix98 pty) filesystem... done
Red Hat install init version 7.0 using a serial console
remember, cereal is an important part of a nutritionally balanced breakfast.
checking for NFS root filesystem...no
trying to remount root filesystem read write... done
checking for writeable /tmp... yes
running install...
running /sbin/loader</computeroutput></screen></informalfigure><para>before the installation application, called
   <application moreinfo="none">anaconda</application>, is started</para><informalfigure float="0"><screen format="linespecific"><computeroutput moreinfo="none">Welcome to Red Hat Linux
+----------+ Devices +-----------+
|                                |
| Do you have a driver disk?     |
|                                |
|    +-----+          +----+     |
|    | Yes |          | No |     |
|    +-----+          +----+     |
|                                |
|                                |
+--------------------------------+
entTabent/entAlt-Tabent between elements  | entSpaceent selects | entF12ent next screen</computeroutput></screen></informalfigure><para>There does not seem to be a way to access the function keys,
   fortunately the user interface does not require their use.</para><para>Now that the floppy has been tested, eject the disk and
   reboot the machine into normal operation.</para></section><section id="rhl-preparehttp"><title>Prepare <acronym>HTTP</acronym> server</title><para>It is best if the web server runs the version of Red Hat
   Linux as is being upgraded to.  If it runs an earlier version, then
   do not rebuild the operating system on this machine and install
   <application moreinfo="none">anaconda-runtime</application> from the later
   operating system.</para><para>Copy the Linux distribution to a local web server using a
   mirroring utility like <command moreinfo="none">wget</command>.  Alternatively the
   files can be copied from the distribution <acronym>CD</acronym>s to
   the web server.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">mkdir ententmode=664 ententparents /var/www/html/redhat/linux/7.1/en/os/i386</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">umask 002</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">wget -nh -nH -r -N -nr -l0 -k -np -X SRPMS ftp://ftp.redhat.com/pub/redhat/linux/7.1/en/os/i386/ -P /var/www/html/redhat/linux/7.1/en/os/i386</command></screen></informalfigure><para>It's best to use a mirror site in place of Red Hat's <acronym>FTP</acronym> site
   used in the example above.</para><para>It is very important not to gain files along the way.  Delete
   any files generated by <acronym>FTP</acronym> servers, web servers
   and <acronym>CD-ROM</acronym>s.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">cd /var/www/html/redhat</command>
<prompt moreinfo="none">bash$</prompt> # Files added by FTP server
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">find . -name '.listing' -print -exec rm {} \;</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">find . -name 'ls-*' -print -exec rm {} \;</command>
<prompt moreinfo="none">bash$</prompt> # Files added by a wget from a HTTP server
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">find . -name '\?*' -print -exec rm {} \;</command>
<prompt moreinfo="none">bash$</prompt> # Files added by a CD-ROM
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">find . -name 'TRANS.TBL' -print -exec rm {} \;</command></screen></informalfigure><para>We now need to add the latest updates to the distributed
   software.  This is done to avoid the machine being compromised
   immediately following the upgrade.</para><para>Adding the updates is essential for <productname class="trade">Red Hat
   Linux</productname> <productnumber>7.1</productnumber>, see <xref linkend="bugs-rhl71"></xref>.</para><para>Collect together the updates <acronym>RPM</acronym>s from
   <ulink url="ftp://ftp.redhat.com/pub/updates/7.1/en/os/"><filename class="directory" moreinfo="none">ftp://ftp.redhat.com/pub/updates/7.1/en/os/</filename></ulink>
   in the subdirectories <filename class="directory" moreinfo="none">i386</filename>,
   <filename class="directory" moreinfo="none">i486</filename>, <filename class="directory" moreinfo="none">i586</filename> <filename class="directory" moreinfo="none">i686</filename>, <filename class="directory" moreinfo="none">images</filename> and <filename class="directory" moreinfo="none">noarch</filename>.</para><para>Merge these updates into the copy of the distribution.  For
   each updated <acronym>RPM</acronym> file, remove the original
   <acronym>RPM</acronym> file then replace it with the updated
   <acronym>RPM</acronym> file.  For example:</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">cd /var/www/html/redhat/linux/7.1/en/os/i386/RedHat/RPMS</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">ls /var/www/html/redhat/updates/7.1/en/os/i386</command>
SysVinit-2.78-17.i386.rpm
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">ls SysVinit-*.rpm</command>
SysVinit-2.78-15.i386.rpm
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">rm SysVinit-2.78-15.i386.rpm</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">cp /var/www/html/redhat/updates/7.1/en/os/i386/SysVinit-2.78-17.i386.rpm .</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">chmod u=rw,g=r,o=r SysVinit-2.78-17.i386.rpm</command></screen></informalfigure><para>Merge the <acronym>RPM</acronym>s from the <filename class="directory" moreinfo="none">updates</filename> subdirectories <filename class="directory" moreinfo="none">i386</filename>, <filename class="directory" moreinfo="none">i686</filename> and <filename class="directory" moreinfo="none">noarch</filename> into <filename class="directory" moreinfo="none">/var/www/html/redhat/linux/7.1/en/os/i386/RedHat/RPMS</filename>.
   Merge the files from the directory <filename class="directory" moreinfo="none">/var/www/html/redhat/updates/7.1/en/os/images</filename>
   into the directory <filename class="directory" moreinfo="none">/var/www/html/redhat/linux/7.1/en/os/i386/images</filename>.</para><para>The file
   <filename moreinfo="none">/var/www/html/redhat/linux/7.1/en/os/i386/RedHat/base/hdlist</filename>
   and <filename moreinfo="none">hdlist2</filename> contain the list of the
   <acronym>RPM</acronym>s to install. This needs to be modified to
   contain the names of the updated <acronym>RPM</acronym>s.</para><para>Install the <filename moreinfo="none">anaconda-runtime</filename>
   <acronym>RPM</acronym> on the <acronym>HTTP</acronym> server.  This
   <acronym>RPM</acronym> should be the same version as the Red Hat
   Linux being upgraded to.</para><para>Now create a new <filename moreinfo="none">hdlist</filename> with the
  commands:</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">cd /usr/lib/anaconda-runtime</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">rm /var/www/html/redhat/linux/7.1/en/os/i386/RedHat/base/hdlist*</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">umask 002</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">./genhdlist ententwithnumbers ententhdlist /var/www/html/redhat/linux/7.1/en/os/i386/RedHat/base/hdlist /var/www/html/redhat/linux/7.1/en/os/i386</command></screen></informalfigure><para>The distribution plus the updates can now be used for a
   network install.  They cannot be used for a <acronym>CD</acronym>
   install, but that doesn't concern us.</para><para>As the distribution plus the updates is different from the
   original distribution, we should not use the version number of the
   original distribution.  Appending the date to which the updates
   have been applied seems best.</para><informalfigure float="0"><programlisting format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">cd /var/www/html/redhat/linux/</command>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">mv 7.1 7.1-20020202</command></programlisting></informalfigure></section><section id="rhl-ifconfig"><title>Record network configuration</title><para>If the machine does not use the Dynamic Host Configuration
   Protocol then record the current network configuration.  This is
   used to complete the installer's <guimenu moreinfo="none">Configure
   TCP/IP</guimenu> screen.</para><example id="rhl-ifconfig-ifconfig"><title>Displaying the Internet Protocol configuration</title><screenco><areaspec><area units="linecolumn" coords="3" id="rhl-ifconfig-ifconfig-ipaddr"></area><area units="linecolumn" coords="15" id="rhl-ifconfig-ifconfig-router"></area><area units="linecolumn" coords="20" id="rhl-ifconfig-ifconfig-dns"></area></areaspec><screen format="linespecific"><prompt moreinfo="none">bash$</prompt> <command moreinfo="none">ifconfig eth0</command>
<computeroutput moreinfo="none">eth0      Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          inet addr:10.1.2.3  Bcast:10.1.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:344233 errors:0 dropped:0 overruns:0 frame:0
          TX packets:285750 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          Interrupt:10 Base address:0x9000</computeroutput>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">netstat -r -n</command>
<computeroutput moreinfo="none">Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.1.2.0        0.0.0.0         255.255.255.0   U        40 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         10.1.2.254      0.0.0.0         UG       40 0          0 eth0</computeroutput>
<prompt moreinfo="none">bash$</prompt> <command moreinfo="none">cat /etc/resolv.conf</command>
<computeroutput moreinfo="none">domain example.edu.au
nameserver 10.255.1.1
nameserver 10.255.2.1
nameserver 172.16.1.1</computeroutput></screen><calloutlist><callout arearefs="rhl-ifconfig-ifconfig-ipaddr"><para>The value of <literal moreinfo="none">inet addr</literal> is the
       entIP addressent.  Our example shows
       <literal moreinfo="none">10.1.2.3</literal>.  The value of
       <literal moreinfo="none">Mask</literal> is the entNetmaskent.  Our
       example shows <literal moreinfo="none">255.255.255.0</literal>.</para></callout><callout arearefs="rhl-ifconfig-ifconfig-router"><para>The value in the Gateway column for Destination
       <literal moreinfo="none">0.0.0.0</literal> is the entDefault
       gatewayent.  Our example shows
       <literal moreinfo="none">10.1.2.254</literal>.</para></callout><callout arearefs="rhl-ifconfig-ifconfig-dns"><para>The value of the first listed
       <literal moreinfo="none">nameserver</literal> is the entPrimary
       nameserverent.  Our example shows
       <literal moreinfo="none">10.255.1.1</literal>.</para></callout></calloutlist></screenco></example></section><section id="rhl-liloconfig"><title>Record LILO configuration</title><para>Record the current value of <literal moreinfo="none">append=</literal>,
   <literal moreinfo="none">boot=</literal> and <literal moreinfo="none">linear</literal> in
   <filename moreinfo="none">/etc/lilo.conf</filename>.</para><example id="rhl-liloconfig-lilo"><title>Displaying the <application moreinfo="none">LILO</application>
    configuration</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">fgrep append= /etc/lilo.conf</command>
<computeroutput moreinfo="none">append="console=tty0 console=ttyS0,9600n8"</computeroutput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">fgrep boot= /etc/lilo.conf</command>
<computeroutput moreinfo="none">boot=/dev/hda</computeroutput>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">fgrep linear /etc/lilo.conf</command>
<prompt moreinfo="none">bash#</prompt></screen></example><para>If the <literal moreinfo="none">boot=</literal> parameter points to a hard
   disk then <application moreinfo="none">LILO</application> is installed in the
   master boot record, or <acronym>MBR</acronym>.  It can also point to
   a partition.</para><para>If the <literal moreinfo="none">linear</literal> parameter is present then
   the hard disk that is booted from uses linear block addressing, or
   <acronym>LBA</acronym>.</para></section><section id="rhl-upgrade"><title>Upgrade Red Hat distribution</title><para>In this section it all comes together.  We will walk through
    an entire serial console upgrade, not that it differs much from a
    standard text mode upgrade.</para><para>Configure <acronym>BIOS</acronym> to boot from floppy or
    insert the floppy disk. Now reboot the machine.</para><informalfigure float="0"><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">shutdown -r now</command>
<computeroutput moreinfo="none">SYSLINUX 1.64 1.64-pre2   Copyright (C) 1994-2001 H. Peter Anvin
                Welcome to Red Hat Linux 7.1!
 -  To install or upgrade Red Hat Linux in graphical mode, 
    press the entENTERent key.
 -  To install or upgrade Red Hat Linux in text mode, type: text entENTERent.
 -  To enable low resolution mode, type: lowres entENTERent.  
    Press entF2ent for more information about low resolution mode.
 -  To disable framebuffer mode, type: nofb entENTERent.  
    Press entF2ent for more information about disabling framebuffer mode.
 -  To enable expert mode, type: expert entENTERent.  
    Press entF3ent for more information about expert mode.
 -  To enable rescue mode, type: linux rescue entENTERent.  
    Press entF5ent for more information about rescue mode.
 -  If you have a driver disk, type: linux dd entENTERent.
 -  Use the function keys listed below for more information.
[F1-Main] [F2-General] [F3-Expert] [F4-Kernel] [F5-Rescue]
boot: 
Loading initrd.img..............
Loading vmlinuz............. ready.
Linux version 2.4.2-2BOOT (root@porky.devel.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-79)) #1 Sun Apr 8 18:24:33 EDT 2001</computeroutput></screen></informalfigure><para>Because we have booted into expert mode, the menus differ
   slightly from the standard upgrade.  For example, you probably
   don't have a driver disk.</para><informalfigure float="0"><screen format="linespecific"> Welcome to Red Hat Linux
+----------+ Devices +-----------+
|                                |
| Do you have a driver disk?     |
|                                |
|    +-----+          +----+     |
|    | Yes |          |[No]|     |
|    +-----+          +----+     |
|                                |
+--------------------------------+</screen></informalfigure><para>The upgrade then continues in the usual fashion.</para><informalfigure float="0"><screen format="linespecific">+--------+ Choose a Language +---------+
|                                      |
| What language should be used during  |
| the installation process?            |
|                                      |
|            Czech       :             |
|          [ English     : ]           |
|            Danish      :             |
|            French      :             |
|            German      :             |
|            Hungarian   :             |
|            Icelandic   :             |
|            Italian     :             |
|                                      |
|               +----+                 |
|               |[OK]|                 |
|               +----+                 |
|                                      |
+--------------------------------------+</screen></informalfigure><para>Select <guimenuitem moreinfo="none">HTTP</guimenuitem> to upgrade from the
   web server we prepared previously.</para><informalfigure float="0"><screen format="linespecific">+-----+ Installation Method +------+
|                                  |
| What type of media contains the  |
| packages to be installed?        |
|                                  |
|            NFS image             |
|            FTP                   |
|          [ HTTP ]                |
|                                  |
|     +----+         +------+      |
|     |[OK]|         | Back |      |
|     +----+         +------+      |
|                                  |
+----------------------------------+</screen></informalfigure><para>Here we supply the network details recorded in <xref linkend="rhl-ifconfig-ifconfig"></xref>.  If your network supports Dynamic
   Host Configuration Protocol or the Bootstrap Protocol then these
   work fine too.</para><informalfigure float="0" id="rhl-upgrade-ipaddr"><screen format="linespecific">+--------------------+ Configure TCP/IP +--------------------+
|                                                            |
| Please enter the IP configuration for this machine. Each   |
| item should be entered as an IP address in dotted-decimal  |
| notation (for example, 1.2.3.4).                           |
|                                                            |
|       [ ] Use dynamic IP configuration (BOOTP/DHCP)        |
|                                                            |
|           IP address:           10.1.2.3________           |
|           Netmask:              255.255.255.0___           |
|           Default gateway (IP): 10.1.2.254______           |
|           Primary nameserver:   10.255.1.1______           |
|                                                            |
|            +----+                      +------+            |
|            |[OK]|                      | Back |            |
|            +----+                      +------+            |
|                                                            |
+------------------------------------------------------------+</screen></informalfigure><para>Provide the name of the pre-prepared web server.  Note that
   the response to <guimenuitem moreinfo="none">Red Hat directory</guimenuitem> must
   start with a <filename class="directory" moreinfo="none">/</filename>.</para><informalfigure float="0"><screen format="linespecific">+-----------------+ HTTP Setup +-----------------------------------+
|                                                                  |
| Please enter the following information:                          |
|                                                                  |
|     o the name or IP number of your web server                   |
|     o the directory on that server containing                    |
|       Red Hat Linux for your architecure                         |
|                                                                  |
|   Web site name:     www.example.edu.au_______________________   |
|   Red Hat directory: /redhat/linux/7.1-20020202/en/os/i386____   |
|                                                                  |
|         +----+                 +------+                          |
|         |[OK]|                 | Back |                          |
|         +----+                 +------+                          |
|                                                                  |
+------------------------------------------------------------------+</screen></informalfigure><para>The following status messages then fly by before the welcome
   screen appears.</para><informalfigure float="0"><screen format="linespecific"><guilabel moreinfo="none">Retrieving base/netstg1.img...</guilabel>
<guilabel moreinfo="none">Loading /mnt/runtime ramdisk...</guilabel>
<guilabel moreinfo="none">Retrieving base/netstg2.img...</guilabel>
<guilabel moreinfo="none">Loading /mnt/runtime/usr ramdisk...</guilabel>
<guilabel moreinfo="none">Running anaconda - please wait...</guilabel>
<guilabel moreinfo="none">Graphical installation not available for http installs.  Starting text mode.</guilabel></screen><screen format="linespecific">+----------------+ Red Hat Linux +-----------------+
|                                                  |
| Welcome to Red Hat Linux!                        |
|                                                  |
| This installation process is outlined in detail  |
| in the Official Red Hat Linux Installation       |
| Guide available from Red Hat Software. If you    |
| have access to this manual, you should read the  |
| installation section before continuing.          |
|                                                  |
| If you have purchased Official Red Hat Linux,    |
| be sure to register your purchase through our    |
| web site, http://www.redhat.com/.                |
|                                                  |
|         +----+                 +------+          |
|         |[OK]|                 | Back |          |
|         +----+                 +------+          |
|                                                  |
+--------------------------------------------------+</screen></informalfigure><para>Select <guimenuitem moreinfo="none">Upgrade Existing
   Installation</guimenuitem>, although this procedure works fine for
   installations as well.</para><informalfigure float="0"><screen format="linespecific">+--------------+ Installation Type +--------------+
|                                                 |
| What type of system would you like to install?  |
|                                                 |
|          Workstation                            |
|          Server System                          |
|          Laptop                                 |
|          Custom System                          |
|        [ Upgrade Existing Installation ]        |
|                                                 |
|         +----+                +------+          |
|         | OK |                | Back |          |
|         +----+                +------+          |
|                                                 |
+-------------------------------------------------+</screen></informalfigure><para>The upgrade continues.  When the <guimenu moreinfo="none">LILO
   Configuration</guimenu> screen appears insert the kernel parameters
   recorded from <xref linkend="rhl-liloconfig-lilo"></xref>.  These
   parameters should include
   <literal moreinfo="none">console=ttySent</literal>.</para><informalfigure float="0"><screen format="linespecific">+---------------------+ LILO Configuration +---------------------+
|                                                                |
| A few systems will need to pass special options to the kernel  |
| at boot time for the system to function properly. If you need  |
| to pass boot options to the kernel, enter them now. If you     |
| don't need any or aren't sure, leave this blank.               |
|                                                                |
|       [ ] Use linear mode (needed for some SCSI drives)        |
|                                                                |
|        console=tty0 console=ttyS0,9600n8_______________        |
|                                                                |
|       +----+              +------+             +------+        |
|       | OK |              | Skip |             | Back |        |
|       +----+              +------+             +------+        |
|                                                                |
+----------------------------------------------------------------+</screen></informalfigure><informalfigure float="0"><screen format="linespecific">+-------------+ LILO Configuration +--------------+
|                                                 |
|  Where do you want to install the bootloader?   |
|                                                 |
|[/dev/hda         Master Boot Record (MBR)      ]|
| /dev/hda1        First sector of boot partition |
|                                                 |
|         +----+                +------+          |
|         | OK |                | Back |          |
|         +----+                +------+          |
|                                                 |
+-------------------------------------------------+</screen></informalfigure><informalfigure float="0"><screen format="linespecific">+----------------------+ LILO Configuration +-----------------------+
|                                                                   |
| The boot manager Red Hat uses can boot other operating systems    |
| as well. You need to tell me what partitions you would like to    |
| be able to boot and what label you want to use for each of them.  |
|                                                                   |
| Device      Partition type            Default Boot label          |
|[/dev/hda6   Linux Native              *       linux     ] :       |
|                                                           :       |
|                                                           :       |
|                                                           :       |
|                                                           :       |
|                                                                   |
|        +----+              +------+              +------+         |
|        | Ok |              | Edit |              | Back |         |
|        +----+              +------+              +------+         |
|                                                                   |
|                                                                   |
+-------------------------------------------------------------------+</screen></informalfigure><para>The upgrade continues.  As installing the packages may take a
   few hours, you can disconnect.</para><informalfigure float="0"><screen format="linespecific">+-------------+ Package Installation +--------------+
|                                                   |
| Name   :                                          |
| Size   :                                          |
| Summary:                                          |
|                                                   |
|                  Packages       Bytes        Time |
| Total    :              0         0M              |
| Completed:              0         0M              |
| Remaining:              0         0M              |
|                                                   |
|                                                   |
+---------------------------------------------------+</screen></informalfigure><para>If you disconnected, then when reconnecting it is best to
   press <keycap moreinfo="none">Tab</keycap> rather than pressing
   <keycap moreinfo="none">Return</keycap>.</para><para>Pressing <keycap moreinfo="none">Return</keycap> on the
   <guimenu moreinfo="none">Bootdisk</guimenu> screen writes a boot disk.  This will
   overwrite the upgrade disk.</para><para>You may wish to deliberately create a boot disk if you cannot
   alter the <acronym>BIOS</acronym> parameters to boot from the hard
   disk, or if you cannot wait for someone to eject the floppy disk
   before rebooting.</para><informalfigure float="0"><screen format="linespecific">+------------------+ Bootdisk +-------------------+
|                                                 |
| A custom boot disk provides a way of booting    |
| into your Linux system without depending on     |
| the normal bootloader. This is useful if you    |
| don't want to install lilo on your system,      |
| another operating system removes lilo, or lilo  |
| doesn't work with your hardware configuration.  |
| A custom boot disk can also be used with the    |
| Red Hat rescue image, making it much easier to  |
| recover from severe system failures.            |
|                                                 |
| Would you like to create a boot disk for your   |
| system?                                         |
|                                                 |
|         +-----+                 +----+          |
|         |[Yes]|                 | No |          |
|         +-----+                 +----+          |
|                                                 |
+-------------------------------------------------+</screen></informalfigure><para>When the <guimenu moreinfo="none">Complete</guimenu> screen appears prepare
   to reboot into Linux.  If you have a serial <acronym>BIOS</acronym>
   be prepared to alter the <acronym>BIOS</acronym> parameters to boot
   from the hard disk first.  If you do not have a serial
   <acronym>BIOS</acronym> ask someone to eject the floppy disk.</para><informalfigure float="0"><screen format="linespecific">+-----------------+ Complete +------------------+
|                                               |
| Congratulations, installation is complete.  # |
|                                             : |
| Press return to reboot, and be sure to      : |
| remove your boot medium after the system    : |
| reboots, or your system will rerun the      : |
| install. For information on fixes which     : |
| are available for this release of Red Hat   : |
| Linux, consult the Errata available from    : |
| http://www.redhat.com/errata.               : |
|                                             : |
| Information on configuring and using your   : |
| Red Hat Linux system is contained in the    : |
|                                               |
|                    +----+                     |
|                    |[OK]|                     |
|                    +----+                     |
|                                               |
+-----------------------------------------------+</screen><screen format="linespecific"><computeroutput moreinfo="none">sending termination signals...done
sending kill signals...done
disabling swap...
	/tmp/swap/hda5
unmounting filesystems...
	/mnt/sysimage/var/www/html
	/mnt/sysimage/boot
	/mnt/sysimage/proc
	/mnt/runtime/usr
	/mnt/sysimage
	/proc/bus/usb
	/mnt/runtime
	/dev/pts
	/proc
rebooting system
Restarting system.

LILO 
Loading linux......................
Linux version 2.4.3-12 (root@porky.devel.redhat.com) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)) #1 Fri Jun 8 15:05:56 EDT 2001</computeroutput></screen></informalfigure></section><section id="rhbootdisk"><title>Create boot disk for serial console</title><para>Once the upgrade has been sucessfully done create a boot
   floppy which has serial console support.  This is most simply done
   by creating a boot disk, as done by the
   <application moreinfo="none">anaconda</application> installer or as described in
   <xref linkend="preparation-fallback"></xref>; modifying the configuration
   file <filename moreinfo="none">\SYSLINUX.CFG</filename> to configure the boot
   loader to use the serial console, as described in <xref linkend="configure-boot-loader-syslinux"></xref>; and finally configuring
   the kernel to use the serial console, as described in <xref linkend="configure-kernel-syslinux"></xref>.</para><para>An alternative is to create your own
   <application moreinfo="none">mkbootdisk</application> <acronym>RPM</acronym>
   package containing a modified copy of the shell script
   <filename moreinfo="none">/sbin/mkbootdisk</filename>.</para><para>The <filename moreinfo="none">\SYSLINUX.CFG</filename> file on the boot
   floppy is written by <command moreinfo="none">mkbootdisk</command> using the code
   in <xref linkend="rhbootdisk-mkbootdisk-original"></xref>.  We alter this
   code to use the serial console; the result is shown in <xref linkend="rhbootdisk-mkbootdisk-serial"></xref>.</para><figure float="0" id="rhbootdisk-mkbootdisk-original"><title>Extract from Red Hat Linux 7.2
    <filename moreinfo="none">mkbootdisk</filename> which creates
    <filename moreinfo="none">SYSLINUX.CFG</filename></title><programlisting format="linespecific">cat ent $MOUNTDIR/syslinux.cfg ententEOF
default linux
prompt 1
display boot.msg
timeout 100
label linux
  kernel vmlinuz
  append $INITRDARG root=$rootdev
EOF</programlisting></figure><figure float="0" id="rhbootdisk-mkbootdisk-serial"><title>Altered extract from <filename moreinfo="none">mkbootdisk</filename>, which
    creates a <filename moreinfo="none">SYSLINUX.CFG</filename> that uses a serial
    console</title><programlisting format="linespecific">cat ent $MOUNTDIR/syslinux.cfg ententEOF
serial 0 9600
default linux
prompt 1
display boot.msg
timeout 100
label linux
  kernel vmlinuz
  append $INITRDARG root=$rootdev console=tty0 console=ttyS0,9600n8
EOF</programlisting></figure><para>Created boot floppies will now use the serial console.</para><para>By far the best alternative would be the addition of
   parameters to <command moreinfo="none">mkbootdisk</command> to allow the kernel
   parameters and serial port, speed and flow control to be given when
   the boot floppy is created.  For this enhancement request see Red
   Hat Bugzilla entry <ulink url="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=59351">59351</ulink>.</para></section><section id="rhreferences"><title>Further references</title><para>Sometimes the kernel on the installation
   <acronym>CD</acronym> won't boot on the machine to be upgraded, or
   the filesystem requires modules that are not present.  In this case
   you will need to build a new kernel and rebuild the installation
   disk to use the new kernel.  This is documented in the <ulink url="http://cambuca.ldhs.cetuc.puc-rio.br/RedHat7-CDs-HowTo.html"><citetitle>RedHat7
   CDs mini-HowTo</citetitle></ulink>.  This is an informal HOWTO not
   available through the Linux Documentation Project.</para><para>An older document that more fully describes an older Red Hat
   distribution build process is <ulink url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/RedHat-CD-HOWTO.html"><citetitle>Burning
   a RedHat CD HOWTO</citetitle></ulink>.</para></section></appendix><appendix id="debian"><title>Upgrading <productname class="trade">Debian
  <acronym>GNU</acronym>/Linux</productname> from a serial
  console</title><para>Make a boot disk and a root disk.</para><para>Boot the boot disk with the parameter
  <literal moreinfo="none">console=ttyS0,9600</literal>.</para><para>Start the install program.</para></appendix><appendix id="ts"><title>Terminal server configuration</title><para>Terminal servers were originally designed for connecting
  terminals to minicomputers.  Each terminal would have an
  <acronym>RS-232</acronym> port.  The connection to the minicomputer
  usually used an ethernet port.  Connecting terminals would be
  connected to a command line interface where they could select from a
  list of predefined machines.  A <application moreinfo="none">Telnet</application>
  session would then be started to that machine.</para><para>Over time terminal servers gained more features.  For example,
  modems could be connected.  These initially allowed people to dial
  in to the minicomputer but grew in features until most terminal
  servers became routers with a great number of serial ports.</para><para>As well as allowing the connection of many console to a single
  terminal, the terminal server can be configured with user accounts
  and passwords, preventing unauthenticated access to the console
  whilst still allowing the console to be reached from any
  modem.</para><para>This remainder of this section lists the considerations when
  purchasing terminal servers and the cabling pinouts and basic
  software configuration needed for differing types of terminal
  servers.</para><para>Further contributions are welcome and should be e-mailed to
  the maintainer of this <citetitle>HOWTO</citetitle>.</para><section id="ts-buy"><title>Considerations when buying second-hand terminal
   servers</title><para>Internet Service Providers have been large users of terminal
   servers in the past.  Each modem would be connected to a terminal
   server port and incoming users would be permitted to send
   <acronym>IP</acronym> packets anywhere, not just to some predefined
   minicomputer.  Manufacturers renamed the equipment to entaccess
   serversent or entmodem serversent to reflect this new
   use.</para><para>These access servers have been superseded by a new generation
   which allows telephone trunks to be plugged directly into the
   <acronym>ISP</acronym>'s router.  There are no discrete modems; the
   modem tones are decoded by digital signal processing chips within
   the router.  As a result terminal servers are currently readily
   available on the second-hand market.</para><para>When purchasing a second-hand terminal server ensure that you
   are also buying the rights to the software.  Some companies license
   their software and have contract terms which state that the license
   cannot be resold, but has to be repurchased from the company if the
   terminal server changes hands.</para><para>Many vendors require a current maintenance contract to obtain
   software updates.  These maintenance agreements can be expensive, a
   common figure is 15% per annum of the manufacturer's retail price.
   You may be able to source a cheaper software updates from a
   third-party maintenance supplier.</para><para>Many older terminal servers are no longer sold or supported
   by their vendors.  Search the vendor's web site for entend of
   lifeent.</para><para>Vendor support can be a particular issue when the
   most-recently available software does not fit within the
   <acronym>RAM</acronym> or flash memory contraints of the terminal
   server you have purchased.  You should check this before purchasing
   a seond-hand terminal server.  Upgrading flash memory can be
   particularly difficult, as the <acronym>ROM</acronym> on the
   motherboard may also need to be replaced with one aware of the new
   flash memory's characteristics.<footnote><para>This is a fault with the design of flash memory.  It
     identifies itself with a model designator rather than with the
     timings required to read and write the memory.  So to load
     software from flash memory the boot <acronym>ROM</acronym> must
     have a table of flash memory models and
     timings.</para></footnote></para><para>Third-party parts suppliers such as <ulink url="http://www.kingston.com/">Kingston</ulink> or <ulink url="http://www.memoryx.net/">MemoryX</ulink> can usually provide
   dynamic <acronym>RAM</acronym> and flash memory.  They cannot
   usually supply <acronym>ROM</acronym>s or static
   <acronym>RAM</acronym>.</para><para>Most old terminal servers will not support
   <application moreinfo="none">Secure Shell</application>.  In this is the case
   accessing the terminal server by its ethernet port is a poor idea:
   when you login to the console you password will travel across the
   Internet in clear text.  Either dial in to the terminal server or
   use a one-time password system such as the
   <productname class="trade"><acronym>RADIUS</acronym></productname> protocol with
   <productname class="trade">S/KEY</productname> authentication.</para><para>An alternative to using a terminal server is to use a
   multiport serial card in another <systemitem class="osname" moreinfo="none">Linux</systemitem> system.</para></section><section id="ts-cisco2511"><title><productname class="trade">Cisco 2511</productname></title><para>The basic configuration for a Cisco 2511 access server is
   shown in <xref linkend="ts-cisco2511-config"></xref>.  A similar
   configuration will work for other Cisco access servers.  Cisco has
   excellent documentation at its <ulink url="http://www.cisco.com/">web site</ulink>; start by finding the
   correct <citetitle>Configuration guide</citetitle>.</para><para>A current maintenance contract with Cisco or a reseller is
   required to download software updates.  This contract also includes
   the provision of <acronym>ROM</acronym>s required for flash memory
   upgrades.  In most jurisdictions Cisco software licenses are not
   transferrable, so if you purcashed the access server on the
   second-hand market you will need to purchase a software license
   from Cisco or a reseller.</para><figure float="0" id="ts-cisco2511-config"><title>Basic configuration for <productname class="trade">Cisco
    2511</productname> terminal server to <systemitem class="osname" moreinfo="none">Linux</systemitem> <acronym>PC</acronym></title><programlisting format="linespecific">interface Async1
 description To Linux computer
 ip unnumbered Loopback0
 async mode interactive
 no peer default ip address

line 1
 location To Linux PC
 session-timeout 30
 no exec
 login
 modem InOut
 terminal-type vt100
 special-character-bits 8
 transport preferred none
 transport input telnet
 telnet break-on-ip
 telnet ip-on-break
 stopbits 1
 flowcontrol hardware

line vty 0 4
 location Network
 password <replaceable>PASSWORD</replaceable>
 login local
 terminal-type vt100
 transport preferred none
 transport output telnet</programlisting></figure><para>There is a <ulink url="http://www.mcvax.org/~koen/uClinux-cisco2500/">port</ulink> of
   Linux to the <productname class="trade">Cisco 2500</productname> series of
   routers.  At the time of writing it did did not support the
   asycnhronous ports on the <productname class="trade">Cisco 2511</productname>.
   The attractiveness of running <systemitem class="osname" moreinfo="none">Linux</systemitem>
   instead of running Cisco's <productname class="trade">IOS</productname> is that
   <systemitem class="osname" moreinfo="none">Linux</systemitem> can support <productname class="trade">SSH</productname>.  At the time of writing Cisco were
   yet to release <productname class="trade">SSH</productname> on the
   <productname class="trade">Cisco 2500</productname> series of routers, although a
   unofficial beta version has been seen.</para></section><section id="ts-maxserver"><title>Xyplex/iTouch <productname class="trade">MAXserver
   1600</productname></title><para>A good site for information on Xyplex terminal servers is
   <ulink url="http://www.gno.org/~gdr/xyplex/"></ulink>.  Cabling is
   discussed at <ulink url="http://www.conserver.com/consoles/xyplexcons.html"></ulink>.</para><para>The Xyplex terminal servers are now manufacturered by <ulink url="http://www.itouchcom.com/">iTouch Communications</ulink>.  A
   current maintenance contract with iTouch is required to download
   software updates.</para></section><section id="ts-annex"><title>Xylogics/Bay/Nortel <productname class="trade">Annex</productname></title><para>A good site for information on
   <productname class="trade">Annex</productname> terminal servers is <ulink url="http://www.ofb.net/~jheiss/annex/"></ulink>.</para></section><section id="ts-pm"><title>Livingston/Lucent <productname class="trade">Portmaster</productname></title><para>Firstly configure the terminal server, as shown in <xref linkend="ts-pm-basic"></xref>.  This figure uses the system name
   <literal moreinfo="none">example</literal>, with IP address 10.1.2.3, address mask
   255.255.255.0, gateway address 10.1.2.254, and DNS server address
   10.1.1.1.  Replace these addresses with the addresses used in your
   network.</para><figure float="0" id="ts-pm-basic"><title>Portmaster unit configuration</title><screen format="linespecific"><userinput moreinfo="none">set sysname example</userinput>
<userinput moreinfo="none">set password <replaceable>PASSWORD</replaceable></userinput>
<userinput moreinfo="none">set ether0 address 10.1.2.3</userinput>
<userinput moreinfo="none">set ether0 netmask 255.255.255.0</userinput>
<userinput moreinfo="none">set ether0 broadcast high</userinput>
<userinput moreinfo="none">set gateway 10.1.2.254</userinput>
<userinput moreinfo="none">set namesvc dns</userinput>
<userinput moreinfo="none">set nameserver 10.1.1.1</userinput>
<userinput moreinfo="none">save all</userinput></screen></figure><para>Now configure each serial port of the terminal server, as
   shown in <xref linkend="ts-pm-port"></xref>.</para><figure float="0" id="ts-pm-port"><title>Portmaster port configuration</title><screen format="linespecific"><userinput moreinfo="none">set s0 service_device telnet 2000</userinput>
<userinput moreinfo="none">set s0 device</userinput>
<userinput moreinfo="none">reset s0</userinput>
<userinput moreinfo="none">set s1 service_device telnet 2001</userinput>
<userinput moreinfo="none">set s1 device</userinput>
<userinput moreinfo="none">reset s1</userinput>
ent
<userinput moreinfo="none">set s29 service_device telnet 2029</userinput>
<userinput moreinfo="none">set s29 device</userinput>
<userinput moreinfo="none">reset s29</userinput>
<userinput moreinfo="none">save all</userinput></screen></figure><para>To connect to serial port 0 enter the command <userinput moreinfo="none">telnet
   example 2000</userinput>.  Use the associated TCP port number to
   connect to telnet to the other serial devices.</para></section></appendix><appendix id="advice"><title>Gratuitous advice for developers</title><section id="advice-bootloader"><title>Advice for boot loader authors</title><para>Serial console support in a boot loader is very useful.
   Thank you for supporting it.</para><para>The boot loader should support the
   <productnumber>8250A</productnumber> <acronym>UART</acronym> and
   its programming-compatible <productnumber>82510</productnumber>,
   <productnumber>16450</productnumber>,
   <productnumber>16550</productnumber> and
   <productnumber>16750</productnumber> descendants.  The serial chip
   used in the <productname class="trade">IBM PC/XT</productname>, the
   <productnumber>8250</productnumber> (no A), and its
   <productnumber>8250B</productnumber> descendant need not be
   supported.  The <productnumber>8250A</productnumber> data sheet is
   <ulink url="http://www.intersil.com/data/FN/FN2/FN2958/FN2958.pdf"><citetitle><productnumber>82C50A</productnumber>
   <productname class="trade">CMOS Asynchronous Communications
   Element</productname></citetitle></ulink> and is updated by Intel's
   errata <ulink url="http://support.intel.com/support/controllers/peripheral/7513.htm"><citetitle><productnumber>82510</productnumber>
   PC Software Compatibility</citetitle></ulink>.  The
   <productnumber>16550</productnumber> data sheet is <ulink url="http://www.national.com/ds/PC/PC16550D.pdf"><citetitle><productnumber>PC16550D</productnumber>
   <productname class="trade">Universal Asynchronous Receiver/Transmitter with
   FIFOs</productname></citetitle></ulink>.</para><para>To set the serial port and serial parameters, most
   <acronym>Linux</acronym> boot loaders use a syntax modeled upon the
   kernel's <literal moreinfo="none">console</literal> parameter.  It would be nice to
   retain this consistency, since the user needs to learn the kernel
   syntax in any case.</para><para>The default value should be 9600<abbrev>bps</abbrev>, 8 data
   bits, no parity, 1 stop bit and
   <acronym>CTS</acronym>/<acronym>RTS</acronym> flow control.  This
   gives the maximum interoperability with the other programs that use
   the serial console.</para><para>Please do not ignore the lower speeds, as remote serial
   console is at its most valuable when the computer is located three
   days walk up a mountain in the New Guinea highlands.  It is
   difficult to get more than 75<abbrev>bps</abbrev> from
   <acronym>HF</acronym> radio under adverse sky conditions.</para><para>Be conservative in your use of the modem status lines.  Even
   if you are ignoring incoming status (<acronym>DSR</acronym>,
   <acronym>DCD</acronym>) and handshaking lines (<acronym>RTS</acronym>)
   at least assert the outgoing status (<acronym>DTR</acronym>) and
   handshaking (<acronym>CTS</acronym>) lines.  Correctly configured
   modems will not receive calls with <acronym>DTR</acronym> low, and
   dropping <acronym>DTR</acronym> will cause the modem to hang
   up.</para><para>Consider that the <acronym>BIOS</acronym> may have already
   initialised the <acronym>UART</acronym> and provide a configuration
   option to allow the boot loader to be informed of that.  When the
   boot loader initialises the <acronym>UART</acronym>,
   <acronym>DTR</acronym> will fall and the line will hang up.  In some
   scenarios each hang up requires the satelite circuit to be
   re-booked before another call can be placed. </para><para>Cater for line noise.  Imagine the boot loader starting and
   then being sent nonsensical characters every few seconds.  Although
   this is certainly wrong, a fault in a modem is difficult to
   remotely diagnose and correct if the machine is left stranded at
   the boot loader prompt.  A solution is to boot the default image
   upon the expiry of a timer; the boot occurring even if the user (or
   line noise) has started to type.  For example the boot loader
   configuration could say:</para><informalfigure float="0"><programlisting format="linespecific"><lineannotation># Start the machine regardless after 30 minutes
#   30 * 60 seconds per minute * units of tenths of seconds</lineannotation>
<command moreinfo="none">lifetime 18000</command></programlisting></informalfigure><para>The default should be no life timer.  The timer is also
   useful in high availability applications: when a machine is used in
   environments with an planned availability of 99.999% the lifetime
   value should be configured to three minutes or less.</para><para>Check information read from the BIOS for reasonablness.  For
   example, if the BIOS's Extended Data Area suggests 0x000 as the
   address for the serial port's registers then don't try to
   initialise the registers.</para></section><section id="advice-bios"><title>Advice for <acronym>BIOS</acronym> authors</title><para>Thank you for adding support for remote operations to your
   <acronym>BIOS</acronym>.  A few points will maximize the benefits of
   that support, most of them are listed in <xref linkend="advice-bootloader"></xref>.</para><itemizedlist><listitem><para>Keep the user interface simple.  There is no need for fancy
     cursor-addressed terminal support.  Fancy features simply limit
     the number of client terminal emulators that can be used.  A
     surprising number of these have very buggy <acronym>DEC</acronym>
     <productname class="trade">VT100</productname> implementations.</para><para>In addition to supporting lower speeds, also test your user
     interface at low data rates.</para></listitem><listitem><para>Don't do too much.  In <systemitem class="osname" moreinfo="none">Linux</systemitem> the
     boot loader and operating system both have explicit support for a
     serial console.  So all the <acronym>BIOS</acronym> need do is to
     support the a serial interface for itself.
     <systemitem class="osname" moreinfo="none">Linux</systemitem> has no need for a generic serial
     redirection facility.  If you do provide such a facility for
     other operating systems, please allow it to be disabled after
     system boot.</para></listitem><listitem><para>Don't allow line noise to prevent the computer from
     booting.  Don't require just one key to enter the
     <acronym>BIOS</acronym> configuration, make your users and your
     marketing people happy by using a phrase like
     <literal moreinfo="none">dell</literal>, <literal moreinfo="none">hp</literal> or
     <literal moreinfo="none">ibm</literal>. Copy the <literal moreinfo="none">lifetime</literal> idea
     from <xref linkend="advice-bootloader"></xref>.</para></listitem><listitem><para>Present a consistent prompt.  Imagine a user with a
     supercomputer array of five hundred <acronym>PC</acronym>s.  You
     want to change a <acronym>BIOS</acronym> parameter.  Make it easy
     for <application moreinfo="none"><ulink url="http://expect.nist.gov/">Expect</ulink></application> to set
     those parameters.</para></listitem><listitem><para>Make sure the <systemitem class="osname" moreinfo="none">Linux</systemitem> utilities
     work.  Check that the <systemitem class="osname" moreinfo="none">Linux</systemitem>
     <function moreinfo="none">nvram</function> device driver returns the full
     contents of <acronym>CMOS</acronym>.  This makes it simple to set
     the same <acronym>CMOS</acronym> settings on a large number of
     machines.  The commands in <xref linkend="advice-bios-nvramget"></xref>
     and <xref linkend="advice-bios-nvramset"></xref> should work to copy the
     <acronym>BIOS</acronym> settings from one machine to another, where
     the make, model and <acronym>BIOS</acronym> versions of the
     machines are the same.</para><figure float="0" id="advice-bios-nvramconfig"><title>Configuring /dev/nvram to access the
      <acronym>CMOS</acronym> configuration</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">/dev/MAKEDEV nvram</command>
<prompt moreinfo="none">bash#</prompt> <command moreinfo="none">vi /etc/modules.conf</command></screen><programlisting format="linespecific">alias char-major-10-144 nvram</programlisting><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">depmod -a</command></screen></figure><figure float="0" id="advice-bios-nvramget"><title>Getting the <acronym>CMOS</acronym> configuration</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">cat /dev/nvram ent /etc/nvram.bin</command></screen></figure><figure float="0" id="advice-bios-nvramset"><title>Setting the <acronym>CMOS</acronym> configuration</title><screen format="linespecific"><prompt moreinfo="none">bash#</prompt> <command moreinfo="none">cat /etc/nvram.bin ent /dev/nvram</command></screen></figure></listitem><listitem><para>Have a flash <acronym>BIOS</acronym> upgrade program that
     works from <systemitem class="osname" moreinfo="none">Linux</systemitem>.  Make the source
     code to this available.  Or publish the specifications so that
     one can be written.</para><para>Many flash <acronym>BIOS</acronym> update programs run from
     a Microsoft <productname class="trade"><acronym>MS-DOS</acronym></productname>
     boot diskette.  Please check that the program also works with the
     similar <productname class="trade">Free<acronym>DOS</acronym></productname>
     operating system.  Many Linux computers do not have licenses for
     Microsoft operating system software, so legally creating a
     <productname class="trade"><acronym>MS-DOS</acronym></productname> boot
     diskette may not be possible.</para></listitem><listitem><para>Be clear in the documentation about what serial servies the
     BIOS provides.  Some <acronym>BIOS</acronym>s with a
     entserial redirectionent feature don't allow the
     <acronym>BIOS</acronym> to be redirected to a plain text
     terminal, but instead use a proprietary protocol.  This isn't of
     much use to <systemitem class="osname" moreinfo="none">Linux</systemitem> serial
     console users.</para></listitem></itemizedlist></section></appendix><appendix id="about"><title>About this <citetitle>HOWTO</citetitle></title><section id="about-copyright"><title>Copyright</title><para>The first edition of this document is copyright ent 2001
   Mark <abbrev>F.</abbrev> Komarinski and is distributed under the
   terms of the <citetitle>Linux Documentation Project
   (<acronym>LDP</acronym>) License</citetitle>, see <xref linkend="about-copyright-ldp"></xref>.</para><para>The revisions to this document for the second edition are
   copyright ent AARNet Pty Ltd (Australian Company Number 084 540
   518), 2001ent2003.  These parts were written by Glen Turner.
   He asserts his moral rights to be identified as one of the authors
   of this work under the <citetitle>Copyright Act 1968 (Commonwealth
   of Australia)</citetitle>.  The Australian Academic and Research
   Network and Glen Turner distribute these parts under the terms of
   the <citetitle>Linux Documentation Project (<acronym>LDP</acronym>)
   License</citetitle>, see <xref linkend="about-copyright-ldp"></xref>.</para><para>This license meets the <ulink url="http://www.debian.org/social_contract.html#guidelines">Debian
   Free Software Guidelines</ulink>, so you should find this
   <citetitle>HOWTO</citetitle> in the Debian package
   <filename moreinfo="none">doc-linux-html</filename>.</para><section id="about-copyright-ldp"><title><citetitle>Linux Documentation Project
    License</citetitle></title><para>Unless otherwise stated, <systemitem class="osname" moreinfo="none">Linux</systemitem> <citetitle>HOWTO</citetitle>
    documents are copyrighted by their respective authors. <systemitem class="osname" moreinfo="none">Linux</systemitem> <citetitle>HOWTO</citetitle>
    documents may be reproduced and distributed in whole or in part,
    in any medium physical or electronic, as long as this copyright
    notice is retained on all copies. Commercial redistribution is
    allowed and encouraged; however, the author would like to be
    notified of any such distributions.</para><para>All translations, derivative works, or aggregate works
    incorporating any <systemitem class="osname" moreinfo="none">Linux</systemitem>
    <citetitle>HOWTO</citetitle> documents must be covered under this
    copyright notice. That is, you may not produce a derivative work
    from a <citetitle>HOWTO</citetitle> and impose additional
    restrictions on its distribution. Exceptions to these rules may be
    granted under certain conditions; please contact the <systemitem class="osname" moreinfo="none">Linux</systemitem> <citetitle>HOWTO</citetitle>
    coordinator at the address given below.</para><para>In short, we wish to promote dissemination of this
    information through as many channels as possible. However, we do
    wish to retain copyright on the <citetitle>HOWTO</citetitle>
    documents, and would like to be notified of any plans to
    redistribute the <citetitle>HOWTO</citetitle>s.</para><para>If you have any questions, please contact
    <email>linux-howto@metalab.unc.edu</email>.</para></section></section><section id="about-disclaimer"><title>Disclaimer</title><para>No liability for the contents of this documents can be
   accepted.  Use the concepts, examples and other content at your own
   risk.  As this is a new edition of this document, there may be
   errors and inaccuracies, that may of course be damaging to your
   system.  Proceed with caution, and although this is highly
   unlikely, the author(s) do not take any responsibility for
   that.</para><para>All copyrights are held by their by their respective owners,
   unless specifically noted otherwise.  Use of a term in this
   document should not be regarded as affecting the validity of any
   trademark or service mark.</para><para>Naming of particular products or brands should not be seen as
   endorsements.</para><para>You are strongly recommended to take a backup of your system
   before major installation and backups at regular intervals.</para></section><section id="about-credits"><title>Acknowledgments</title><para>The first edition of this <citetitle>HOWTO</citetitle> was
   written by Mark Komarinski.  It was based upon
   <filename moreinfo="none">/usr/src/linux/Documentation/serial-console.txt</filename>,
   which was written by Miquel van Smoorenburg.</para><para>The second edition of this <citetitle>HOWTO</citetitle> was
   written by the staff of the <ulink url="http://www.aarnet.edu.au/">Australian Academic and Research
   Network</ulink>, mainly Glen Turner and David Vu.</para><para>The following people have contributed to this
   <citetitle>HOWTO</citetitle>.  They are listed in no particular
   order.</para><variablelist><varlistentry><term>LinuxSA mailing list</term><listitem><para>Proof reading of the Second Edition.  <ulink url="http://www.linuxsa.org.au/">LinuxSA</ulink> is a
      <systemitem class="osname" moreinfo="none">Linux</systemitem> user group based
      in South Australia.</para></listitem></varlistentry><varlistentry><term>David Lawyer</term><listitem><para>Technical review of the Second Edition and recommending
      the updated <citetitle>HOWTO</citetitle> to the Linux
      Documentation Project.  David is author of the <ulink url="http://www.tldp.org/HOWTO/Text-Terminal-HOWTO.html"><citetitle>Text-Terminal-HOWTO</citetitle></ulink>.</para></listitem></varlistentry><varlistentry><term>Devin Reade</term><listitem><para>Xyplex terminal server information.  Devin maintains
      information about Xyplex terminal servers at <ulink url="http://www.gno.org/~gdr/xyplex/"></ulink>.</para></listitem></varlistentry><varlistentry><term>Michael Brown, Marc Mondragon and other members of the
     <citetitle>Linux on Dell PowerEdge</citetitle> mailing
     list</term><listitem><para>Technically described how the <acronym>BIOS</acronym>
      redirects characters to the serial port.  The <citetitle>Linux
      on Dell PowerEdge</citetitle> list can be subscribed to by
      sending a message containing <literal moreinfo="none">subscribe
      linux-poweredge</literal> to
      <email>linux-poweredge-request@dell.com</email>.</para></listitem></varlistentry><varlistentry><term>Thomas Lunde and Gabor Kiss</term><listitem><para>Noticed errors of grammar and typography.</para></listitem></varlistentry><varlistentry><term>Darren Young</term><listitem><para>Updates to
      <filename moreinfo="none">/etc/security/console.perms</filename> for
      <productname class="trade">Red Hat Linux</productname>
      <productnumber>7.2</productnumber>.</para></listitem></varlistentry><varlistentry><term>Yasufumi Haga</term><listitem><para>Spotted many errors whilst translating this
      <citetitle>HOWTO</citetitle> into Japanese for the
      <acronym>JF</acronym> Linux documentation endeavour.</para></listitem></varlistentry><varlistentry><term>Thomas Horsley</term><listitem><para>Pointed out that the <application moreinfo="none">X Window
      System</application> may still need to be running even if a
      serial console is used.  Supplied the <command moreinfo="none">gdm</command>
      configuration used in <xref linkend="misc-init-x11-gdmconf"></xref>.</para></listitem></varlistentry><varlistentry><term>Greg Matthews, Nathan Neulinger and Romildo Wildgrube</term><listitem><para>Encountered and reported that machines hang when booting
      if kernel parameter
      <literal moreinfo="none">console=ttyS</literal>ent<literal moreinfo="none">r</literal> is
      used.  This is due to a kernel bug which loops testing
      <acronym>CTS</acronym> without firstly checking that
      <acronym>DSR</acronym> and <acronym>DCD</acronym> are
      asserted.</para></listitem></varlistentry><varlistentry><term>Shaun Karl and Keisuke Nakao</term><listitem><para>Procedures for <productname class="trade">Debian
      <acronym>GNU</acronym>/Linux</productname>.</para></listitem></varlistentry><varlistentry><term>Igor Sviridov</term><listitem><para>Configuration of <productname class="trade">Livingstone
      Portmaster</productname> terminal server in <xref linkend="ts-pm"></xref>.</para></listitem></varlistentry><varlistentry><term>Sue Bauer-Lee</term><listitem><para>Suggested using the <literal moreinfo="none">off</literal> clause in
      <filename moreinfo="none">/etc/inittab</filename> in <xref linkend="getty-mingetty-inittab"></xref> rather than commenting or
      deleting the excess <application moreinfo="none">mingetty</application>
      invocations.  This has the advatage that no automated system
      administration tool will restore the excess
      <filename moreinfo="none">inittab</filename> entries.</para></listitem></varlistentry></variablelist></section><section id="about-feedback"><title>Comments and corrections</title><para>The current maintainer of this <citetitle>HOWTO</citetitle>
   is <author><firstname>Glen</firstname><surname>Turner</surname></author>.  Please send corrections,
   additions, comments and criticisms to
   <email>glen.turner+howto@aarnet.edu.au</email>.</para><para>The maintainer would also appreciate e-mails from people that
   have sucessfully used this <citetitle>HOWTO</citetitle> to
   configure serial consoles on their machines.  Please state the
   version of the <citetitle>HOWTO</citetitle> you used (see the cover
   page), your <systemitem class="osname" moreinfo="none">Linux</systemitem>
   distribution and its version, and the number of machines involved.
   This information allows the maintainer to show his employer
   sufficient public benefit for his work on this
   <citetitle>HOWTO</citetitle> to continue and will not be used for
   any other purpose.</para><para><systemitem class="osname" moreinfo="none">Linux</systemitem> is continually
   improving, so please send those small alterations required for the
   latest version of your <systemitem class="osname" moreinfo="none">Linux</systemitem> distribution.</para><para>The <citetitle>HOWTO</citetitle>'s maintainer is not a
   professional writer.  If you find some parts of this
   <citetitle>HOWTO</citetitle> difficult to comprehend then let the
   maintainer know.</para></section></appendix><colophon id="colophon"><para>Written in DocBook 4.1 <acronym>SGML</acronym>.
  <application moreinfo="none">XEmacs</application> and the
  <application moreinfo="none"><acronym>PSGML</acronym></application> package were
  used to create the <acronym>SGML</acronym> source file. The
  <acronym>HTML</acronym>, <productname class="trade">PostScript</productname> and
  <productname class="trade"><acronym>PDF</acronym></productname> output was
  generated from the DocBook source by the Linux Documentation
  Project.</para><para>It appears that some character entities such as quotes
  (entent entent) and ellipses (ent), appear as
  ampersands (ent) in the
  <productname class="trade"><acronym>PDF</acronym></productname> generated by the
  Linux Documentation Project.  In this case you may wish to download
  the <ulink url="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/ps/Remote-Serial-Console-HOWTO.ps.gz"><productname class="trade">PostScript</productname>
  file</ulink> and use <ulink url="http://www.cs.wisc.edu/~ghost/"><application moreinfo="none">GhostScript</application></ulink>
  to convert the <productname class="trade">PostScript</productname> file to
  <productname class="trade"><acronym>PDF</acronym></productname> with the
  command:</para><screen format="linespecific" linenumbering="unnumbered"><prompt moreinfo="none">bash$</prompt> <userinput moreinfo="none">gs -q -dNOPAUSE -dBATCH -dSAFER \
-dNOPLATFONTS -dMaxSubsetPct=100  -dSubsetFonts=true -dEmbedAllFonts=true \
-sPAPERSIZE=a4 -sDEVICE=pdfwrite -dCompatibilityLevel=1.2 \
-sOutputFile=Remote-Serial-Console-HOWTO.pdf \
-c .setpdfwrite -f Remote-Serial-Console-HOWTO.ps</userinput></screen></colophon></book>

