Home | History | Annotate | Line # | Download | only in util
ntp-keygen.html revision 1.1.1.14.4.1
      1      1.1.1.13  christos <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      2      1.1.1.13  christos <html>
      3  1.1.1.14.4.1  perseant <!-- Created by GNU Texinfo 6.6, http://www.gnu.org/software/texinfo/ -->
      4           1.1  christos <head>
      5      1.1.1.13  christos <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      6      1.1.1.13  christos <title>Ntp-keygen User&rsquo;s Manual</title>
      7      1.1.1.13  christos 
      8      1.1.1.13  christos <meta name="description" content="Ntp-keygen User&rsquo;s Manual">
      9      1.1.1.13  christos <meta name="keywords" content="Ntp-keygen User&rsquo;s Manual">
     10      1.1.1.13  christos <meta name="resource-type" content="document">
     11      1.1.1.13  christos <meta name="distribution" content="global">
     12      1.1.1.13  christos <meta name="Generator" content="makeinfo">
     13      1.1.1.13  christos <link href="#Top" rel="start" title="Top">
     14      1.1.1.13  christos <link href="dir.html#Top" rel="up" title="(dir)">
     15      1.1.1.13  christos <style type="text/css">
     16      1.1.1.13  christos <!--
     17      1.1.1.13  christos a.summary-letter {text-decoration: none}
     18      1.1.1.13  christos blockquote.indentedblock {margin-right: 0em}
     19      1.1.1.13  christos div.display {margin-left: 3.2em}
     20      1.1.1.13  christos div.example {margin-left: 3.2em}
     21      1.1.1.13  christos div.lisp {margin-left: 3.2em}
     22      1.1.1.13  christos kbd {font-style: oblique}
     23      1.1.1.13  christos pre.display {font-family: inherit}
     24      1.1.1.13  christos pre.format {font-family: inherit}
     25      1.1.1.13  christos pre.menu-comment {font-family: serif}
     26      1.1.1.13  christos pre.menu-preformatted {font-family: serif}
     27      1.1.1.13  christos span.nolinebreak {white-space: nowrap}
     28      1.1.1.13  christos span.roman {font-family: initial; font-weight: normal}
     29      1.1.1.13  christos span.sansserif {font-family: sans-serif; font-weight: normal}
     30      1.1.1.13  christos ul.no-bullet {list-style: none}
     31      1.1.1.13  christos -->
     32      1.1.1.13  christos </style>
     33      1.1.1.13  christos 
     34      1.1.1.13  christos 
     35           1.1  christos </head>
     36      1.1.1.13  christos 
     37      1.1.1.13  christos <body lang="en">
     38      1.1.1.13  christos <h1 class="settitle" align="center">Ntp-keygen User&rsquo;s Manual</h1>
     39           1.1  christos 
     40           1.1  christos 
     41           1.1  christos 
     42           1.1  christos 
     43           1.1  christos 
     44  1.1.1.14.4.1  perseant <span id="SEC_Overview"></span>
     45      1.1.1.13  christos <h2 class="shortcontents-heading">Short Table of Contents</h2>
     46      1.1.1.13  christos 
     47      1.1.1.13  christos <div class="shortcontents">
     48      1.1.1.13  christos <ul class="no-bullet">
     49  1.1.1.14.4.1  perseant <li><a id="stoc-Description-1" href="#toc-Description-1">1 Description</a></li>
     50      1.1.1.13  christos </ul>
     51           1.1  christos </div>
     52           1.1  christos 
     53           1.1  christos 
     54      1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
     55  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Description" accesskey="1">Description</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
     56      1.1.1.13  christos </td></tr>
     57  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Invocation" accesskey="2">ntp-keygen Invocation</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Invoking ntp-keygen
     58      1.1.1.13  christos </td></tr>
     59  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Running-the-Program" accesskey="3">Running the Program</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
     60      1.1.1.13  christos </td></tr>
     61  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Random-Seed-File" accesskey="4">Random Seed File</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
     62      1.1.1.13  christos </td></tr>
     63  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Cryptographic-Data-Files" accesskey="5">Cryptographic Data Files</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
     64      1.1.1.13  christos </td></tr>
     65      1.1.1.13  christos </table>
     66      1.1.1.13  christos 
     67  1.1.1.14.4.1  perseant <span id="Top"></span><div class="header">
     68      1.1.1.13  christos <p>
     69      1.1.1.13  christos Next: <a href="#Description" accesskey="n" rel="next">Description</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
     70      1.1.1.13  christos </div>
     71  1.1.1.14.4.1  perseant <span id="NTP-Key-Generation-Program-User-Manual"></span><h1 class="top">NTP Key Generation Program User Manual</h1>
     72      1.1.1.13  christos 
     73      1.1.1.13  christos <p>This document describes the use of the NTP Project&rsquo;s <code>ntp-keygen</code>
     74           1.1  christos program, that generates cryptographic data files used by the NTPv4
     75      1.1.1.13  christos authentication and identity schemes.
     76           1.1  christos It can generate message digest keys used in symmetric key cryptography and,
     77           1.1  christos if the OpenSSL software
     78           1.1  christos library has been installed, it can generate host keys, sign keys,
     79           1.1  christos certificates, and identity keys and parameters used by the Autokey
     80      1.1.1.13  christos public key cryptography.
     81           1.1  christos The message digest keys file is generated in a
     82      1.1.1.13  christos format compatible with NTPv3.
     83           1.1  christos All other files are in PEM-encoded
     84           1.1  christos printable ASCII format so they can be embedded as MIME attachments in
     85           1.1  christos mail to other sites.
     86      1.1.1.13  christos </p>
     87  1.1.1.14.4.1  perseant <p>This document applies to version 4.2.8p18 of <code>ntp-keygen</code>.
     88      1.1.1.13  christos </p>
     89      1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
     90  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Description" accesskey="1">Description</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
     91      1.1.1.13  christos </td></tr>
     92      1.1.1.13  christos </table>
     93      1.1.1.13  christos 
     94      1.1.1.13  christos <hr>
     95  1.1.1.14.4.1  perseant <span id="Description"></span><div class="header">
     96      1.1.1.13  christos <p>
     97      1.1.1.13  christos Next: <a href="#Running-the-Program" accesskey="n" rel="next">Running the Program</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
     98           1.1  christos </div>
     99  1.1.1.14.4.1  perseant <span id="Description-1"></span><h2 class="chapter">1 Description</h2>
    100           1.1  christos 
    101           1.1  christos <p>This program generates cryptographic data files used by the NTPv4
    102           1.1  christos authentication and identity schemes. It can generate message digest
    103           1.1  christos keys used in symmetric key cryptography and, if the OpenSSL software
    104           1.1  christos library has been installed, it can generate host keys, sign keys,
    105           1.1  christos certificates, and identity keys and parameters used by the Autokey
    106           1.1  christos public key cryptography. The message digest keys file is generated in a
    107           1.1  christos format compatible with NTPv3. All other files are in PEM-encoded
    108           1.1  christos printable ASCII format so they can be embedded as MIME attachments in
    109           1.1  christos mail to other sites.
    110      1.1.1.13  christos </p>
    111      1.1.1.13  christos <p>When used to generate message digest keys, the program produces a file
    112           1.1  christos containing ten pseudo-random printable ASCII strings suitable for the
    113      1.1.1.13  christos MD5 message digest algorithm included in the distribution.
    114           1.1  christos If the
    115           1.1  christos OpenSSL library is installed, it produces an additional ten hex-encoded
    116           1.1  christos random bit strings suitable for the SHA1 and other message digest
    117      1.1.1.13  christos algorithms.
    118           1.1  christos The message digest keys file must be distributed and stored
    119      1.1.1.13  christos using secure means beyond the scope of NTP itself.
    120           1.1  christos Besides the keys
    121           1.1  christos used for ordinary NTP associations, additional keys can be defined as
    122           1.1  christos passwords for the ntpq and ntpdc utility programs.
    123      1.1.1.13  christos </p>
    124      1.1.1.13  christos <p>The remaining generated files are compatible with other OpenSSL
    125      1.1.1.13  christos applications and other Public Key Infrastructure (PKI) resources.
    126           1.1  christos Certificates generated by this program are compatible with extant
    127           1.1  christos industry practice, although some users might find the interpretation of
    128      1.1.1.13  christos X509v3 extension fields somewhat liberal.
    129           1.1  christos However, the identity keys
    130           1.1  christos are probably not compatible with anything other than Autokey.
    131      1.1.1.13  christos </p>
    132      1.1.1.13  christos <p>Some files used by this program are encrypted using a private password.
    133           1.1  christos The <code>-p</code> option specifies the password for local encrypted files and the
    134      1.1.1.13  christos <code>-q</code> option the password for encrypted files sent to remote sites.
    135           1.1  christos If no password is specified, the host name returned by the Unix
    136           1.1  christos <code>gethostname()</code> function, normally the DNS name of the host, is used.
    137      1.1.1.13  christos </p>
    138      1.1.1.13  christos <p>The <kbd>pw</kbd> option of the <code>crypto</code> configuration command
    139      1.1.1.13  christos specifies the read password for previously encrypted local files.
    140      1.1.1.13  christos This must match the local password used by this program.
    141      1.1.1.13  christos If not specified, the host name is used.
    142           1.1  christos Thus, if files are generated by this program without password,
    143           1.1  christos they can be read back by ntpd without password, but only on the same
    144           1.1  christos host.
    145      1.1.1.13  christos </p>
    146      1.1.1.13  christos <p>Normally, encrypted files for each host are generated by that host and
    147           1.1  christos used only by that host, although exceptions exist as noted later on
    148      1.1.1.13  christos this page.
    149           1.1  christos The symmetric keys file, normally called <code>ntp.keys</code>, is
    150      1.1.1.13  christos usually installed in <code>/etc</code>.
    151           1.1  christos Other files and links are usually installed
    152           1.1  christos in <code>/usr/local/etc</code>, which is normally in a shared filesystem in
    153      1.1.1.13  christos NFS-mounted networks and cannot be changed by shared clients.
    154           1.1  christos The location of the keys directory can be changed by the keysdir
    155      1.1.1.13  christos configuration command in such cases.
    156           1.1  christos Normally, this is in <code>/etc</code>.
    157      1.1.1.13  christos </p>
    158      1.1.1.13  christos <p>This program directs commentary and error messages to the standard
    159           1.1  christos error stream <code>stderr</code> and remote files to the standard output stream
    160           1.1  christos <code>stdout</code> where they can be piped to other applications or redirected to
    161      1.1.1.13  christos files.
    162           1.1  christos The names used for generated files and links all begin with the
    163           1.1  christos string <code>ntpkey</code> and include the file type,
    164           1.1  christos generating host and filestamp,
    165           1.1  christos as described in the <a href="#Cryptographic-Data-Files">Cryptographic Data Files</a> section below.
    166      1.1.1.13  christos </p>
    167      1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
    168  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Running-the-Program" accesskey="1">Running the Program</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    169      1.1.1.13  christos </td></tr>
    170  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Invocation" accesskey="2">Invoking ntp-keygen</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    171      1.1.1.13  christos </td></tr>
    172  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Random-Seed-File" accesskey="3">Random Seed File</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    173      1.1.1.13  christos </td></tr>
    174  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#Cryptographic-Data-Files" accesskey="4">Cryptographic Data Files</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    175      1.1.1.13  christos </td></tr>
    176      1.1.1.13  christos </table>
    177      1.1.1.13  christos 
    178      1.1.1.13  christos <hr>
    179  1.1.1.14.4.1  perseant <span id="Running-the-Program"></span><div class="header">
    180      1.1.1.13  christos <p>
    181      1.1.1.13  christos Next: <a href="#Random-Seed-File" accesskey="n" rel="next">Random Seed File</a>, Previous: <a href="#Description" accesskey="p" rel="prev">Description</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
    182           1.1  christos </div>
    183  1.1.1.14.4.1  perseant <span id="Running-the-Program-1"></span><h3 class="section">1.1 Running the Program</h3>
    184           1.1  christos 
    185           1.1  christos <p>To test and gain experience with Autokey concepts, log in as root and
    186      1.1.1.13  christos change to the keys directory, usually <code>/usr/local/etc</code>.
    187           1.1  christos When run for the
    188           1.1  christos first time, or if all files with names beginning <code>ntpkey</code>] have been
    189           1.1  christos removed, use the <code>ntp-keygen</code> command without arguments to generate a
    190           1.1  christos default RSA host key and matching RSA-MD5 certificate with expiration
    191      1.1.1.13  christos date one year hence.
    192           1.1  christos If run again without options, the program uses the
    193           1.1  christos existing keys and parameters and generates only a new certificate with
    194           1.1  christos new expiration date one year hence.
    195      1.1.1.13  christos </p>
    196      1.1.1.13  christos <p>Run the command on as many hosts as necessary.
    197           1.1  christos Designate one of them as the trusted host (TH) using <code>ntp-keygen</code>
    198           1.1  christos with the <code>-T</code> option and configure
    199      1.1.1.13  christos it to synchronize from reliable Internet servers.
    200      1.1.1.13  christos Then configure the other hosts to synchronize to the TH directly or indirectly.
    201           1.1  christos A certificate trail is created when Autokey asks the immediately
    202           1.1  christos ascendant host towards the TH to sign its certificate, which is then
    203      1.1.1.13  christos provided to the immediately descendant host on request.
    204           1.1  christos All group hosts should have acyclic certificate trails ending on the TH.
    205      1.1.1.13  christos </p>
    206      1.1.1.13  christos <p>The host key is used to encrypt the cookie when required and so must be
    207      1.1.1.13  christos RSA type.
    208      1.1.1.13  christos By default, the host key is also the sign key used to encrypt signatures.
    209           1.1  christos A different sign key can be assigned using the <code>-S</code> option
    210      1.1.1.13  christos and this can be either RSA or DSA type.
    211           1.1  christos By default, the signature
    212           1.1  christos message digest type is MD5, but any combination of sign key type and
    213           1.1  christos message digest type supported by the OpenSSL library can be specified
    214           1.1  christos using the <code>-c</code> option.
    215      1.1.1.13  christos </p>
    216      1.1.1.13  christos <p>The rules say cryptographic media should be generated with proventic
    217           1.1  christos filestamps, which means the host should already be synchronized before
    218      1.1.1.13  christos this program is run.
    219           1.1  christos This of course creates a chicken-and-egg problem
    220      1.1.1.13  christos when the host is started for the first time.
    221           1.1  christos Accordingly, the host time
    222           1.1  christos should be set by some other means, such as eyeball-and-wristwatch, at
    223      1.1.1.13  christos least so that the certificate lifetime is within the current year.
    224           1.1  christos After that and when the host is synchronized to a proventic source, the
    225           1.1  christos certificate should be re-generated.
    226      1.1.1.13  christos </p>
    227      1.1.1.13  christos <p>Additional information on trusted groups and identity schemes is on the
    228           1.1  christos Autokey Public-Key Authentication page.
    229      1.1.1.13  christos </p>
    230      1.1.1.13  christos <hr>
    231  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Invocation"></span><div class="header">
    232      1.1.1.13  christos <p>
    233      1.1.1.13  christos Next: <a href="#Random-Seed-File" accesskey="n" rel="next">Random Seed File</a>, Previous: <a href="#Running-the-Program" accesskey="p" rel="prev">Running the Program</a>, Up: <a href="#Description" accesskey="u" rel="up">Description</a> &nbsp; </p>
    234      1.1.1.13  christos </div>
    235  1.1.1.14.4.1  perseant <span id="Invoking-ntp_002dkeygen"></span><h3 class="section">1.2 Invoking ntp-keygen</h3>
    236  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen"></span>
    237  1.1.1.14.4.1  perseant <span id="index-Create-a-NTP-host-key"></span>
    238           1.1  christos 
    239           1.1  christos 
    240           1.1  christos 
    241      1.1.1.13  christos <p>This program generates cryptographic data files used by the NTPv4
    242      1.1.1.13  christos authentication and identification schemes.
    243      1.1.1.11  christos It can generate message digest keys used in symmetric key cryptography and,
    244      1.1.1.11  christos if the OpenSSL software library has been installed, it can generate host keys,
    245      1.1.1.11  christos signing keys, certificates, and identity keys and parameters used in Autokey
    246      1.1.1.13  christos public key cryptography.
    247           1.1  christos These files are used for cookie encryption,
    248      1.1.1.11  christos digital signature, and challenge/response identification algorithms
    249           1.1  christos compatible with the Internet standard security infrastructure.
    250      1.1.1.13  christos </p>
    251      1.1.1.13  christos <p>The message digest symmetric keys file is generated in a format
    252      1.1.1.13  christos compatible with NTPv3.
    253      1.1.1.11  christos All other files are in PEM-encoded printable ASCII format,
    254      1.1.1.11  christos so they can be embedded as MIME attachments in email to other sites
    255      1.1.1.13  christos and certificate authorities.
    256           1.1  christos By default, files are not encrypted.
    257      1.1.1.13  christos </p>
    258      1.1.1.13  christos <p>When used to generate message digest symmetric keys, the program
    259      1.1.1.11  christos produces a file containing ten pseudo-random printable ASCII strings
    260      1.1.1.11  christos suitable for the MD5 message digest algorithm included in the
    261      1.1.1.13  christos distribution.
    262           1.1  christos If the OpenSSL library is installed, it produces an additional ten
    263      1.1.1.11  christos hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
    264      1.1.1.13  christos other message digest algorithms.
    265      1.1.1.11  christos The message digest symmetric keys file must be distributed and stored
    266      1.1.1.13  christos using secure means beyond the scope of NTP itself.
    267           1.1  christos Besides the keys used for ordinary NTP associations, additional keys
    268           1.1  christos can be defined as passwords for the
    269           1.1  christos <code>ntpq(1ntpqmdoc)</code>
    270           1.1  christos and
    271           1.1  christos <code>ntpdc(1ntpdcmdoc)</code>
    272           1.1  christos utility programs.
    273      1.1.1.13  christos </p>
    274      1.1.1.13  christos <p>The remaining generated files are compatible with other OpenSSL
    275      1.1.1.13  christos applications and other Public Key Infrastructure (PKI) resources.
    276           1.1  christos Certificates generated by this program are compatible with extant
    277           1.1  christos industry practice, although some users might find the interpretation of
    278      1.1.1.13  christos X509v3 extension fields somewhat liberal.
    279           1.1  christos However, the identity keys are probably not compatible with anything
    280           1.1  christos other than Autokey.
    281      1.1.1.13  christos </p>
    282      1.1.1.13  christos <p>Some files used by this program are encrypted using a private password.
    283           1.1  christos The
    284           1.1  christos <code>-p</code>
    285      1.1.1.11  christos option specifies the read password for local encrypted files and the
    286           1.1  christos <code>-q</code>
    287      1.1.1.13  christos option the write password for encrypted files sent to remote sites.
    288           1.1  christos If no password is specified, the host name returned by the Unix
    289      1.1.1.11  christos <code>hostname(1)</code>
    290      1.1.1.11  christos command, normally the DNS name of the host, is used as the the default read
    291      1.1.1.13  christos password, for convenience.
    292      1.1.1.11  christos The
    293      1.1.1.11  christos <code>ntp-keygen</code>
    294      1.1.1.11  christos program prompts for the password if it reads an encrypted file
    295      1.1.1.13  christos and the password is missing or incorrect.
    296      1.1.1.11  christos If an encrypted file is read successfully and
    297      1.1.1.11  christos no write password is specified, the read password is used
    298      1.1.1.11  christos as the write password by default.
    299      1.1.1.13  christos </p>
    300      1.1.1.13  christos <p>The
    301      1.1.1.11  christos <code>pw</code>
    302           1.1  christos option of the
    303      1.1.1.11  christos <code>crypto</code>
    304      1.1.1.11  christos <code>ntpd(1ntpdmdoc)</code>
    305           1.1  christos configuration command specifies the read
    306      1.1.1.13  christos password for previously encrypted local files.
    307      1.1.1.13  christos This must match the local read password used by this program.
    308      1.1.1.13  christos If not specified, the host name is used.
    309      1.1.1.11  christos Thus, if files are generated by this program without an explicit password,
    310           1.1  christos they can be read back by
    311      1.1.1.11  christos <code>ntpd(1ntpdmdoc)</code>
    312      1.1.1.13  christos without specifying an explicit password but only on the same host.
    313      1.1.1.11  christos If the write password used for encryption is specified as the host name,
    314      1.1.1.11  christos these files can be read by that host with no explicit password.
    315      1.1.1.13  christos </p>
    316      1.1.1.13  christos <p>Normally, encrypted files for each host are generated by that host and
    317           1.1  christos used only by that host, although exceptions exist as noted later on
    318      1.1.1.13  christos this page.
    319           1.1  christos The symmetric keys file, normally called
    320      1.1.1.13  christos <samp>ntp.keys</samp>,
    321           1.1  christos is usually installed in
    322      1.1.1.13  christos <samp>/etc</samp>.
    323           1.1  christos Other files and links are usually installed in
    324      1.1.1.13  christos <samp>/usr/local/etc</samp>,
    325           1.1  christos which is normally in a shared filesystem in
    326      1.1.1.13  christos NFS-mounted networks and cannot be changed by shared clients.
    327      1.1.1.11  christos In these cases, NFS clients can specify the files in another
    328      1.1.1.11  christos directory such as
    329      1.1.1.13  christos <samp>/etc</samp>
    330      1.1.1.11  christos using the
    331      1.1.1.11  christos <code>keysdir</code>
    332      1.1.1.11  christos <code>ntpd(1ntpdmdoc)</code>
    333      1.1.1.11  christos configuration file command.
    334      1.1.1.13  christos </p>
    335      1.1.1.13  christos <p>This program directs commentary and error messages to the standard
    336           1.1  christos error stream
    337      1.1.1.13  christos <samp>stderr</samp>
    338           1.1  christos and remote files to the standard output stream
    339      1.1.1.13  christos <samp>stdout</samp>
    340      1.1.1.13  christos where they can be piped to other applications or redirected to files.
    341           1.1  christos The names used for generated files and links all begin with the
    342           1.1  christos string
    343      1.1.1.13  christos <samp>ntpkey*</samp>
    344           1.1  christos and include the file type, generating host and filestamp,
    345           1.1  christos as described in the
    346      1.1.1.11  christos <a href="#Cryptographic-Data-Files">Cryptographic Data Files</a>
    347           1.1  christos section below.
    348      1.1.1.13  christos </p>
    349      1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
    350  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-usage" accesskey="1">ntp-keygen help/usage (<samp>--help</samp>)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    351      1.1.1.13  christos </td></tr>
    352  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-imbits" accesskey="2">imbits option (-b)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    353      1.1.1.13  christos </td></tr>
    354  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-certificate" accesskey="3">certificate option (-c)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    355      1.1.1.13  christos </td></tr>
    356  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-cipher" accesskey="4">cipher option (-C)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    357      1.1.1.13  christos </td></tr>
    358  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-id_002dkey" accesskey="5">id-key option (-e)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    359      1.1.1.13  christos </td></tr>
    360  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-gq_002dparams" accesskey="6">gq-params option (-G)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    361      1.1.1.13  christos </td></tr>
    362  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-host_002dkey" accesskey="7">host-key option (-H)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    363      1.1.1.13  christos </td></tr>
    364  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-iffkey" accesskey="8">iffkey option (-I)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    365      1.1.1.13  christos </td></tr>
    366  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-ident" accesskey="9">ident option (-i)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    367      1.1.1.13  christos </td></tr>
    368  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-lifetime">lifetime option (-l)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    369      1.1.1.13  christos </td></tr>
    370  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-modulus">modulus option (-m)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    371      1.1.1.13  christos </td></tr>
    372  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-md5key">md5key option (-M)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    373      1.1.1.13  christos </td></tr>
    374  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-pvt_002dcert">pvt-cert option (-P)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    375      1.1.1.13  christos </td></tr>
    376  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-password">password option (-p)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    377      1.1.1.13  christos </td></tr>
    378  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-export_002dpasswd">export-passwd option (-q)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    379      1.1.1.13  christos </td></tr>
    380  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-subject_002dname">subject-name option (-s)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    381      1.1.1.13  christos </td></tr>
    382  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-sign_002dkey">sign-key option (-S)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    383      1.1.1.13  christos </td></tr>
    384  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-trusted_002dcert">trusted-cert option (-T)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    385      1.1.1.13  christos </td></tr>
    386  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-mv_002dparams">mv-params option (-V)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    387      1.1.1.13  christos </td></tr>
    388  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-mv_002dkeys">mv-keys option (-v)</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    389      1.1.1.13  christos </td></tr>
    390  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-config">presetting/configuring ntp-keygen</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    391      1.1.1.13  christos </td></tr>
    392  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    393      1.1.1.13  christos </td></tr>
    394  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    395      1.1.1.13  christos </td></tr>
    396  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    397      1.1.1.13  christos </td></tr>
    398  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
    399      1.1.1.13  christos </td></tr>
    400      1.1.1.13  christos </table>
    401           1.1  christos 
    402  1.1.1.14.4.1  perseant <span id="Running-the-Program-2"></span><h4 class="subsection">1.2.1 Running the Program</h4>
    403           1.1  christos <p>The safest way to run the
    404           1.1  christos <code>ntp-keygen</code>
    405      1.1.1.13  christos program is logged in directly as root.
    406      1.1.1.11  christos The recommended procedure is change to the
    407      1.1.1.11  christos <kbd>keys</kbd>
    408      1.1.1.11  christos directory, usually
    409      1.1.1.13  christos <samp>/usr/local/etc</samp>,
    410      1.1.1.11  christos then run the program.
    411      1.1.1.13  christos </p>
    412      1.1.1.13  christos <p>To test and gain experience with Autokey concepts, log in as root and
    413      1.1.1.11  christos change to the
    414      1.1.1.11  christos <kbd>keys</kbd>
    415      1.1.1.11  christos directory, usually
    416      1.1.1.13  christos <samp>/usr/local/etc</samp>.
    417      1.1.1.11  christos When run for the first time, or if all files with names beginning with
    418      1.1.1.13  christos <samp>ntpkey*</samp>
    419      1.1.1.11  christos have been removed, use the
    420      1.1.1.11  christos <code>ntp-keygen</code>
    421      1.1.1.11  christos command without arguments to generate a default
    422      1.1.1.11  christos <code>RSA</code>
    423      1.1.1.11  christos host key and matching
    424      1.1.1.11  christos <code>RSA-MD5</code>
    425      1.1.1.11  christos certificate file with expiration date one year hence,
    426      1.1.1.13  christos which is all that is necessary in many cases.
    427           1.1  christos The program also generates soft links from the generic names
    428      1.1.1.13  christos to the respective files.
    429      1.1.1.11  christos If run again without options, the program uses the
    430      1.1.1.11  christos existing keys and parameters and generates a new certificate file with
    431      1.1.1.11  christos new expiration date one year hence, and soft link.
    432      1.1.1.13  christos </p>
    433      1.1.1.13  christos <p>The host key is used to encrypt the cookie when required and so must be
    434      1.1.1.11  christos <code>RSA</code>
    435      1.1.1.13  christos type.
    436      1.1.1.13  christos By default, the host key is also the sign key used to encrypt signatures.
    437           1.1  christos When necessary, a different sign key can be specified and this can be
    438      1.1.1.11  christos either
    439      1.1.1.11  christos <code>RSA</code>
    440      1.1.1.11  christos or
    441      1.1.1.11  christos <code>DSA</code>
    442      1.1.1.13  christos type.
    443      1.1.1.11  christos By default, the message digest type is
    444      1.1.1.11  christos <code>MD5</code>,
    445      1.1.1.11  christos but any combination
    446           1.1  christos of sign key type and message digest type supported by the OpenSSL library
    447      1.1.1.11  christos can be specified, including those using the
    448      1.1.1.11  christos <code>AES128CMAC</code>, <code>MD2</code>, <code>MD5</code>, <code>MDC2</code>, <code>SHA</code>, <code>SHA1</code>
    449      1.1.1.11  christos and
    450      1.1.1.11  christos <code>RIPE160</code>
    451      1.1.1.13  christos message digest algorithms.
    452           1.1  christos However, the scheme specified in the certificate must be compatible
    453      1.1.1.13  christos with the sign key.
    454      1.1.1.11  christos Certificates using any digest algorithm are compatible with
    455      1.1.1.11  christos <code>RSA</code>
    456      1.1.1.11  christos sign keys;
    457      1.1.1.11  christos however, only
    458      1.1.1.11  christos <code>SHA</code>
    459      1.1.1.11  christos and
    460      1.1.1.11  christos <code>SHA1</code>
    461      1.1.1.11  christos certificates are compatible with
    462      1.1.1.11  christos <code>DSA</code>
    463      1.1.1.11  christos sign keys.
    464      1.1.1.13  christos </p>
    465      1.1.1.13  christos <p>Private/public key files and certificates are compatible with
    466      1.1.1.13  christos other OpenSSL applications and very likely other libraries as well.
    467           1.1  christos Certificates or certificate requests derived from them should be compatible
    468           1.1  christos with extant industry practice, although some users might find
    469      1.1.1.13  christos the interpretation of X509v3 extension fields somewhat liberal.
    470           1.1  christos However, the identification parameter files, although encoded
    471           1.1  christos as the other files, are probably not compatible with anything other than Autokey.
    472      1.1.1.13  christos </p>
    473      1.1.1.13  christos <p>Running the program as other than root and using the Unix
    474      1.1.1.11  christos <code>su(1)</code>
    475           1.1  christos command
    476           1.1  christos to assume root may not work properly, since by default the OpenSSL library
    477           1.1  christos looks for the random seed file
    478      1.1.1.13  christos <samp>.rnd</samp>
    479      1.1.1.13  christos in the user home directory.
    480           1.1  christos However, there should be only one
    481      1.1.1.13  christos <samp>.rnd</samp>,
    482           1.1  christos most conveniently
    483           1.1  christos in the root directory, so it is convenient to define the
    484      1.1.1.11  christos .Ev RANDFILE
    485           1.1  christos environment variable used by the OpenSSL library as the path to
    486      1.1.1.13  christos <samp>.rnd</samp>.
    487      1.1.1.13  christos </p>
    488      1.1.1.13  christos <p>Installing the keys as root might not work in NFS-mounted
    489           1.1  christos shared file systems, as NFS clients may not be able to write
    490      1.1.1.13  christos to the shared keys directory, even as root.
    491           1.1  christos In this case, NFS clients can specify the files in another
    492           1.1  christos directory such as
    493      1.1.1.13  christos <samp>/etc</samp>
    494           1.1  christos using the
    495           1.1  christos <code>keysdir</code>
    496      1.1.1.11  christos <code>ntpd(1ntpdmdoc)</code>
    497      1.1.1.13  christos configuration file command.
    498           1.1  christos There is no need for one client to read the keys and certificates
    499           1.1  christos of other clients or servers, as these data are obtained automatically
    500           1.1  christos by the Autokey protocol.
    501      1.1.1.13  christos </p>
    502      1.1.1.13  christos <p>Ordinarily, cryptographic files are generated by the host that uses them,
    503           1.1  christos but it is possible for a trusted agent (TA) to generate these files
    504      1.1.1.13  christos for other hosts; however, in such cases files should always be encrypted.
    505           1.1  christos The subject name and trusted name default to the hostname
    506      1.1.1.13  christos of the host generating the files, but can be changed by command line options.
    507           1.1  christos It is convenient to designate the owner name and trusted name
    508      1.1.1.13  christos as the subject and issuer fields, respectively, of the certificate.
    509           1.1  christos The owner name is also used for the host and sign key files,
    510           1.1  christos while the trusted name is used for the identity files.
    511      1.1.1.13  christos </p>
    512      1.1.1.13  christos <p>All files are installed by default in the keys directory
    513      1.1.1.13  christos <samp>/usr/local/etc</samp>,
    514           1.1  christos which is normally in a shared filesystem
    515      1.1.1.13  christos in NFS-mounted networks.
    516           1.1  christos The actual location of the keys directory
    517           1.1  christos and each file can be overridden by configuration commands,
    518      1.1.1.13  christos but this is not recommended.
    519           1.1  christos Normally, the files for each host are generated by that host
    520           1.1  christos and used only by that host, although exceptions exist
    521           1.1  christos as noted later on this page.
    522      1.1.1.13  christos </p>
    523      1.1.1.13  christos <p>Normally, files containing private values,
    524           1.1  christos including the host key, sign key and identification parameters,
    525           1.1  christos are permitted root read/write-only;
    526      1.1.1.13  christos while others containing public values are permitted world readable.
    527           1.1  christos Alternatively, files containing private values can be encrypted
    528           1.1  christos and these files permitted world readable,
    529      1.1.1.13  christos which simplifies maintenance in shared file systems.
    530      1.1.1.11  christos Since uniqueness is insured by the
    531      1.1.1.11  christos <kbd>hostname</kbd>
    532      1.1.1.11  christos and
    533      1.1.1.11  christos <kbd>filestamp</kbd>
    534      1.1.1.11  christos file name extensions, the files for an NTP server and
    535           1.1  christos dependent clients can all be installed in the same shared directory.
    536      1.1.1.13  christos </p>
    537      1.1.1.13  christos <p>The recommended practice is to keep the file name extensions
    538           1.1  christos when installing a file and to install a soft link
    539           1.1  christos from the generic names specified elsewhere on this page
    540      1.1.1.13  christos to the generated files.
    541           1.1  christos This allows new file generations to be activated simply
    542      1.1.1.13  christos by changing the link.
    543      1.1.1.11  christos If a link is present,
    544      1.1.1.11  christos <code>ntpd(1ntpdmdoc)</code>
    545      1.1.1.11  christos follows it to the file name to extract the
    546      1.1.1.13  christos <kbd>filestamp</kbd>.
    547           1.1  christos If a link is not present,
    548           1.1  christos <code>ntpd(1ntpdmdoc)</code>
    549      1.1.1.11  christos extracts the
    550      1.1.1.11  christos <kbd>filestamp</kbd>
    551      1.1.1.13  christos from the file itself.
    552           1.1  christos This allows clients to verify that the file and generation times
    553      1.1.1.13  christos are always current.
    554           1.1  christos The
    555           1.1  christos <code>ntp-keygen</code>
    556      1.1.1.11  christos program uses the same
    557      1.1.1.11  christos <kbd>filestamp</kbd>
    558      1.1.1.11  christos extension for all files generated
    559           1.1  christos at one time, so each generation is distinct and can be readily
    560           1.1  christos recognized in monitoring data.
    561      1.1.1.13  christos </p>
    562      1.1.1.13  christos <p>Run the command on as many hosts as necessary.
    563      1.1.1.11  christos Designate one of them as the trusted host (TH) using
    564           1.1  christos <code>ntp-keygen</code>
    565      1.1.1.11  christos with the
    566      1.1.1.11  christos <code>-T</code>
    567      1.1.1.13  christos option and configure it to synchronize from reliable Internet servers.
    568      1.1.1.11  christos Then configure the other hosts to synchronize to the TH directly or
    569      1.1.1.13  christos indirectly.
    570      1.1.1.11  christos A certificate trail is created when Autokey asks the immediately
    571      1.1.1.11  christos ascendant host towards the TH to sign its certificate, which is then
    572      1.1.1.13  christos provided to the immediately descendant host on request.
    573      1.1.1.11  christos All group hosts should have acyclic certificate trails ending on the TH.
    574      1.1.1.13  christos </p>
    575      1.1.1.13  christos <p>The host key is used to encrypt the cookie when required and so must be
    576      1.1.1.13  christos RSA type.
    577      1.1.1.11  christos By default, the host key is also the sign key used to encrypt
    578      1.1.1.13  christos signatures.
    579      1.1.1.11  christos A different sign key can be assigned using the
    580      1.1.1.11  christos <code>-S</code>
    581      1.1.1.11  christos option and this can be either
    582      1.1.1.11  christos <code>RSA</code>
    583      1.1.1.11  christos or
    584      1.1.1.11  christos <code>DSA</code>
    585      1.1.1.13  christos type.
    586      1.1.1.11  christos By default, the signature
    587      1.1.1.11  christos message digest type is
    588      1.1.1.11  christos <code>MD5</code>,
    589      1.1.1.11  christos but any combination of sign key type and
    590      1.1.1.11  christos message digest type supported by the OpenSSL library can be specified
    591      1.1.1.11  christos using the
    592      1.1.1.11  christos <code>-c</code>
    593      1.1.1.11  christos option.
    594      1.1.1.13  christos </p>
    595      1.1.1.13  christos <p>The rules say cryptographic media should be generated with proventic
    596      1.1.1.11  christos filestamps, which means the host should already be synchronized before
    597      1.1.1.13  christos this program is run.
    598      1.1.1.11  christos This of course creates a chicken-and-egg problem
    599      1.1.1.13  christos when the host is started for the first time.
    600      1.1.1.11  christos Accordingly, the host time
    601      1.1.1.11  christos should be set by some other means, such as eyeball-and-wristwatch, at
    602      1.1.1.13  christos least so that the certificate lifetime is within the current year.
    603      1.1.1.11  christos After that and when the host is synchronized to a proventic source, the
    604      1.1.1.11  christos certificate should be re-generated.
    605      1.1.1.13  christos </p>
    606      1.1.1.13  christos <p>Additional information on trusted groups and identity schemes is on the
    607      1.1.1.13  christos &ldquo;Autokey Public-Key Authentication&rdquo;
    608      1.1.1.11  christos page.
    609      1.1.1.13  christos </p>
    610      1.1.1.13  christos <p>File names begin with the prefix
    611      1.1.1.13  christos <samp>ntpkey</samp>_
    612      1.1.1.11  christos and end with the suffix
    613      1.1.1.13  christos <samp>_</samp><kbd>hostname</kbd>. <kbd>filestamp</kbd>,
    614      1.1.1.11  christos where
    615      1.1.1.11  christos <kbd>hostname</kbd>
    616      1.1.1.11  christos is the owner name, usually the string returned
    617      1.1.1.11  christos by the Unix
    618      1.1.1.11  christos <code>hostname(1)</code>
    619      1.1.1.11  christos command, and
    620      1.1.1.11  christos <kbd>filestamp</kbd>
    621      1.1.1.13  christos is the NTP seconds when the file was generated, in decimal digits.
    622      1.1.1.11  christos This both guarantees uniqueness and simplifies maintenance
    623      1.1.1.11  christos procedures, since all files can be quickly removed
    624      1.1.1.11  christos by a
    625      1.1.1.13  christos <code>rm</code> <samp>ntpkey*</samp>
    626      1.1.1.11  christos command or all files generated
    627      1.1.1.11  christos at a specific time can be removed by a
    628      1.1.1.13  christos <code>rm</code> <samp>*</samp><kbd>filestamp</kbd>
    629      1.1.1.13  christos command.
    630      1.1.1.11  christos To further reduce the risk of misconfiguration,
    631      1.1.1.11  christos the first two lines of a file contain the file name
    632      1.1.1.11  christos and generation date and time as comments.
    633      1.1.1.13  christos </p>
    634  1.1.1.14.4.1  perseant <span id="Trusted-Hosts-and-Groups"></span><h4 class="subsubsection">1.2.1.1 Trusted Hosts and Groups</h4>
    635      1.1.1.11  christos <p>Each cryptographic configuration involves selection of a signature scheme
    636           1.1  christos and identification scheme, called a cryptotype,
    637           1.1  christos as explained in the
    638      1.1.1.13  christos &lsquo;Authentication Options&rsquo;
    639           1.1  christos section of
    640      1.1.1.13  christos <code>ntp.conf(5)</code>.
    641      1.1.1.11  christos The default cryptotype uses
    642      1.1.1.11  christos <code>RSA</code>
    643      1.1.1.11  christos encryption,
    644      1.1.1.11  christos <code>MD5</code>
    645      1.1.1.11  christos message digest
    646      1.1.1.11  christos and
    647      1.1.1.11  christos <code>TC</code>
    648      1.1.1.13  christos identification.
    649           1.1  christos First, configure a NTP subnet including one or more low-stratum
    650           1.1  christos trusted hosts from which all other hosts derive synchronization
    651      1.1.1.13  christos directly or indirectly.
    652           1.1  christos Trusted hosts have trusted certificates;
    653      1.1.1.13  christos all other hosts have nontrusted certificates.
    654           1.1  christos These hosts will automatically and dynamically build authoritative
    655      1.1.1.13  christos certificate trails to one or more trusted hosts.
    656           1.1  christos A trusted group is the set of all hosts that have, directly or indirectly,
    657      1.1.1.13  christos a certificate trail ending at a trusted host.
    658           1.1  christos The trail is defined by static configuration file entries
    659           1.1  christos or dynamic means described on the
    660      1.1.1.13  christos &lsquo;Automatic NTP Configuration Options&rsquo;
    661           1.1  christos section of
    662           1.1  christos <code>ntp.conf(5)</code>.
    663      1.1.1.13  christos </p>
    664      1.1.1.13  christos <p>On each trusted host as root, change to the keys directory.
    665           1.1  christos To insure a fresh fileset, remove all
    666      1.1.1.13  christos <samp>ntpkey</samp>
    667      1.1.1.13  christos files.
    668           1.1  christos Then run
    669           1.1  christos <code>ntp-keygen</code>
    670           1.1  christos <code>-T</code>
    671      1.1.1.13  christos to generate keys and a trusted certificate.
    672           1.1  christos On all other hosts do the same, but leave off the
    673           1.1  christos <code>-T</code>
    674      1.1.1.13  christos flag to generate keys and nontrusted certificates.
    675           1.1  christos When complete, start the NTP daemons beginning at the lowest stratum
    676      1.1.1.13  christos and working up the tree.
    677           1.1  christos It may take some time for Autokey to instantiate the certificate trails
    678           1.1  christos throughout the subnet, but setting up the environment is completely automatic.
    679      1.1.1.13  christos </p>
    680      1.1.1.13  christos <p>If it is necessary to use a different sign key or different digest/signature
    681           1.1  christos scheme than the default, run
    682           1.1  christos <code>ntp-keygen</code>
    683           1.1  christos with the
    684           1.1  christos <code>-S</code> <kbd>type</kbd>
    685           1.1  christos option, where
    686           1.1  christos <kbd>type</kbd>
    687           1.1  christos is either
    688           1.1  christos <code>RSA</code>
    689           1.1  christos or
    690      1.1.1.13  christos <code>DSA</code>.
    691      1.1.1.11  christos The most frequent need to do this is when a
    692      1.1.1.11  christos <code>DSA</code>-signed
    693      1.1.1.13  christos certificate is used.
    694           1.1  christos If it is necessary to use a different certificate scheme than the default,
    695           1.1  christos run
    696           1.1  christos <code>ntp-keygen</code>
    697           1.1  christos with the
    698           1.1  christos <code>-c</code> <kbd>scheme</kbd>
    699           1.1  christos option and selected
    700           1.1  christos <kbd>scheme</kbd>
    701      1.1.1.13  christos as needed.
    702      1.1.1.11  christos If
    703           1.1  christos <code>ntp-keygen</code>
    704           1.1  christos is run again without these options, it generates a new certificate
    705      1.1.1.11  christos using the same scheme and sign key, and soft link.
    706      1.1.1.13  christos </p>
    707      1.1.1.13  christos <p>After setting up the environment it is advisable to update certificates
    708      1.1.1.13  christos from time to time, if only to extend the validity interval.
    709           1.1  christos Simply run
    710           1.1  christos <code>ntp-keygen</code>
    711           1.1  christos with the same flags as before to generate new certificates
    712      1.1.1.13  christos using existing keys, and soft links.
    713           1.1  christos However, if the host or sign key is changed,
    714           1.1  christos <code>ntpd(1ntpdmdoc)</code>
    715      1.1.1.13  christos should be restarted.
    716           1.1  christos When
    717           1.1  christos <code>ntpd(1ntpdmdoc)</code>
    718      1.1.1.13  christos is restarted, it loads any new files and restarts the protocol.
    719           1.1  christos Other dependent hosts will continue as usual until signatures are refreshed,
    720           1.1  christos at which time the protocol is restarted.
    721      1.1.1.13  christos </p>
    722  1.1.1.14.4.1  perseant <span id="Identity-Schemes"></span><h4 class="subsubsection">1.2.1.2 Identity Schemes</h4>
    723           1.1  christos <p>As mentioned on the Autonomous Authentication page,
    724      1.1.1.11  christos the default
    725      1.1.1.11  christos <code>TC</code>
    726      1.1.1.13  christos identity scheme is vulnerable to a middleman attack.
    727           1.1  christos However, there are more secure identity schemes available,
    728      1.1.1.11  christos including
    729      1.1.1.11  christos <code>PC</code>, <code>IFF</code>, <code>GQ</code>
    730      1.1.1.11  christos and
    731      1.1.1.11  christos <code>MV</code>
    732      1.1.1.13  christos schemes described below.
    733           1.1  christos These schemes are based on a TA, one or more trusted hosts
    734      1.1.1.13  christos and some number of nontrusted hosts.
    735           1.1  christos Trusted hosts prove identity using values provided by the TA,
    736           1.1  christos while the remaining hosts prove identity using values provided
    737      1.1.1.13  christos by a trusted host and certificate trails that end on that host.
    738           1.1  christos The name of a trusted host is also the name of its sugroup
    739      1.1.1.13  christos and also the subject and issuer name on its trusted certificate.
    740           1.1  christos The TA is not necessarily a trusted host in this sense, but often is.
    741      1.1.1.13  christos </p>
    742      1.1.1.13  christos <p>In some schemes there are separate keys for servers and clients.
    743           1.1  christos A server can also be a client of another server,
    744      1.1.1.13  christos but a client can never be a server for another client.
    745           1.1  christos In general, trusted hosts and nontrusted hosts that operate
    746           1.1  christos as both server and client have parameter files that contain
    747      1.1.1.13  christos both server and client keys.
    748           1.1  christos Hosts that operate
    749           1.1  christos only as clients have key files that contain only client keys.
    750      1.1.1.13  christos </p>
    751      1.1.1.13  christos <p>The PC scheme supports only one trusted host in the group.
    752           1.1  christos On trusted host alice run
    753           1.1  christos <code>ntp-keygen</code>
    754           1.1  christos <code>-P</code>
    755           1.1  christos <code>-p</code> <kbd>password</kbd>
    756           1.1  christos to generate the host key file
    757      1.1.1.13  christos <samp>ntpkey</samp>_ <code>RSA</code> <samp>key_alice.</samp> <kbd>filestamp</kbd>
    758           1.1  christos and trusted private certificate file
    759      1.1.1.13  christos <samp>ntpkey</samp>_ <code>RSA-MD5</code> <code>_</code> <samp>cert_alice.</samp> <kbd>filestamp</kbd>,
    760      1.1.1.13  christos and soft links.
    761           1.1  christos Copy both files to all group hosts;
    762      1.1.1.13  christos they replace the files which would be generated in other schemes.
    763      1.1.1.11  christos On each host
    764      1.1.1.11  christos <kbd>bob</kbd>
    765      1.1.1.11  christos install a soft link from the generic name
    766      1.1.1.13  christos <samp>ntpkey_host_</samp><kbd>bob</kbd>
    767           1.1  christos to the host key file and soft link
    768      1.1.1.13  christos <samp>ntpkey_cert_</samp><kbd>bob</kbd>
    769      1.1.1.13  christos to the private certificate file.
    770           1.1  christos Note the generic links are on bob, but point to files generated
    771      1.1.1.13  christos by trusted host alice.
    772           1.1  christos In this scheme it is not possible to refresh
    773           1.1  christos either the keys or certificates without copying them
    774      1.1.1.11  christos to all other hosts in the group, and recreating the soft links.
    775      1.1.1.13  christos </p>
    776      1.1.1.13  christos <p>For the
    777      1.1.1.11  christos <code>IFF</code>
    778      1.1.1.11  christos scheme proceed as in the
    779      1.1.1.11  christos <code>TC</code>
    780      1.1.1.11  christos scheme to generate keys
    781           1.1  christos and certificates for all group hosts, then for every trusted host in the group,
    782      1.1.1.11  christos generate the
    783      1.1.1.11  christos <code>IFF</code>
    784      1.1.1.13  christos parameter file.
    785           1.1  christos On trusted host alice run
    786           1.1  christos <code>ntp-keygen</code>
    787           1.1  christos <code>-T</code>
    788           1.1  christos <code>-I</code>
    789           1.1  christos <code>-p</code> <kbd>password</kbd>
    790           1.1  christos to produce her parameter file
    791      1.1.1.13  christos <samp>ntpkey_IFFpar_alice.</samp><kbd>filestamp</kbd>,
    792      1.1.1.13  christos which includes both server and client keys.
    793           1.1  christos Copy this file to all group hosts that operate as both servers
    794           1.1  christos and clients and install a soft link from the generic
    795      1.1.1.13  christos <samp>ntpkey_iff_alice</samp>
    796      1.1.1.13  christos to this file.
    797           1.1  christos If there are no hosts restricted to operate only as clients,
    798      1.1.1.13  christos there is nothing further to do.
    799      1.1.1.11  christos As the
    800      1.1.1.11  christos <code>IFF</code>
    801      1.1.1.11  christos scheme is independent
    802           1.1  christos of keys and certificates, these files can be refreshed as needed.
    803      1.1.1.13  christos </p>
    804      1.1.1.13  christos <p>If a rogue client has the parameter file, it could masquerade
    805      1.1.1.13  christos as a legitimate server and present a middleman threat.
    806           1.1  christos To eliminate this threat, the client keys can be extracted
    807      1.1.1.13  christos from the parameter file and distributed to all restricted clients.
    808           1.1  christos After generating the parameter file, on alice run
    809           1.1  christos <code>ntp-keygen</code>
    810           1.1  christos <code>-e</code>
    811      1.1.1.13  christos and pipe the output to a file or email program.
    812      1.1.1.13  christos Copy or email this file to all restricted clients.
    813           1.1  christos On these clients install a soft link from the generic
    814      1.1.1.13  christos <samp>ntpkey_iff_alice</samp>
    815      1.1.1.13  christos to this file.
    816           1.1  christos To further protect the integrity of the keys,
    817           1.1  christos each file can be encrypted with a secret password.
    818      1.1.1.13  christos </p>
    819      1.1.1.13  christos <p>For the
    820      1.1.1.11  christos <code>GQ</code>
    821      1.1.1.11  christos scheme proceed as in the
    822      1.1.1.11  christos <code>TC</code>
    823      1.1.1.11  christos scheme to generate keys
    824           1.1  christos and certificates for all group hosts, then for every trusted host
    825      1.1.1.11  christos in the group, generate the
    826      1.1.1.11  christos <code>IFF</code>
    827      1.1.1.13  christos parameter file.
    828           1.1  christos On trusted host alice run
    829           1.1  christos <code>ntp-keygen</code>
    830           1.1  christos <code>-T</code>
    831           1.1  christos <code>-G</code>
    832           1.1  christos <code>-p</code> <kbd>password</kbd>
    833           1.1  christos to produce her parameter file
    834      1.1.1.13  christos <samp>ntpkey_GQpar_alice.</samp><kbd>filestamp</kbd>,
    835      1.1.1.13  christos which includes both server and client keys.
    836           1.1  christos Copy this file to all group hosts and install a soft link
    837           1.1  christos from the generic
    838      1.1.1.13  christos <samp>ntpkey_gq_alice</samp>
    839      1.1.1.13  christos to this file.
    840      1.1.1.11  christos In addition, on each host
    841      1.1.1.11  christos <kbd>bob</kbd>
    842      1.1.1.11  christos install a soft link
    843           1.1  christos from generic
    844      1.1.1.13  christos <samp>ntpkey_gq_</samp><kbd>bob</kbd>
    845      1.1.1.13  christos to this file.
    846      1.1.1.11  christos As the
    847      1.1.1.11  christos <code>GQ</code>
    848      1.1.1.11  christos scheme updates the
    849      1.1.1.11  christos <code>GQ</code>
    850      1.1.1.11  christos parameters file and certificate
    851           1.1  christos at the same time, keys and certificates can be regenerated as needed.
    852      1.1.1.13  christos </p>
    853      1.1.1.13  christos <p>For the
    854      1.1.1.11  christos <code>MV</code>
    855      1.1.1.11  christos scheme, proceed as in the
    856      1.1.1.11  christos <code>TC</code>
    857      1.1.1.11  christos scheme to generate keys
    858      1.1.1.13  christos and certificates for all group hosts.
    859           1.1  christos For illustration assume trish is the TA, alice one of several trusted hosts
    860      1.1.1.13  christos and bob one of her clients.
    861           1.1  christos On TA trish run
    862           1.1  christos <code>ntp-keygen</code>
    863           1.1  christos <code>-V</code> <kbd>n</kbd>
    864           1.1  christos <code>-p</code> <kbd>password</kbd>,
    865           1.1  christos where
    866           1.1  christos <kbd>n</kbd>
    867           1.1  christos is the number of revokable keys (typically 5) to produce
    868           1.1  christos the parameter file
    869      1.1.1.13  christos <samp>ntpkeys_MVpar_trish.</samp><kbd>filestamp</kbd>
    870           1.1  christos and client key files
    871      1.1.1.13  christos <samp>ntpkeys_MVkey</samp><kbd>d</kbd> <kbd>_</kbd> <samp>trish.</samp> <kbd>filestamp</kbd>
    872           1.1  christos where
    873           1.1  christos <kbd>d</kbd>
    874           1.1  christos is the key number (0 &lt;
    875           1.1  christos <kbd>d</kbd>
    876           1.1  christos &lt;
    877      1.1.1.13  christos <kbd>n</kbd>).
    878           1.1  christos Copy the parameter file to alice and install a soft link
    879           1.1  christos from the generic
    880      1.1.1.13  christos <samp>ntpkey_mv_alice</samp>
    881      1.1.1.13  christos to this file.
    882           1.1  christos Copy one of the client key files to alice for later distribution
    883      1.1.1.13  christos to her clients.
    884      1.1.1.11  christos It does not matter which client key file goes to alice,
    885      1.1.1.13  christos since they all work the same way.
    886      1.1.1.13  christos Alice copies the client key file to all of her clients.
    887           1.1  christos On client bob install a soft link from generic
    888      1.1.1.13  christos <samp>ntpkey_mvkey_bob</samp>
    889      1.1.1.13  christos to the client key file.
    890      1.1.1.11  christos As the
    891      1.1.1.11  christos <code>MV</code>
    892      1.1.1.11  christos scheme is independent of keys and certificates,
    893           1.1  christos these files can be refreshed as needed.
    894      1.1.1.13  christos </p>
    895  1.1.1.14.4.1  perseant <span id="Command-Line-Options"></span><h4 class="subsubsection">1.2.1.3 Command Line Options</h4>
    896      1.1.1.13  christos <dl compact="compact">
    897      1.1.1.13  christos <dt><code>-b</code> <code>--imbits</code>= <kbd>modulus</kbd></dt>
    898      1.1.1.13  christos <dd><p>Set the number of bits in the identity modulus for generating identity keys to
    899      1.1.1.11  christos <kbd>modulus</kbd>
    900      1.1.1.13  christos bits.
    901      1.1.1.11  christos The number of bits in the identity modulus defaults to 256, but can be set to
    902      1.1.1.13  christos values from 256 to 2048 (32 to 256 octets).
    903      1.1.1.11  christos Use the larger moduli with caution, as this can consume considerable computing
    904      1.1.1.13  christos resources and increases the size of authenticated packets.
    905      1.1.1.13  christos </p></dd>
    906      1.1.1.13  christos <dt><code>-c</code> <code>--certificate</code>= <kbd>scheme</kbd></dt>
    907      1.1.1.13  christos <dd><p>Select certificate signature encryption/message digest scheme.
    908           1.1  christos The
    909           1.1  christos <kbd>scheme</kbd>
    910           1.1  christos can be one of the following:
    911      1.1.1.11  christos <code>RSA-MD2</code>, <code>RSA-MD5</code>, <code>RSA-MDC2</code>, <code>RSA-SHA</code>, <code>RSA-SHA1</code>, <code>RSA-RIPEMD160</code>, <code>DSA-SHA</code>,
    912           1.1  christos or
    913      1.1.1.13  christos <code>DSA-SHA1</code>.
    914      1.1.1.11  christos Note that
    915      1.1.1.11  christos <code>RSA</code>
    916      1.1.1.11  christos schemes must be used with an
    917      1.1.1.11  christos <code>RSA</code>
    918      1.1.1.11  christos sign key and
    919      1.1.1.11  christos <code>DSA</code>
    920      1.1.1.11  christos schemes must be used with a
    921      1.1.1.11  christos <code>DSA</code>
    922      1.1.1.13  christos sign key.
    923           1.1  christos The default without this option is
    924      1.1.1.13  christos <code>RSA-MD5</code>.
    925      1.1.1.11  christos If compatibility with FIPS 140-2 is required, either the
    926      1.1.1.11  christos <code>DSA-SHA</code>
    927      1.1.1.11  christos or
    928      1.1.1.11  christos <code>DSA-SHA1</code>
    929      1.1.1.13  christos scheme must be used.
    930      1.1.1.13  christos </p></dd>
    931      1.1.1.13  christos <dt><code>-C</code> <code>--cipher</code>= <kbd>cipher</kbd></dt>
    932      1.1.1.13  christos <dd><p>Select the OpenSSL cipher to encrypt the files containing private keys.
    933      1.1.1.11  christos The default without this option is three-key triple DES in CBC mode,
    934      1.1.1.13  christos <code>des-ede3-cbc</code>.
    935      1.1.1.11  christos The
    936      1.1.1.11  christos <code>openssl</code> <code>-h</code>
    937      1.1.1.13  christos command provided with OpenSSL displays available ciphers.
    938      1.1.1.13  christos </p></dd>
    939      1.1.1.13  christos <dt><code>-d</code> <code>--debug-level</code></dt>
    940      1.1.1.13  christos <dd><p>Increase debugging verbosity level.
    941      1.1.1.13  christos This option displays the cryptographic data produced in eye-friendly billboards.
    942      1.1.1.13  christos </p></dd>
    943      1.1.1.13  christos <dt><code>-D</code> <code>--set-debug-level</code>= <kbd>level</kbd></dt>
    944      1.1.1.13  christos <dd><p>Set the debugging verbosity to
    945      1.1.1.13  christos <kbd>level</kbd>.
    946      1.1.1.13  christos This option displays the cryptographic data produced in eye-friendly billboards.
    947      1.1.1.13  christos </p></dd>
    948      1.1.1.13  christos <dt><code>-e</code> <code>--id-key</code></dt>
    949      1.1.1.13  christos <dd><p>Write the
    950      1.1.1.11  christos <code>IFF</code>
    951      1.1.1.11  christos or
    952      1.1.1.11  christos <code>GQ</code>
    953      1.1.1.11  christos public parameters from the
    954      1.1.1.11  christos <kbd>IFFkey</kbd> <kbd>or</kbd> <kbd>GQkey</kbd>
    955      1.1.1.11  christos client keys file previously specified
    956      1.1.1.11  christos as unencrypted data to the standard output stream
    957      1.1.1.13  christos <samp>stdout</samp>.
    958      1.1.1.13  christos This is intended for automatic key distribution by email.
    959      1.1.1.13  christos </p></dd>
    960      1.1.1.13  christos <dt><code>-G</code> <code>--gq-params</code></dt>
    961      1.1.1.13  christos <dd><p>Generate a new encrypted
    962      1.1.1.11  christos <code>GQ</code>
    963      1.1.1.13  christos parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
    964      1.1.1.11  christos This option is mutually exclusive with the
    965      1.1.1.11  christos <code>-I</code>
    966      1.1.1.11  christos and
    967      1.1.1.11  christos <code>-V</code>
    968      1.1.1.13  christos options.
    969      1.1.1.13  christos </p></dd>
    970      1.1.1.13  christos <dt><code>-H</code> <code>--host-key</code></dt>
    971      1.1.1.13  christos <dd><p>Generate a new encrypted
    972      1.1.1.11  christos <code>RSA</code>
    973      1.1.1.13  christos public/private host key file.
    974      1.1.1.13  christos </p></dd>
    975      1.1.1.13  christos <dt><code>-I</code> <code>--iffkey</code></dt>
    976      1.1.1.13  christos <dd><p>Generate a new encrypted
    977      1.1.1.11  christos <code>IFF</code>
    978      1.1.1.13  christos key file for the Schnorr (IFF) identity scheme.
    979      1.1.1.11  christos This option is mutually exclusive with the
    980      1.1.1.11  christos <code>-G</code>
    981      1.1.1.11  christos and
    982      1.1.1.11  christos Fl V
    983      1.1.1.13  christos options.
    984      1.1.1.13  christos </p></dd>
    985      1.1.1.13  christos <dt><code>-i</code> <code>--ident</code>= <kbd>group</kbd></dt>
    986      1.1.1.13  christos <dd><p>Set the optional Autokey group name to
    987      1.1.1.13  christos <kbd>group</kbd>.
    988      1.1.1.11  christos This is used in the identity scheme parameter file names of
    989      1.1.1.11  christos <code>IFF</code>, <code>GQ</code>,
    990      1.1.1.11  christos and
    991      1.1.1.11  christos <code>MV</code>
    992      1.1.1.13  christos client parameters files.
    993      1.1.1.13  christos In that role, the default is the host name if no group is provided.
    994      1.1.1.11  christos The group name, if specified using
    995      1.1.1.11  christos <code>-i</code>
    996      1.1.1.11  christos or
    997      1.1.1.11  christos <code>-s</code>
    998      1.1.1.11  christos following an
    999      1.1.1.13  christos &lsquo;@&rsquo;
   1000      1.1.1.11  christos character, is also used in certificate subject and issuer names in the form
   1001      1.1.1.11  christos <kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
   1002      1.1.1.11  christos and should match the group specified via
   1003      1.1.1.11  christos <code>crypto</code> <code>ident</code>
   1004      1.1.1.11  christos or
   1005      1.1.1.11  christos <code>server</code> <code>ident</code>
   1006      1.1.1.13  christos in the ntpd configuration file.
   1007      1.1.1.13  christos </p></dd>
   1008      1.1.1.13  christos <dt><code>-l</code> <code>--lifetime</code>= <kbd>days</kbd></dt>
   1009      1.1.1.13  christos <dd><p>Set the lifetime for certificate expiration to
   1010      1.1.1.13  christos <kbd>days</kbd>.
   1011      1.1.1.13  christos The default lifetime is one year (365 days).
   1012      1.1.1.13  christos </p></dd>
   1013      1.1.1.13  christos <dt><code>-m</code> <code>--modulus</code>= <kbd>bits</kbd></dt>
   1014      1.1.1.13  christos <dd><p>Set the number of bits in the prime modulus for generating files to
   1015      1.1.1.13  christos <kbd>bits</kbd>.
   1016      1.1.1.13  christos The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
   1017      1.1.1.11  christos Use the larger moduli with caution, as this can consume considerable computing
   1018      1.1.1.13  christos resources and increases the size of authenticated packets.
   1019      1.1.1.13  christos </p></dd>
   1020      1.1.1.13  christos <dt><code>-M</code> <code>--md5key</code></dt>
   1021      1.1.1.13  christos <dd><p>Generate a new symmetric keys file containing 10
   1022      1.1.1.11  christos <code>MD5</code>
   1023      1.1.1.11  christos keys, and if OpenSSL is available, 10
   1024      1.1.1.11  christos <code>SHA</code>
   1025      1.1.1.13  christos keys.
   1026      1.1.1.11  christos An
   1027      1.1.1.11  christos <code>MD5</code>
   1028      1.1.1.11  christos key is a string of 20 random printable ASCII characters, while a
   1029      1.1.1.11  christos <code>SHA</code>
   1030      1.1.1.13  christos key is a string of 40 random hex digits.
   1031      1.1.1.13  christos The file can be edited using a text editor to change the key type or key content.
   1032      1.1.1.13  christos This option is mutually exclusive with all other options.
   1033      1.1.1.13  christos </p></dd>
   1034      1.1.1.13  christos <dt><code>-p</code> <code>--password</code>= <kbd>passwd</kbd></dt>
   1035      1.1.1.13  christos <dd><p>Set the password for reading and writing encrypted files to
   1036      1.1.1.13  christos <kbd>passwd</kbd>.
   1037      1.1.1.13  christos These include the host, sign and identify key files.
   1038      1.1.1.11  christos By default, the password is the string returned by the Unix
   1039      1.1.1.11  christos <code>hostname</code>
   1040      1.1.1.13  christos command.
   1041      1.1.1.13  christos </p></dd>
   1042      1.1.1.13  christos <dt><code>-P</code> <code>--pvt-cert</code></dt>
   1043      1.1.1.13  christos <dd><p>Generate a new private certificate used by the
   1044      1.1.1.11  christos <code>PC</code>
   1045      1.1.1.13  christos identity scheme.
   1046      1.1.1.13  christos By default, the program generates public certificates.
   1047      1.1.1.13  christos Note: the PC identity scheme is not recommended for new installations.
   1048      1.1.1.13  christos </p></dd>
   1049      1.1.1.13  christos <dt><code>-q</code> <code>--export-passwd</code>= <kbd>passwd</kbd></dt>
   1050      1.1.1.13  christos <dd><p>Set the password for writing encrypted
   1051      1.1.1.11  christos <code>IFF</code>, <code>GQ</code> <code>and</code> <code>MV</code>
   1052      1.1.1.11  christos identity files redirected to
   1053      1.1.1.13  christos <samp>stdout</samp>
   1054      1.1.1.11  christos to
   1055      1.1.1.13  christos <kbd>passwd</kbd>.
   1056      1.1.1.11  christos In effect, these files are decrypted with the
   1057      1.1.1.11  christos <code>-p</code>
   1058      1.1.1.11  christos password, then encrypted with the
   1059      1.1.1.11  christos <code>-q</code>
   1060      1.1.1.13  christos password.
   1061      1.1.1.11  christos By default, the password is the string returned by the Unix
   1062      1.1.1.11  christos <code>hostname</code>
   1063      1.1.1.13  christos command.
   1064      1.1.1.13  christos </p></dd>
   1065      1.1.1.13  christos <dt><code>-s</code> <code>--subject-key</code>= <code>[host]</code> <code>[@ <kbd>group</kbd>]</code></dt>
   1066      1.1.1.13  christos <dd><p>Specify the Autokey host name, where
   1067      1.1.1.11  christos <kbd>host</kbd>
   1068      1.1.1.11  christos is the optional host name and
   1069      1.1.1.11  christos <kbd>group</kbd>
   1070      1.1.1.13  christos is the optional group name.
   1071      1.1.1.11  christos The host name, and if provided, group name are used in
   1072      1.1.1.11  christos <kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
   1073      1.1.1.13  christos form as certificate subject and issuer.
   1074      1.1.1.11  christos Specifying
   1075      1.1.1.11  christos <code>-s</code> <code>-@</code> <kbd>group</kbd>
   1076      1.1.1.11  christos is allowed, and results in leaving the host name unchanged, as with
   1077      1.1.1.13  christos <code>-i</code> <kbd>group</kbd>.
   1078      1.1.1.11  christos The group name, or if no group is provided, the host name are also used in the
   1079      1.1.1.11  christos file names of
   1080      1.1.1.11  christos <code>IFF</code>, <code>GQ</code>,
   1081      1.1.1.11  christos and
   1082      1.1.1.11  christos <code>MV</code>
   1083      1.1.1.13  christos identity scheme client parameter files.
   1084      1.1.1.11  christos If
   1085      1.1.1.11  christos <kbd>host</kbd>
   1086      1.1.1.11  christos is not specified, the default host name is the string returned by the Unix
   1087      1.1.1.11  christos <code>hostname</code>
   1088      1.1.1.13  christos command.
   1089      1.1.1.13  christos </p></dd>
   1090      1.1.1.13  christos <dt><code>-S</code> <code>--sign-key</code>= <code>[<code>RSA</code> | <code>DSA</code>]</code></dt>
   1091      1.1.1.13  christos <dd><p>Generate a new encrypted public/private sign key file of the specified type.
   1092      1.1.1.13  christos By default, the sign key is the host key and has the same type.
   1093      1.1.1.11  christos If compatibility with FIPS 140-2 is required, the sign key type must be
   1094      1.1.1.13  christos <code>DSA</code>.
   1095      1.1.1.13  christos </p></dd>
   1096      1.1.1.13  christos <dt><code>-T</code> <code>--trusted-cert</code></dt>
   1097      1.1.1.13  christos <dd><p>Generate a trusted certificate.
   1098      1.1.1.13  christos By default, the program generates a non-trusted certificate.
   1099      1.1.1.13  christos </p></dd>
   1100      1.1.1.13  christos <dt><code>-V</code> <code>--mv-params</code> <kbd>nkeys</kbd></dt>
   1101      1.1.1.13  christos <dd><p>Generate
   1102      1.1.1.11  christos <kbd>nkeys</kbd>
   1103      1.1.1.11  christos encrypted server keys and parameters for the Mu-Varadharajan (MV)
   1104      1.1.1.13  christos identity scheme.
   1105      1.1.1.11  christos This option is mutually exclusive with the
   1106      1.1.1.11  christos <code>-I</code>
   1107      1.1.1.11  christos and
   1108      1.1.1.11  christos <code>-G</code>
   1109      1.1.1.13  christos options.
   1110      1.1.1.13  christos Note: support for this option should be considered a work in progress.
   1111      1.1.1.13  christos </p></dd>
   1112           1.1  christos </dl>
   1113           1.1  christos 
   1114  1.1.1.14.4.1  perseant <span id="Random-Seed-File-1"></span><h4 class="subsubsection">1.2.1.4 Random Seed File</h4>
   1115           1.1  christos <p>All cryptographically sound key generation schemes must have means
   1116           1.1  christos to randomize the entropy seed used to initialize
   1117           1.1  christos the internal pseudo-random number generator used
   1118      1.1.1.13  christos by the library routines.
   1119      1.1.1.13  christos The OpenSSL library uses a designated random seed file for this purpose.
   1120           1.1  christos The file must be available when starting the NTP daemon and
   1121           1.1  christos <code>ntp-keygen</code>
   1122      1.1.1.13  christos program.
   1123           1.1  christos If a site supports OpenSSL or its companion OpenSSH,
   1124           1.1  christos it is very likely that means to do this are already available.
   1125      1.1.1.13  christos </p>
   1126      1.1.1.13  christos <p>It is important to understand that entropy must be evolved
   1127           1.1  christos for each generation, for otherwise the random number sequence
   1128      1.1.1.13  christos would be predictable.
   1129           1.1  christos Various means dependent on external events, such as keystroke intervals,
   1130      1.1.1.13  christos can be used to do this and some systems have built-in entropy sources.
   1131           1.1  christos Suitable means are described in the OpenSSL software documentation,
   1132           1.1  christos but are outside the scope of this page.
   1133      1.1.1.13  christos </p>
   1134      1.1.1.13  christos <p>The entropy seed used by the OpenSSL library is contained in a file,
   1135           1.1  christos usually called
   1136      1.1.1.13  christos <samp>.rnd</samp>,
   1137           1.1  christos which must be available when starting the NTP daemon
   1138           1.1  christos or the
   1139           1.1  christos <code>ntp-keygen</code>
   1140      1.1.1.13  christos program.
   1141           1.1  christos The NTP daemon will first look for the file
   1142           1.1  christos using the path specified by the
   1143           1.1  christos <code>randfile</code>
   1144           1.1  christos subcommand of the
   1145           1.1  christos <code>crypto</code>
   1146      1.1.1.13  christos configuration command.
   1147           1.1  christos If not specified in this way, or when starting the
   1148           1.1  christos <code>ntp-keygen</code>
   1149           1.1  christos program,
   1150           1.1  christos the OpenSSL library will look for the file using the path specified
   1151           1.1  christos by the
   1152           1.1  christos .Ev RANDFILE
   1153           1.1  christos environment variable in the user home directory,
   1154      1.1.1.13  christos whether root or some other user.
   1155           1.1  christos If the
   1156           1.1  christos .Ev RANDFILE
   1157           1.1  christos environment variable is not present,
   1158           1.1  christos the library will look for the
   1159      1.1.1.13  christos <samp>.rnd</samp>
   1160      1.1.1.13  christos file in the user home directory.
   1161      1.1.1.11  christos Since both the
   1162      1.1.1.11  christos <code>ntp-keygen</code>
   1163      1.1.1.11  christos program and
   1164      1.1.1.11  christos <code>ntpd(1ntpdmdoc)</code>
   1165      1.1.1.11  christos daemon must run as root, the logical place to put this file is in
   1166      1.1.1.13  christos <samp>/.rnd</samp>
   1167      1.1.1.11  christos or
   1168      1.1.1.13  christos <samp>/root/.rnd</samp>.
   1169           1.1  christos If the file is not available or cannot be written,
   1170           1.1  christos the daemon exits with a message to the system log and the program
   1171           1.1  christos exits with a suitable error message.
   1172      1.1.1.13  christos </p>
   1173  1.1.1.14.4.1  perseant <span id="Cryptographic-Data-Files-1"></span><h4 class="subsubsection">1.2.1.5 Cryptographic Data Files</h4>
   1174      1.1.1.13  christos <p>All file formats begin with two nonencrypted lines.
   1175      1.1.1.11  christos The first line contains the file name, including the generated host name
   1176      1.1.1.11  christos and filestamp, in the format
   1177      1.1.1.13  christos <samp>ntpkey_</samp><kbd>key</kbd> <kbd>_</kbd> <kbd>name</kbd>. <kbd>filestamp</kbd>,
   1178      1.1.1.11  christos where
   1179      1.1.1.11  christos <kbd>key</kbd>
   1180      1.1.1.11  christos is the key or parameter type,
   1181      1.1.1.11  christos <kbd>name</kbd>
   1182      1.1.1.11  christos is the host or group name and
   1183      1.1.1.11  christos <kbd>filestamp</kbd>
   1184      1.1.1.13  christos is the filestamp (NTP seconds) when the file was created.
   1185      1.1.1.11  christos By convention,
   1186      1.1.1.11  christos <kbd>key</kbd>
   1187      1.1.1.11  christos names in generated file names include both upper and lower case
   1188      1.1.1.11  christos characters, while
   1189      1.1.1.11  christos <kbd>key</kbd>
   1190      1.1.1.13  christos names in generated link names include only lower case characters.
   1191      1.1.1.13  christos The filestamp is not used in generated link names.
   1192      1.1.1.11  christos The second line contains the datestamp in conventional Unix
   1193      1.1.1.13  christos <samp>date</samp>
   1194      1.1.1.13  christos format.
   1195      1.1.1.11  christos Lines beginning with
   1196      1.1.1.13  christos &lsquo;#&rsquo;
   1197      1.1.1.11  christos are considered comments and ignored by the
   1198           1.1  christos <code>ntp-keygen</code>
   1199           1.1  christos program and
   1200           1.1  christos <code>ntpd(1ntpdmdoc)</code>
   1201      1.1.1.11  christos daemon.
   1202      1.1.1.13  christos </p>
   1203      1.1.1.13  christos <p>The remainder of the file contains cryptographic data, encoded first using ASN.1
   1204      1.1.1.11  christos rules, then encrypted if necessary, and finally written in PEM-encoded
   1205      1.1.1.11  christos printable ASCII text, preceded and followed by MIME content identifier lines.
   1206      1.1.1.13  christos </p>
   1207      1.1.1.13  christos <p>The format of the symmetric keys file, ordinarily named
   1208      1.1.1.13  christos <samp>ntp.keys</samp>,
   1209      1.1.1.13  christos is somewhat different than the other files in the interest of backward compatibility.
   1210      1.1.1.11  christos Ordinarily, the file is generated by this program, but it can be constructed
   1211      1.1.1.11  christos and edited using an ordinary text editor.
   1212      1.1.1.13  christos </p><pre class="verbatim"># ntpkey_MD5key_bk.ntp.org.3595864945
   1213      1.1.1.11  christos # Thu Dec 12 19:22:25 2013
   1214      1.1.1.11  christos 
   1215      1.1.1.13  christos 1  MD5 L&quot;;Nw&lt;\`.I&lt;f4U0)247&quot;i  # MD5 key
   1216      1.1.1.13  christos 2  MD5 &amp;&gt;l0%XXK9O'51VwV&lt;xq~  # MD5 key
   1217      1.1.1.11  christos 3  MD5 lb4zLW~d^!K:]RsD'qb6  # MD5 key
   1218      1.1.1.11  christos 4  MD5 Yue:tL[+vR)M\`n~bY,'?  # MD5 key
   1219      1.1.1.11  christos 5  MD5 B;fx'Kgr/&amp;4ZTbL6=RxA  # MD5 key
   1220      1.1.1.11  christos 6  MD5 4eYwa\`o@}3i@@@@V@@..R9!l  # MD5 key
   1221      1.1.1.11  christos 7  MD5 \`A.([h+;wTQ|xfi%Sn_!  # MD5 key
   1222      1.1.1.13  christos 8  MD5 45:V,r4]l6y^JH6&quot;Sh?F  # MD5 key
   1223      1.1.1.11  christos 9  MD5 3-5vcn*6l29DS?Xdsg)*  # MD5 key
   1224      1.1.1.11  christos 10 MD5 2late4Me              # MD5 key
   1225      1.1.1.11  christos 11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c  # SHA1 key
   1226      1.1.1.11  christos 12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74  # SHA1 key
   1227      1.1.1.11  christos 13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9  # SHA1 key
   1228      1.1.1.11  christos 14 SHA  a5332809c8878dd3a5b918819108a111509aeceb  # SHA  key
   1229      1.1.1.11  christos 15 MD2  2fe16c88c760ff2f16d4267e36c1aa6c926e6964  # MD2  key
   1230      1.1.1.11  christos 16 MD4  b2691811dc19cfc0e2f9bcacd74213f29812183d  # MD4  key
   1231      1.1.1.11  christos 17 MD5  e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c  # MD5  key
   1232      1.1.1.11  christos 18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc  # MDC2 key
   1233      1.1.1.11  christos 19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2  # RIPEMD160 key
   1234      1.1.1.11  christos 20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878  # AES128CMAC key
   1235      1.1.1.13  christos </pre><div class="example">
   1236      1.1.1.13  christos <pre class="example">Figure 1. Typical Symmetric Key File
   1237      1.1.1.13  christos </pre></div>
   1238      1.1.1.13  christos 
   1239      1.1.1.13  christos <p>Figure 1 shows a typical symmetric keys file used by the reference
   1240      1.1.1.13  christos implementation.
   1241      1.1.1.11  christos Following the header the keys are entered one per line in the format
   1242      1.1.1.13  christos </p><div class="example">
   1243      1.1.1.13  christos <pre class="example"><kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
   1244      1.1.1.13  christos </pre></div>
   1245      1.1.1.13  christos <p>where
   1246           1.1  christos <kbd>keyno</kbd>
   1247      1.1.1.12  christos is a positive integer in the range 1-65535;
   1248           1.1  christos <kbd>type</kbd>
   1249      1.1.1.11  christos is the key type for the message digest algorithm, which in the absence of the
   1250      1.1.1.11  christos OpenSSL library must be
   1251      1.1.1.11  christos <code>MD5</code>
   1252      1.1.1.11  christos to designate the MD5 message digest algorithm;
   1253      1.1.1.11  christos if the OpenSSL library is installed, the key type can be any
   1254      1.1.1.11  christos message digest algorithm supported by that library;
   1255      1.1.1.11  christos however, if compatibility with FIPS 140-2 is required,
   1256      1.1.1.11  christos the key type must be either
   1257      1.1.1.11  christos <code>SHA</code>
   1258      1.1.1.11  christos or
   1259      1.1.1.11  christos <code>SHA1</code>;
   1260           1.1  christos <kbd>key</kbd>
   1261           1.1  christos is the key itself,
   1262      1.1.1.11  christos which is a printable ASCII string 20 characters or less in length:
   1263      1.1.1.11  christos each character is chosen from the 93 printable characters
   1264      1.1.1.11  christos in the range 0x21 through 0x7e (
   1265      1.1.1.13  christos &lsquo;&rsquo;!
   1266      1.1.1.11  christos through
   1267      1.1.1.13  christos &lsquo;~&rsquo;
   1268      1.1.1.11  christos ) excluding space and the
   1269      1.1.1.13  christos &lsquo;#&rsquo;
   1270      1.1.1.11  christos character, and terminated by whitespace or a
   1271      1.1.1.13  christos &lsquo;#&rsquo;
   1272      1.1.1.13  christos character.
   1273      1.1.1.11  christos An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
   1274      1.1.1.11  christos is truncated as necessary.
   1275      1.1.1.13  christos </p>
   1276      1.1.1.13  christos <p>Note that the keys used by the
   1277           1.1  christos <code>ntpq(1ntpqmdoc)</code>
   1278           1.1  christos and
   1279           1.1  christos <code>ntpdc(1ntpdcmdoc)</code>
   1280           1.1  christos programs
   1281           1.1  christos are checked against passwords requested by the programs
   1282           1.1  christos and entered by hand, so it is generally appropriate to specify these keys
   1283           1.1  christos in human readable ASCII format.
   1284      1.1.1.13  christos </p>
   1285      1.1.1.13  christos <p>The
   1286           1.1  christos <code>ntp-keygen</code>
   1287      1.1.1.11  christos program generates a symmetric keys file
   1288      1.1.1.13  christos <samp>ntpkey_MD5key_</samp><kbd>hostname</kbd>. <kbd>filestamp</kbd>.
   1289           1.1  christos Since the file contains private shared keys,
   1290           1.1  christos it should be visible only to root and distributed by secure means
   1291      1.1.1.13  christos to other subnet hosts.
   1292           1.1  christos The NTP daemon loads the file
   1293      1.1.1.13  christos <samp>ntp.keys</samp>,
   1294           1.1  christos so
   1295           1.1  christos <code>ntp-keygen</code>
   1296      1.1.1.13  christos installs a soft link from this name to the generated file.
   1297           1.1  christos Subsequently, similar soft links must be installed by manual
   1298      1.1.1.13  christos or automated means on the other subnet hosts.
   1299           1.1  christos While this file is not used with the Autokey Version 2 protocol,
   1300           1.1  christos it is needed to authenticate some remote configuration commands
   1301           1.1  christos used by the
   1302           1.1  christos <code>ntpq(1ntpqmdoc)</code>
   1303           1.1  christos and
   1304           1.1  christos <code>ntpdc(1ntpdcmdoc)</code>
   1305           1.1  christos utilities.
   1306      1.1.1.13  christos </p>
   1307      1.1.1.13  christos <p>This section was generated by <strong>AutoGen</strong>,
   1308      1.1.1.13  christos using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-keygen</code> program.
   1309           1.1  christos This software is released under the NTP license, &lt;http://ntp.org/license>;.
   1310      1.1.1.13  christos </p>
   1311      1.1.1.13  christos <table class="menu" border="0" cellspacing="0">
   1312  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-usage" accesskey="1">ntp-keygen usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ntp-keygen help/usage (<samp>--help</samp>)
   1313      1.1.1.13  christos </td></tr>
   1314  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-imbits" accesskey="2">ntp-keygen imbits</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">imbits option (-b)
   1315      1.1.1.13  christos </td></tr>
   1316  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-certificate" accesskey="3">ntp-keygen certificate</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">certificate option (-c)
   1317      1.1.1.13  christos </td></tr>
   1318  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-cipher" accesskey="4">ntp-keygen cipher</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">cipher option (-C)
   1319      1.1.1.13  christos </td></tr>
   1320  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-id_002dkey" accesskey="5">ntp-keygen id-key</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">id-key option (-e)
   1321      1.1.1.13  christos </td></tr>
   1322  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-gq_002dparams" accesskey="6">ntp-keygen gq-params</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">gq-params option (-G)
   1323      1.1.1.13  christos </td></tr>
   1324  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-host_002dkey" accesskey="7">ntp-keygen host-key</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">host-key option (-H)
   1325      1.1.1.13  christos </td></tr>
   1326  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-iffkey" accesskey="8">ntp-keygen iffkey</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">iffkey option (-I)
   1327      1.1.1.13  christos </td></tr>
   1328  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-ident" accesskey="9">ntp-keygen ident</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">ident option (-i)
   1329      1.1.1.13  christos </td></tr>
   1330  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">lifetime option (-l)
   1331      1.1.1.13  christos </td></tr>
   1332  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">modulus option (-m)
   1333      1.1.1.13  christos </td></tr>
   1334  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">md5key option (-M)
   1335      1.1.1.13  christos </td></tr>
   1336  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">pvt-cert option (-P)
   1337      1.1.1.13  christos </td></tr>
   1338  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-password">ntp-keygen password</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">password option (-p)
   1339      1.1.1.13  christos </td></tr>
   1340  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">export-passwd option (-q)
   1341      1.1.1.13  christos </td></tr>
   1342  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">subject-name option (-s)
   1343      1.1.1.13  christos </td></tr>
   1344  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">sign-key option (-S)
   1345      1.1.1.13  christos </td></tr>
   1346  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">trusted-cert option (-T)
   1347      1.1.1.13  christos </td></tr>
   1348  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">mv-params option (-V)
   1349      1.1.1.13  christos </td></tr>
   1350  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">mv-keys option (-v)
   1351      1.1.1.13  christos </td></tr>
   1352  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-config">ntp-keygen config</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">presetting/configuring ntp-keygen
   1353      1.1.1.13  christos </td></tr>
   1354  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">exit status
   1355      1.1.1.13  christos </td></tr>
   1356  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Usage
   1357      1.1.1.13  christos </td></tr>
   1358  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Notes
   1359      1.1.1.13  christos </td></tr>
   1360  1.1.1.14.4.1  perseant <tr><td align="left" valign="top">&bull; <a href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Bugs
   1361      1.1.1.13  christos </td></tr>
   1362      1.1.1.13  christos </table>
   1363      1.1.1.13  christos 
   1364      1.1.1.13  christos <hr>
   1365  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-usage"></span><div class="header">
   1366      1.1.1.13  christos <p>
   1367      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-imbits" accesskey="n" rel="next">ntp-keygen imbits</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1368      1.1.1.13  christos </div>
   1369  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-help_002fusage-_0028_002d_002dhelp_0029"></span><h4 class="subsection">1.2.2 ntp-keygen help/usage (<samp>--help</samp>)</h4>
   1370  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen-help"></span>
   1371      1.1.1.13  christos 
   1372      1.1.1.13  christos <p>This is the automatically generated usage text for ntp-keygen.
   1373      1.1.1.13  christos </p>
   1374      1.1.1.13  christos <p>The text printed is the same whether selected with the <code>help</code> option
   1375      1.1.1.13  christos (<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>).  <code>more-help</code> will print
   1376      1.1.1.13  christos the usage text by passing it through a pager program.
   1377           1.1  christos <code>more-help</code> is disabled on platforms without a working
   1378           1.1  christos <code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
   1379      1.1.1.13  christos used to select the program, defaulting to <samp>more</samp>.  Both will exit
   1380           1.1  christos with a status code of 0.
   1381      1.1.1.13  christos </p>
   1382      1.1.1.13  christos <div class="example">
   1383  1.1.1.14.4.1  perseant <pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p18
   1384           1.1  christos Usage:  ntp-keygen [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]...
   1385           1.1  christos   Flg Arg Option-Name    Description
   1386           1.1  christos    -b Num imbits         identity modulus bits
   1387           1.1  christos                                 - it must be in the range:
   1388           1.1  christos                                   256 to 2048
   1389           1.1  christos    -c Str certificate    certificate scheme
   1390           1.1  christos    -C Str cipher         privatekey cipher
   1391           1.1  christos    -d no  debug-level    Increase debug verbosity level
   1392           1.1  christos                                 - may appear multiple times
   1393           1.1  christos    -D Num set-debug-level Set the debug verbosity level
   1394           1.1  christos                                 - may appear multiple times
   1395           1.1  christos    -e no  id-key         Write IFF or GQ identity keys
   1396           1.1  christos    -G no  gq-params      Generate GQ parameters and keys
   1397           1.1  christos    -H no  host-key       generate RSA host key
   1398           1.1  christos    -I no  iffkey         generate IFF parameters
   1399           1.1  christos    -i Str ident          set Autokey group name
   1400           1.1  christos    -l Num lifetime       set certificate lifetime
   1401      1.1.1.11  christos    -m Num modulus        prime modulus
   1402           1.1  christos                                 - it must be in the range:
   1403           1.1  christos                                   256 to 2048
   1404      1.1.1.11  christos    -M no  md5key         generate symmetric keys
   1405           1.1  christos    -P no  pvt-cert       generate PC private certificate
   1406       1.1.1.2  christos    -p Str password       local private password
   1407       1.1.1.2  christos    -q Str export-passwd  export IFF or GQ group keys with password
   1408           1.1  christos    -s Str subject-name   set host and optionally group name
   1409      1.1.1.11  christos    -S Str sign-key       generate sign key (RSA or DSA)
   1410           1.1  christos    -T no  trusted-cert   trusted certificate (TC scheme)
   1411           1.1  christos    -V Num mv-params      generate &lt;num&gt; MV parameters
   1412           1.1  christos    -v Num mv-keys        update &lt;num&gt; MV keys
   1413           1.1  christos       opt version        output version information and exit
   1414           1.1  christos    -? no  help           display extended usage information and exit
   1415           1.1  christos    -! no  more-help      extended usage information passed thru pager
   1416           1.1  christos    -&gt; opt save-opts      save the option state to a config file
   1417           1.1  christos    -&lt; Str load-opts      load options from a config file
   1418           1.1  christos                                 - disabled as '--no-load-opts'
   1419           1.1  christos                                 - may appear multiple times
   1420           1.1  christos 
   1421           1.1  christos Options are specified by doubled hyphens and their name or by a single
   1422           1.1  christos hyphen and the flag character.
   1423           1.1  christos 
   1424           1.1  christos 
   1425           1.1  christos The following option preset mechanisms are supported:
   1426           1.1  christos  - reading file $HOME/.ntprc
   1427           1.1  christos  - reading file ./.ntprc
   1428           1.1  christos  - examining environment variables named NTP_KEYGEN_*
   1429           1.1  christos 
   1430  1.1.1.14.4.1  perseant Please send bug reports to:  &lt;https://bugs.ntp.org, bugs (a] ntp.org&gt;
   1431      1.1.1.13  christos </pre></div>
   1432           1.1  christos 
   1433      1.1.1.13  christos <hr>
   1434  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-imbits"></span><div class="header">
   1435      1.1.1.13  christos <p>
   1436      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-certificate" accesskey="n" rel="next">ntp-keygen certificate</a>, Previous: <a href="#ntp_002dkeygen-usage" accesskey="p" rel="prev">ntp-keygen usage</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1437      1.1.1.13  christos </div>
   1438  1.1.1.14.4.1  perseant <span id="imbits-option-_0028_002db_0029"></span><h4 class="subsection">1.2.3 imbits option (-b)</h4>
   1439  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dimbits"></span>
   1440      1.1.1.13  christos 
   1441      1.1.1.13  christos <p>This is the &ldquo;identity modulus bits&rdquo; option.
   1442      1.1.1.13  christos This option takes a number argument <samp>imbits</samp>.
   1443      1.1.1.13  christos </p>
   1444      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1445      1.1.1.13  christos </p><ul>
   1446      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1447      1.1.1.13  christos </li></ul>
   1448      1.1.1.13  christos 
   1449  1.1.1.14.4.1  perseant <p>The number of bits in the identity modulus.  The default is 512.
   1450      1.1.1.13  christos </p><hr>
   1451  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-certificate"></span><div class="header">
   1452      1.1.1.13  christos <p>
   1453      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-cipher" accesskey="n" rel="next">ntp-keygen cipher</a>, Previous: <a href="#ntp_002dkeygen-imbits" accesskey="p" rel="prev">ntp-keygen imbits</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1454      1.1.1.13  christos </div>
   1455  1.1.1.14.4.1  perseant <span id="certificate-option-_0028_002dc_0029"></span><h4 class="subsection">1.2.4 certificate option (-c)</h4>
   1456  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dcertificate"></span>
   1457      1.1.1.13  christos 
   1458      1.1.1.13  christos <p>This is the &ldquo;certificate scheme&rdquo; option.
   1459      1.1.1.13  christos This option takes a string argument <samp>scheme</samp>.
   1460      1.1.1.13  christos </p>
   1461      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1462      1.1.1.13  christos </p><ul>
   1463      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1464      1.1.1.13  christos </li></ul>
   1465           1.1  christos 
   1466      1.1.1.13  christos <p>scheme is one of
   1467      1.1.1.11  christos RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
   1468           1.1  christos DSA-SHA, or DSA-SHA1.
   1469      1.1.1.13  christos </p>
   1470      1.1.1.13  christos <p>Select the certificate signature encryption/message digest scheme.
   1471           1.1  christos Note that RSA schemes must be used with a RSA sign key and DSA
   1472           1.1  christos schemes must be used with a DSA sign key.  The default without
   1473      1.1.1.13  christos this option is RSA-MD5.
   1474      1.1.1.13  christos </p><hr>
   1475  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-cipher"></span><div class="header">
   1476      1.1.1.13  christos <p>
   1477      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-id_002dkey" accesskey="n" rel="next">ntp-keygen id-key</a>, Previous: <a href="#ntp_002dkeygen-certificate" accesskey="p" rel="prev">ntp-keygen certificate</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1478      1.1.1.13  christos </div>
   1479  1.1.1.14.4.1  perseant <span id="cipher-option-_0028_002dC_0029"></span><h4 class="subsection">1.2.5 cipher option (-C)</h4>
   1480  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dcipher"></span>
   1481      1.1.1.13  christos 
   1482      1.1.1.13  christos <p>This is the &ldquo;privatekey cipher&rdquo; option.
   1483      1.1.1.13  christos This option takes a string argument <samp>cipher</samp>.
   1484      1.1.1.13  christos </p>
   1485      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1486      1.1.1.13  christos </p><ul>
   1487      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1488      1.1.1.13  christos </li></ul>
   1489           1.1  christos 
   1490      1.1.1.13  christos <p>Select the cipher which is used to encrypt the files containing
   1491           1.1  christos private keys.  The default is three-key triple DES in CBC mode,
   1492      1.1.1.13  christos equivalent to &quot;<code>-C des-ede3-cbc</code>&quot;.  The openssl tool lists ciphers
   1493      1.1.1.13  christos available in &quot;<code>openssl -h</code>&quot; output.
   1494      1.1.1.13  christos </p><hr>
   1495  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-id_002dkey"></span><div class="header">
   1496      1.1.1.13  christos <p>
   1497      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-gq_002dparams" accesskey="n" rel="next">ntp-keygen gq-params</a>, Previous: <a href="#ntp_002dkeygen-cipher" accesskey="p" rel="prev">ntp-keygen cipher</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1498      1.1.1.13  christos </div>
   1499  1.1.1.14.4.1  perseant <span id="id_002dkey-option-_0028_002de_0029"></span><h4 class="subsection">1.2.6 id-key option (-e)</h4>
   1500  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002did_002dkey"></span>
   1501      1.1.1.13  christos 
   1502      1.1.1.13  christos <p>This is the &ldquo;write iff or gq identity keys&rdquo; option.
   1503      1.1.1.13  christos </p>
   1504      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1505      1.1.1.13  christos </p><ul>
   1506      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1507      1.1.1.13  christos </li></ul>
   1508      1.1.1.13  christos 
   1509      1.1.1.13  christos <p>Write the public parameters from the IFF or GQ client keys to
   1510      1.1.1.13  christos the standard output.
   1511      1.1.1.13  christos This is intended for automatic key distribution by email.
   1512      1.1.1.13  christos </p><hr>
   1513  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-gq_002dparams"></span><div class="header">
   1514      1.1.1.13  christos <p>
   1515      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-host_002dkey" accesskey="n" rel="next">ntp-keygen host-key</a>, Previous: <a href="#ntp_002dkeygen-id_002dkey" accesskey="p" rel="prev">ntp-keygen id-key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1516      1.1.1.13  christos </div>
   1517  1.1.1.14.4.1  perseant <span id="gq_002dparams-option-_0028_002dG_0029"></span><h4 class="subsection">1.2.7 gq-params option (-G)</h4>
   1518  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dgq_002dparams"></span>
   1519      1.1.1.13  christos 
   1520      1.1.1.13  christos <p>This is the &ldquo;generate gq parameters and keys&rdquo; option.
   1521      1.1.1.13  christos </p>
   1522      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1523      1.1.1.13  christos </p><ul>
   1524      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1525      1.1.1.13  christos </li></ul>
   1526      1.1.1.13  christos 
   1527      1.1.1.13  christos <p>Generate parameters and keys for the GQ identification scheme,
   1528      1.1.1.13  christos obsoleting any that may exist.
   1529      1.1.1.13  christos </p><hr>
   1530  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-host_002dkey"></span><div class="header">
   1531      1.1.1.13  christos <p>
   1532      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-iffkey" accesskey="n" rel="next">ntp-keygen iffkey</a>, Previous: <a href="#ntp_002dkeygen-gq_002dparams" accesskey="p" rel="prev">ntp-keygen gq-params</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1533      1.1.1.13  christos </div>
   1534  1.1.1.14.4.1  perseant <span id="host_002dkey-option-_0028_002dH_0029"></span><h4 class="subsection">1.2.8 host-key option (-H)</h4>
   1535  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dhost_002dkey"></span>
   1536      1.1.1.13  christos 
   1537      1.1.1.13  christos <p>This is the &ldquo;generate rsa host key&rdquo; option.
   1538      1.1.1.13  christos </p>
   1539      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1540      1.1.1.13  christos </p><ul>
   1541      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1542      1.1.1.13  christos </li></ul>
   1543      1.1.1.13  christos 
   1544      1.1.1.13  christos <p>Generate new host keys, obsoleting any that may exist.
   1545      1.1.1.13  christos </p><hr>
   1546  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-iffkey"></span><div class="header">
   1547      1.1.1.13  christos <p>
   1548      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-ident" accesskey="n" rel="next">ntp-keygen ident</a>, Previous: <a href="#ntp_002dkeygen-host_002dkey" accesskey="p" rel="prev">ntp-keygen host-key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1549      1.1.1.13  christos </div>
   1550  1.1.1.14.4.1  perseant <span id="iffkey-option-_0028_002dI_0029"></span><h4 class="subsection">1.2.9 iffkey option (-I)</h4>
   1551  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002diffkey"></span>
   1552      1.1.1.13  christos 
   1553      1.1.1.13  christos <p>This is the &ldquo;generate iff parameters&rdquo; option.
   1554      1.1.1.13  christos </p>
   1555      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1556      1.1.1.13  christos </p><ul>
   1557      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1558      1.1.1.13  christos </li></ul>
   1559      1.1.1.13  christos 
   1560      1.1.1.13  christos <p>Generate parameters for the IFF identification scheme, obsoleting
   1561      1.1.1.13  christos any that may exist.
   1562      1.1.1.13  christos </p><hr>
   1563  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-ident"></span><div class="header">
   1564      1.1.1.13  christos <p>
   1565      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-lifetime" accesskey="n" rel="next">ntp-keygen lifetime</a>, Previous: <a href="#ntp_002dkeygen-iffkey" accesskey="p" rel="prev">ntp-keygen iffkey</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1566      1.1.1.13  christos </div>
   1567  1.1.1.14.4.1  perseant <span id="ident-option-_0028_002di_0029"></span><h4 class="subsection">1.2.10 ident option (-i)</h4>
   1568  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dident"></span>
   1569      1.1.1.13  christos 
   1570      1.1.1.13  christos <p>This is the &ldquo;set autokey group name&rdquo; option.
   1571      1.1.1.13  christos This option takes a string argument <samp>group</samp>.
   1572      1.1.1.13  christos </p>
   1573      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1574      1.1.1.13  christos </p><ul>
   1575      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1576      1.1.1.13  christos </li></ul>
   1577           1.1  christos 
   1578      1.1.1.13  christos <p>Set the optional Autokey group name to name.  This is used in
   1579           1.1  christos the file name of IFF, GQ, and MV client parameters files.  In
   1580           1.1  christos that role, the default is the host name if this option is not
   1581           1.1  christos provided.  The group name, if specified using <code>-i/--ident</code> or
   1582      1.1.1.13  christos using <code>-s/--subject-name</code> following an &rsquo;<code>@</code>&rsquo; character,
   1583      1.1.1.11  christos is also a part of the self-signed host certificate subject and
   1584      1.1.1.11  christos issuer names in the form <code>host@group</code> and should match the
   1585      1.1.1.13  christos &rsquo;<code>crypto ident</code>&rsquo; or &rsquo;<code>server ident</code>&rsquo; configuration in the
   1586      1.1.1.13  christos <code>ntpd</code> configuration file.
   1587      1.1.1.13  christos </p><hr>
   1588  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-lifetime"></span><div class="header">
   1589      1.1.1.13  christos <p>
   1590      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-modulus" accesskey="n" rel="next">ntp-keygen modulus</a>, Previous: <a href="#ntp_002dkeygen-ident" accesskey="p" rel="prev">ntp-keygen ident</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1591      1.1.1.13  christos </div>
   1592  1.1.1.14.4.1  perseant <span id="lifetime-option-_0028_002dl_0029"></span><h4 class="subsection">1.2.11 lifetime option (-l)</h4>
   1593  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dlifetime"></span>
   1594      1.1.1.13  christos 
   1595      1.1.1.13  christos <p>This is the &ldquo;set certificate lifetime&rdquo; option.
   1596      1.1.1.13  christos This option takes a number argument <samp>lifetime</samp>.
   1597      1.1.1.13  christos </p>
   1598      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1599      1.1.1.13  christos </p><ul>
   1600      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1601      1.1.1.13  christos </li></ul>
   1602      1.1.1.13  christos 
   1603      1.1.1.13  christos <p>Set the certificate expiration to lifetime days from now.
   1604      1.1.1.13  christos </p><hr>
   1605  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-modulus"></span><div class="header">
   1606      1.1.1.13  christos <p>
   1607      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-md5key" accesskey="n" rel="next">ntp-keygen md5key</a>, Previous: <a href="#ntp_002dkeygen-lifetime" accesskey="p" rel="prev">ntp-keygen lifetime</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1608      1.1.1.13  christos </div>
   1609  1.1.1.14.4.1  perseant <span id="modulus-option-_0028_002dm_0029"></span><h4 class="subsection">1.2.12 modulus option (-m)</h4>
   1610  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dmodulus"></span>
   1611      1.1.1.13  christos 
   1612      1.1.1.13  christos <p>This is the &ldquo;prime modulus&rdquo; option.
   1613      1.1.1.13  christos This option takes a number argument <samp>modulus</samp>.
   1614      1.1.1.13  christos </p>
   1615      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1616      1.1.1.13  christos </p><ul>
   1617      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1618      1.1.1.13  christos </li></ul>
   1619      1.1.1.13  christos 
   1620      1.1.1.13  christos <p>The number of bits in the prime modulus.  The default is 512.
   1621      1.1.1.13  christos </p><hr>
   1622  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-md5key"></span><div class="header">
   1623      1.1.1.13  christos <p>
   1624      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-pvt_002dcert" accesskey="n" rel="next">ntp-keygen pvt-cert</a>, Previous: <a href="#ntp_002dkeygen-modulus" accesskey="p" rel="prev">ntp-keygen modulus</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1625      1.1.1.13  christos </div>
   1626  1.1.1.14.4.1  perseant <span id="md5key-option-_0028_002dM_0029"></span><h4 class="subsection">1.2.13 md5key option (-M)</h4>
   1627  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dmd5key"></span>
   1628      1.1.1.13  christos 
   1629      1.1.1.13  christos <p>This is the &ldquo;generate symmetric keys&rdquo; option.
   1630      1.1.1.13  christos Generate symmetric keys, obsoleting any that may exist.
   1631      1.1.1.13  christos </p><hr>
   1632  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-pvt_002dcert"></span><div class="header">
   1633      1.1.1.13  christos <p>
   1634      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-password" accesskey="n" rel="next">ntp-keygen password</a>, Previous: <a href="#ntp_002dkeygen-md5key" accesskey="p" rel="prev">ntp-keygen md5key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1635      1.1.1.13  christos </div>
   1636  1.1.1.14.4.1  perseant <span id="pvt_002dcert-option-_0028_002dP_0029"></span><h4 class="subsection">1.2.14 pvt-cert option (-P)</h4>
   1637  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dpvt_002dcert"></span>
   1638      1.1.1.13  christos 
   1639      1.1.1.13  christos <p>This is the &ldquo;generate pc private certificate&rdquo; option.
   1640      1.1.1.13  christos </p>
   1641      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1642      1.1.1.13  christos </p><ul>
   1643      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1644      1.1.1.13  christos </li></ul>
   1645      1.1.1.13  christos 
   1646      1.1.1.13  christos <p>Generate a private certificate.  By default, the program generates
   1647      1.1.1.13  christos public certificates.
   1648      1.1.1.13  christos </p><hr>
   1649  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-password"></span><div class="header">
   1650      1.1.1.13  christos <p>
   1651      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-export_002dpasswd" accesskey="n" rel="next">ntp-keygen export-passwd</a>, Previous: <a href="#ntp_002dkeygen-pvt_002dcert" accesskey="p" rel="prev">ntp-keygen pvt-cert</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1652      1.1.1.13  christos </div>
   1653  1.1.1.14.4.1  perseant <span id="password-option-_0028_002dp_0029"></span><h4 class="subsection">1.2.15 password option (-p)</h4>
   1654  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dpassword"></span>
   1655      1.1.1.13  christos 
   1656      1.1.1.13  christos <p>This is the &ldquo;local private password&rdquo; option.
   1657      1.1.1.13  christos This option takes a string argument <samp>passwd</samp>.
   1658      1.1.1.13  christos </p>
   1659      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1660      1.1.1.13  christos </p><ul>
   1661      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1662      1.1.1.13  christos </li></ul>
   1663           1.1  christos 
   1664      1.1.1.13  christos <p>Local files containing private data are encrypted with the
   1665       1.1.1.2  christos DES-CBC algorithm and the specified password.  The same password
   1666      1.1.1.13  christos must be specified to the local ntpd via the &quot;crypto pw password&quot;
   1667       1.1.1.2  christos configuration command.  The default password is the local
   1668      1.1.1.13  christos hostname.
   1669      1.1.1.13  christos </p><hr>
   1670  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-export_002dpasswd"></span><div class="header">
   1671      1.1.1.13  christos <p>
   1672      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-subject_002dname" accesskey="n" rel="next">ntp-keygen subject-name</a>, Previous: <a href="#ntp_002dkeygen-password" accesskey="p" rel="prev">ntp-keygen password</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1673      1.1.1.13  christos </div>
   1674  1.1.1.14.4.1  perseant <span id="export_002dpasswd-option-_0028_002dq_0029"></span><h4 class="subsection">1.2.16 export-passwd option (-q)</h4>
   1675  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dexport_002dpasswd"></span>
   1676      1.1.1.13  christos 
   1677      1.1.1.13  christos <p>This is the &ldquo;export iff or gq group keys with password&rdquo; option.
   1678      1.1.1.13  christos This option takes a string argument <samp>passwd</samp>.
   1679      1.1.1.13  christos </p>
   1680      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1681      1.1.1.13  christos </p><ul>
   1682      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1683      1.1.1.13  christos </li></ul>
   1684           1.1  christos 
   1685      1.1.1.13  christos <p>Export IFF or GQ identity group keys to the standard output,
   1686      1.1.1.13  christos encrypted with the DES-CBC algorithm and the specified password.
   1687       1.1.1.2  christos The same password must be specified to the remote ntpd via the
   1688      1.1.1.13  christos &quot;crypto pw password&quot; configuration command.  See also the option
   1689      1.1.1.13  christos &ndash;id-key (-e) for unencrypted exports.
   1690      1.1.1.13  christos </p><hr>
   1691  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-subject_002dname"></span><div class="header">
   1692      1.1.1.13  christos <p>
   1693      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-sign_002dkey" accesskey="n" rel="next">ntp-keygen sign-key</a>, Previous: <a href="#ntp_002dkeygen-export_002dpasswd" accesskey="p" rel="prev">ntp-keygen export-passwd</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1694      1.1.1.13  christos </div>
   1695  1.1.1.14.4.1  perseant <span id="subject_002dname-option-_0028_002ds_0029"></span><h4 class="subsection">1.2.17 subject-name option (-s)</h4>
   1696  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dsubject_002dname"></span>
   1697      1.1.1.13  christos 
   1698      1.1.1.13  christos <p>This is the &ldquo;set host and optionally group name&rdquo; option.
   1699      1.1.1.13  christos This option takes a string argument <samp>host@group</samp>.
   1700      1.1.1.13  christos </p>
   1701      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1702      1.1.1.13  christos </p><ul>
   1703      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1704      1.1.1.13  christos </li></ul>
   1705           1.1  christos 
   1706      1.1.1.13  christos <p>Set the Autokey host name, and optionally, group name specified
   1707      1.1.1.13  christos following an &rsquo;<code>@</code>&rsquo; character.  The host name is used in the file
   1708      1.1.1.11  christos name of generated host and signing certificates, without the
   1709      1.1.1.11  christos group name.  The host name, and if provided, group name are used
   1710      1.1.1.11  christos in <code>host@group</code> form for the host certificate subject and issuer
   1711      1.1.1.13  christos fields.  Specifying &rsquo;<code>-s @group</code>&rsquo; is allowed, and results in
   1712      1.1.1.11  christos leaving the host name unchanged while appending <code>@group</code> to the
   1713      1.1.1.11  christos subject and issuer fields, as with <code>-i group</code>.  The group name, or
   1714      1.1.1.11  christos if not provided, the host name are also used in the file names
   1715      1.1.1.13  christos of IFF, GQ, and MV client parameter files.
   1716      1.1.1.13  christos </p><hr>
   1717  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-sign_002dkey"></span><div class="header">
   1718      1.1.1.13  christos <p>
   1719      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-trusted_002dcert" accesskey="n" rel="next">ntp-keygen trusted-cert</a>, Previous: <a href="#ntp_002dkeygen-subject_002dname" accesskey="p" rel="prev">ntp-keygen subject-name</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1720      1.1.1.13  christos </div>
   1721  1.1.1.14.4.1  perseant <span id="sign_002dkey-option-_0028_002dS_0029"></span><h4 class="subsection">1.2.18 sign-key option (-S)</h4>
   1722  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dsign_002dkey"></span>
   1723      1.1.1.13  christos 
   1724      1.1.1.13  christos <p>This is the &ldquo;generate sign key (rsa or dsa)&rdquo; option.
   1725      1.1.1.13  christos This option takes a string argument <samp>sign</samp>.
   1726      1.1.1.13  christos </p>
   1727      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1728      1.1.1.13  christos </p><ul>
   1729      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1730      1.1.1.13  christos </li></ul>
   1731           1.1  christos 
   1732      1.1.1.13  christos <p>Generate a new sign key of the designated type, obsoleting any
   1733      1.1.1.11  christos that may exist.  By default, the program uses the host key as the
   1734      1.1.1.13  christos sign key.
   1735      1.1.1.13  christos </p><hr>
   1736  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-trusted_002dcert"></span><div class="header">
   1737      1.1.1.13  christos <p>
   1738      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-mv_002dparams" accesskey="n" rel="next">ntp-keygen mv-params</a>, Previous: <a href="#ntp_002dkeygen-sign_002dkey" accesskey="p" rel="prev">ntp-keygen sign-key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1739      1.1.1.13  christos </div>
   1740  1.1.1.14.4.1  perseant <span id="trusted_002dcert-option-_0028_002dT_0029"></span><h4 class="subsection">1.2.19 trusted-cert option (-T)</h4>
   1741  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dtrusted_002dcert"></span>
   1742      1.1.1.13  christos 
   1743      1.1.1.13  christos <p>This is the &ldquo;trusted certificate (tc scheme)&rdquo; option.
   1744      1.1.1.13  christos </p>
   1745      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1746      1.1.1.13  christos </p><ul>
   1747      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1748      1.1.1.13  christos </li></ul>
   1749      1.1.1.13  christos 
   1750      1.1.1.13  christos <p>Generate a trusted certificate.  By default, the program generates
   1751      1.1.1.13  christos a non-trusted certificate.
   1752      1.1.1.13  christos </p><hr>
   1753  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-mv_002dparams"></span><div class="header">
   1754      1.1.1.13  christos <p>
   1755      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-mv_002dkeys" accesskey="n" rel="next">ntp-keygen mv-keys</a>, Previous: <a href="#ntp_002dkeygen-trusted_002dcert" accesskey="p" rel="prev">ntp-keygen trusted-cert</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1756      1.1.1.13  christos </div>
   1757  1.1.1.14.4.1  perseant <span id="mv_002dparams-option-_0028_002dV_0029"></span><h4 class="subsection">1.2.20 mv-params option (-V)</h4>
   1758  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dmv_002dparams"></span>
   1759      1.1.1.13  christos 
   1760      1.1.1.13  christos <p>This is the &ldquo;generate &lt;num&gt; mv parameters&rdquo; option.
   1761      1.1.1.13  christos This option takes a number argument <samp>num</samp>.
   1762      1.1.1.13  christos </p>
   1763      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1764      1.1.1.13  christos </p><ul>
   1765      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1766      1.1.1.13  christos </li></ul>
   1767      1.1.1.13  christos 
   1768      1.1.1.13  christos <p>Generate parameters and keys for the Mu-Varadharajan (MV)
   1769      1.1.1.13  christos identification scheme.
   1770      1.1.1.13  christos </p><hr>
   1771  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-mv_002dkeys"></span><div class="header">
   1772      1.1.1.13  christos <p>
   1773      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-config" accesskey="n" rel="next">ntp-keygen config</a>, Previous: <a href="#ntp_002dkeygen-mv_002dparams" accesskey="p" rel="prev">ntp-keygen mv-params</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1774      1.1.1.13  christos </div>
   1775  1.1.1.14.4.1  perseant <span id="mv_002dkeys-option-_0028_002dv_0029"></span><h4 class="subsection">1.2.21 mv-keys option (-v)</h4>
   1776  1.1.1.14.4.1  perseant <span id="index-ntp_002dkeygen_002dmv_002dkeys"></span>
   1777      1.1.1.13  christos 
   1778      1.1.1.13  christos <p>This is the &ldquo;update &lt;num&gt; mv keys&rdquo; option.
   1779      1.1.1.13  christos This option takes a number argument <samp>num</samp>.
   1780      1.1.1.13  christos </p>
   1781      1.1.1.13  christos <p>This option has some usage constraints.  It:
   1782      1.1.1.13  christos </p><ul>
   1783      1.1.1.13  christos <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
   1784      1.1.1.13  christos </li></ul>
   1785      1.1.1.13  christos 
   1786      1.1.1.13  christos <p>This option has no &lsquo;<samp>doc</samp>&rsquo; documentation.
   1787      1.1.1.13  christos </p>
   1788      1.1.1.13  christos 
   1789      1.1.1.13  christos <hr>
   1790  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-config"></span><div class="header">
   1791      1.1.1.13  christos <p>
   1792      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-exit-status" accesskey="n" rel="next">ntp-keygen exit status</a>, Previous: <a href="#ntp_002dkeygen-mv_002dkeys" accesskey="p" rel="prev">ntp-keygen mv-keys</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1793           1.1  christos </div>
   1794  1.1.1.14.4.1  perseant <span id="presetting_002fconfiguring-ntp_002dkeygen"></span><h4 class="subsection">1.2.22 presetting/configuring ntp-keygen</h4>
   1795           1.1  christos 
   1796           1.1  christos <p>Any option that is not marked as <i>not presettable</i> may be preset by
   1797      1.1.1.13  christos loading values from configuration (&quot;rc&quot; or &quot;ini&quot;) files, and values from environment variables named <code>NTP-KEYGEN</code> and <code>NTP-KEYGEN_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
   1798      1.1.1.13  christos the options listed above in upper case and segmented with underscores.
   1799           1.1  christos The <code>NTP-KEYGEN</code> variable will be tokenized and parsed like
   1800           1.1  christos the command line.  The remaining variables are tested for existence and their
   1801           1.1  christos values are treated like option arguments.
   1802      1.1.1.13  christos </p>
   1803           1.1  christos 
   1804      1.1.1.13  christos <p><code>libopts</code> will search in 2 places for configuration files:
   1805      1.1.1.13  christos </p><ul>
   1806      1.1.1.13  christos <li> $HOME
   1807      1.1.1.13  christos </li><li> $PWD
   1808      1.1.1.13  christos </li></ul>
   1809      1.1.1.13  christos <p>The environment variables <code>HOME</code>, and <code>PWD</code>
   1810      1.1.1.13  christos are expanded and replaced when <samp>ntp-keygen</samp> runs.
   1811      1.1.1.13  christos For any of these that are plain files, they are simply processed.
   1812      1.1.1.13  christos For any that are directories, then a file named <samp>.ntprc</samp> is searched for
   1813           1.1  christos within that directory and processed.
   1814      1.1.1.13  christos </p>
   1815      1.1.1.13  christos <p>Configuration files may be in a wide variety of formats.
   1816           1.1  christos The basic format is an option name followed by a value (argument) on the
   1817           1.1  christos same line.  Values may be separated from the option name with a colon,
   1818           1.1  christos equal sign or simply white space.  Values may be continued across multiple
   1819           1.1  christos lines by escaping the newline with a backslash.
   1820      1.1.1.13  christos </p>
   1821      1.1.1.13  christos <p>Multiple programs may also share the same initialization file.
   1822           1.1  christos Common options are collected at the top, followed by program specific
   1823           1.1  christos segments.  The segments are separated by lines like:
   1824      1.1.1.13  christos </p><div class="example">
   1825      1.1.1.13  christos <pre class="example">[NTP-KEYGEN]
   1826      1.1.1.13  christos </pre></div>
   1827      1.1.1.13  christos <p>or by
   1828      1.1.1.13  christos </p><div class="example">
   1829      1.1.1.13  christos <pre class="example">&lt;?program ntp-keygen&gt;
   1830      1.1.1.13  christos </pre></div>
   1831      1.1.1.13  christos <p>Do not mix these styles within one configuration file.
   1832      1.1.1.13  christos </p>
   1833      1.1.1.13  christos <p>Compound values and carefully constructed string values may also be
   1834           1.1  christos specified using XML syntax:
   1835      1.1.1.13  christos </p><div class="example">
   1836      1.1.1.13  christos <pre class="example">&lt;option-name&gt;
   1837      1.1.1.13  christos    &lt;sub-opt&gt;...&amp;lt;...&amp;gt;...&lt;/sub-opt&gt;
   1838      1.1.1.13  christos &lt;/option-name&gt;
   1839      1.1.1.13  christos </pre></div>
   1840      1.1.1.13  christos <p>yielding an <code>option-name.sub-opt</code> string value of
   1841      1.1.1.13  christos </p><div class="example">
   1842      1.1.1.13  christos <pre class="example">&quot;...&lt;...&gt;...&quot;
   1843      1.1.1.13  christos </pre></div>
   1844      1.1.1.13  christos <p><code>AutoOpts</code> does not track suboptions.  You simply note that it is a
   1845           1.1  christos hierarchicly valued option.  <code>AutoOpts</code> does provide a means for searching
   1846           1.1  christos the associated name/value pair list (see: optionFindValue).
   1847      1.1.1.13  christos </p>
   1848      1.1.1.13  christos <p>The command line options relating to configuration and/or usage help are:
   1849      1.1.1.13  christos </p>
   1850  1.1.1.14.4.1  perseant <span id="version-_0028_002d_0029"></span><h4 class="subsubheading">version (-)</h4>
   1851           1.1  christos 
   1852           1.1  christos <p>Print the program version to standard out, optionally with licensing
   1853           1.1  christos information, then exit 0.  The optional argument specifies how much licensing
   1854  1.1.1.14.4.1  perseant detail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
   1855           1.1  christos Only the first letter of the argument is examined:
   1856      1.1.1.13  christos </p>
   1857      1.1.1.13  christos <dl compact="compact">
   1858      1.1.1.13  christos <dt>&lsquo;<samp>version</samp>&rsquo;</dt>
   1859      1.1.1.13  christos <dd><p>Only print the version.  This is the default.
   1860      1.1.1.13  christos </p></dd>
   1861      1.1.1.13  christos <dt>&lsquo;<samp>copyright</samp>&rsquo;</dt>
   1862      1.1.1.13  christos <dd><p>Name the copyright usage licensing terms.
   1863      1.1.1.13  christos </p></dd>
   1864      1.1.1.13  christos <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
   1865      1.1.1.13  christos <dd><p>Print the full copyright usage licensing terms.
   1866      1.1.1.13  christos </p></dd>
   1867           1.1  christos </dl>
   1868           1.1  christos 
   1869      1.1.1.13  christos <hr>
   1870  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-exit-status"></span><div class="header">
   1871      1.1.1.13  christos <p>
   1872      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-Usage" accesskey="n" rel="next">ntp-keygen Usage</a>, Previous: <a href="#ntp_002dkeygen-config" accesskey="p" rel="prev">ntp-keygen config</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1873           1.1  christos </div>
   1874  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-exit-status-1"></span><h4 class="subsection">1.2.23 ntp-keygen exit status</h4>
   1875           1.1  christos 
   1876           1.1  christos <p>One of the following exit values will be returned:
   1877      1.1.1.13  christos </p><dl compact="compact">
   1878      1.1.1.13  christos <dt>&lsquo;<samp>0 (EXIT_SUCCESS)</samp>&rsquo;</dt>
   1879      1.1.1.13  christos <dd><p>Successful program execution.
   1880      1.1.1.13  christos </p></dd>
   1881      1.1.1.13  christos <dt>&lsquo;<samp>1 (EXIT_FAILURE)</samp>&rsquo;</dt>
   1882      1.1.1.13  christos <dd><p>The operation failed or the command syntax was not valid.
   1883      1.1.1.13  christos </p></dd>
   1884      1.1.1.13  christos <dt>&lsquo;<samp>66 (EX_NOINPUT)</samp>&rsquo;</dt>
   1885      1.1.1.13  christos <dd><p>A specified configuration file could not be loaded.
   1886      1.1.1.13  christos </p></dd>
   1887      1.1.1.13  christos <dt>&lsquo;<samp>70 (EX_SOFTWARE)</samp>&rsquo;</dt>
   1888      1.1.1.13  christos <dd><p>libopts had an internal operational error.  Please report
   1889      1.1.1.13  christos it to autogen-users (a] lists.sourceforge.net.  Thank you.
   1890      1.1.1.13  christos </p></dd>
   1891           1.1  christos </dl>
   1892      1.1.1.13  christos <hr>
   1893  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Usage"></span><div class="header">
   1894      1.1.1.13  christos <p>
   1895      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-Notes" accesskey="n" rel="next">ntp-keygen Notes</a>, Previous: <a href="#ntp_002dkeygen-exit-status" accesskey="p" rel="prev">ntp-keygen exit status</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1896      1.1.1.13  christos </div>
   1897  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Usage-1"></span><h4 class="subsection">1.2.24 ntp-keygen Usage</h4>
   1898      1.1.1.13  christos <hr>
   1899  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Notes"></span><div class="header">
   1900      1.1.1.13  christos <p>
   1901      1.1.1.13  christos Next: <a href="#ntp_002dkeygen-Bugs" accesskey="n" rel="next">ntp-keygen Bugs</a>, Previous: <a href="#ntp_002dkeygen-Usage" accesskey="p" rel="prev">ntp-keygen Usage</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1902      1.1.1.13  christos </div>
   1903  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Notes-1"></span><h4 class="subsection">1.2.25 ntp-keygen Notes</h4>
   1904      1.1.1.13  christos <hr>
   1905  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Bugs"></span><div class="header">
   1906      1.1.1.13  christos <p>
   1907      1.1.1.13  christos Previous: <a href="#ntp_002dkeygen-Notes" accesskey="p" rel="prev">ntp-keygen Notes</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> &nbsp; </p>
   1908      1.1.1.13  christos </div>
   1909  1.1.1.14.4.1  perseant <span id="ntp_002dkeygen-Bugs-1"></span><h4 class="subsection">1.2.26 ntp-keygen Bugs</h4>
   1910      1.1.1.13  christos 
   1911      1.1.1.13  christos <hr>
   1912  1.1.1.14.4.1  perseant <span id="Random-Seed-File"></span><div class="header">
   1913      1.1.1.13  christos <p>
   1914      1.1.1.13  christos Next: <a href="#Cryptographic-Data-Files" accesskey="n" rel="next">Cryptographic Data Files</a>, Previous: <a href="#Running-the-Program" accesskey="p" rel="prev">Running the Program</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
   1915           1.1  christos </div>
   1916  1.1.1.14.4.1  perseant <span id="Random-Seed-File-2"></span><h3 class="section">1.3 Random Seed File</h3>
   1917           1.1  christos 
   1918           1.1  christos <p>All cryptographically sound key generation schemes must have means to
   1919           1.1  christos randomize the entropy seed used to initialize the internal
   1920      1.1.1.13  christos pseudo-random number generator used by the OpenSSL library routines.
   1921           1.1  christos If a site supports ssh, it is very likely that means to do this are
   1922      1.1.1.13  christos already available.
   1923           1.1  christos The entropy seed used by the OpenSSL library is contained in a file,
   1924           1.1  christos usually called <code>.rnd</code>, which must be available when
   1925           1.1  christos starting the <code>ntp-keygen</code> program or <code>ntpd</code> daemon.
   1926      1.1.1.13  christos </p>
   1927      1.1.1.13  christos <p>The OpenSSL library looks for the file using the path specified by the
   1928           1.1  christos <code>RANDFILE</code> environment variable in the user home directory, whether root
   1929      1.1.1.13  christos or some other user.
   1930           1.1  christos If the <code>RANDFILE</code> environment variable is not
   1931           1.1  christos present, the library looks for the <code>.rnd</code> file in the user home
   1932      1.1.1.13  christos directory.
   1933           1.1  christos Since both the <code>ntp-keygen</code> program and <code>ntpd</code> daemon must run
   1934           1.1  christos as root, the logical place to put this file is in <code>/.rnd</code> or
   1935      1.1.1.13  christos <code>/root/.rnd</code>.
   1936           1.1  christos If the file is not available or cannot be written, the program exits
   1937           1.1  christos with a message to the system log.
   1938      1.1.1.13  christos </p>
   1939      1.1.1.13  christos <hr>
   1940  1.1.1.14.4.1  perseant <span id="Cryptographic-Data-Files"></span><div class="header">
   1941      1.1.1.13  christos <p>
   1942      1.1.1.13  christos Previous: <a href="#Random-Seed-File" accesskey="p" rel="prev">Random Seed File</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
   1943           1.1  christos </div>
   1944  1.1.1.14.4.1  perseant <span id="Cryptographic-Data-Files-2"></span><h3 class="section">1.4 Cryptographic Data Files</h3>
   1945           1.1  christos 
   1946           1.1  christos <p>File and link names are in the <code>form ntpkey_key_name.fstamp</code>,
   1947           1.1  christos where <code>key</code> is the key or parameter type,
   1948           1.1  christos <code>name</code> is the host or group name and
   1949      1.1.1.13  christos <code>fstamp</code> is the filestamp (NTP seconds) when the file was created).
   1950           1.1  christos By convention, key names in generated file names include both upper and
   1951           1.1  christos lower case characters, while key names in generated link names include
   1952           1.1  christos only lower case characters. The filestamp is not used in generated link
   1953           1.1  christos names.
   1954      1.1.1.13  christos </p>
   1955      1.1.1.13  christos <p>The key name is a string defining the cryptographic key type.
   1956           1.1  christos Key types include public/private keys host and sign, certificate cert
   1957      1.1.1.13  christos and several challenge/response key types.
   1958           1.1  christos By convention, client files used for
   1959           1.1  christos challenges have a par subtype, as in the IFF challenge IFFpar, while
   1960           1.1  christos server files for responses have a key subtype, as in the GQ response
   1961           1.1  christos GQkey.
   1962      1.1.1.13  christos </p>
   1963      1.1.1.13  christos <p>All files begin with two nonencrypted lines. The first line contains
   1964      1.1.1.13  christos the file name in the format <code>ntpkey_key_host.fstamp</code>.
   1965      1.1.1.13  christos The second line contains the datestamp in conventional Unix date format.
   1966           1.1  christos Lines beginning with <code>#</code> are ignored.
   1967      1.1.1.13  christos </p>
   1968      1.1.1.13  christos <p>The remainder of the file contains cryptographic data encoded first
   1969           1.1  christos using ASN.1 rules, then encrypted using the DES-CBC algorithm with
   1970           1.1  christos given password and finally written in PEM-encoded printable ASCII text
   1971           1.1  christos preceded and followed by MIME content identifier lines.
   1972      1.1.1.13  christos </p>
   1973      1.1.1.13  christos <p>The format of the symmetric keys file, ordinarily named <code>ntp.keys</code>,
   1974           1.1  christos is somewhat different than the other files in the interest of backward
   1975      1.1.1.13  christos compatibility.
   1976           1.1  christos Ordinarily, the file is generated by this program, but
   1977           1.1  christos it can be constructed and edited using an ordinary text editor.
   1978      1.1.1.13  christos </p>
   1979      1.1.1.13  christos <div class="example">
   1980      1.1.1.13  christos <pre class="example"># ntpkey_MD5key_hms.local.3564038757
   1981      1.1.1.13  christos # Sun Dec  9 02:45:57 2012
   1982      1.1.1.13  christos 
   1983      1.1.1.13  christos  1 MD5 &quot;]!ghT%O;3)WJ,/Nc:&gt;I  # MD5 key
   1984      1.1.1.13  christos  2 MD5 lu+H^tF46BKR-6~pV_5  # MD5 key
   1985      1.1.1.13  christos  3 MD5 :lnoVsE%Yz*avh%EtNC  # MD5 key
   1986      1.1.1.13  christos  4 MD5 |fdZrf0sF~;w-i^V  # MD5 key
   1987      1.1.1.13  christos  5 MD5 IyAG&gt;O&quot;y&quot;LmCRS!*bHC  # MD5 key
   1988      1.1.1.13  christos  6 MD5 &quot;&gt;e\A&gt;hT/661ri52,,H  # MD5 key
   1989      1.1.1.13  christos  7 MD5 c9x=M'CfLxax9v)PV-si  # MD5 key
   1990      1.1.1.13  christos  8 MD5 E|=jvFVov?Bn|Ev=&amp;aK\  # MD5 key
   1991      1.1.1.13  christos  9 MD5 T!c4UT&amp;`(m$+m+B6,`Q0  # MD5 key
   1992      1.1.1.13  christos 10 MD5 JVF/1=)=IFbHbJQz..Cd  # MD5 key
   1993      1.1.1.13  christos 11 SHA1 6dea311109529e436c2b4fccae9bc753c16d1b48  # SHA1 key
   1994      1.1.1.13  christos 12 SHA1 7076f373d86c4848c59ff8046e49cb7d614ec394  # SHA1 key
   1995      1.1.1.13  christos 13 SHA1 5f48b1b60591eb01b7cf1d33b7774f08d20262d3  # SHA1 key
   1996      1.1.1.13  christos 14 SHA1 eed5ab9d9497319ec60cf3781d52607e76720178  # SHA1 key
   1997      1.1.1.13  christos 15 SHA1 f283562611a04c964da8126296f5f8e58c3f85de  # SHA1 key
   1998      1.1.1.13  christos 16 SHA1 1930da171297dd63549af50b29449de17dcf341f  # SHA1 key
   1999      1.1.1.13  christos 17 SHA1 fee892110358cd4382322b889869e750db8e8a8f  # SHA1 key
   2000      1.1.1.13  christos 18 SHA1 b5520c9fadd7ad3fd8bfa061c8821b65d029bb37  # SHA1 key
   2001      1.1.1.13  christos 19 SHA1 8c74fb440ec80f453ec6aaa62b9baed0ab723b92  # SHA1 key
   2002      1.1.1.13  christos 20 SHA1 6bc05f734306a189326000970c19b3910f403795  # SHA1 key
   2003      1.1.1.13  christos </pre></div>
   2004      1.1.1.13  christos 
   2005      1.1.1.13  christos <p>Figure 1. Typical Symmetric Key File
   2006      1.1.1.13  christos </p>
   2007      1.1.1.13  christos <p>Figure 1 shows a typical symmetric keys file used by the reference
   2008      1.1.1.13  christos implementation.
   2009           1.1  christos Each line of the file contains three fields, first an
   2010      1.1.1.12  christos integer between 1 and 65535, inclusive, representing the key identifier
   2011      1.1.1.13  christos used in the server and peer configuration commands.
   2012           1.1  christos Next is the key type for the message digest algorithm,
   2013           1.1  christos which in the absence of the
   2014           1.1  christos OpenSSL library must be MD5 to designate the MD5 message digest
   2015      1.1.1.13  christos algorithm.
   2016           1.1  christos If the OpenSSL library is installed, the key type can be any
   2017      1.1.1.13  christos message digest algorithm supported by that library.
   2018           1.1  christos However, if
   2019           1.1  christos compatibility with FIPS 140-2 is required, the key type must be either
   2020      1.1.1.13  christos SHA or SHA1.
   2021           1.1  christos The key type can be changed using an ASCII text editor.
   2022      1.1.1.13  christos </p>
   2023      1.1.1.13  christos <p>An MD5 key consists of a printable ASCII string less than or equal to
   2024      1.1.1.13  christos 16 characters and terminated by whitespace or a # character.
   2025           1.1  christos An OpenSSL
   2026           1.1  christos key consists of a hex-encoded ASCII string of 40 characters, which is
   2027           1.1  christos truncated as necessary.
   2028      1.1.1.13  christos </p>
   2029      1.1.1.13  christos <p>Note that the keys used by the <code>ntpq</code> and <code>ntpdc</code> programs are
   2030           1.1  christos checked against passwords requested by the programs and entered by hand,
   2031           1.1  christos so it
   2032           1.1  christos is generally appropriate to specify these keys in human readable ASCII
   2033           1.1  christos format.
   2034      1.1.1.13  christos </p>
   2035      1.1.1.13  christos <p>The <code>ntp-keygen</code> program generates a MD5 symmetric keys file
   2036      1.1.1.13  christos <code>ntpkey_MD5key_hostname.filestamp</code>.
   2037           1.1  christos Since the file contains private
   2038           1.1  christos shared keys, it should be visible only to root and distributed by
   2039      1.1.1.13  christos secure means to other subnet hosts.
   2040           1.1  christos The NTP daemon loads the file <code>ntp.keys</code>, so <code>ntp-keygen</code>
   2041      1.1.1.13  christos installs a soft link from this name to the generated file.
   2042           1.1  christos Subsequently, similar soft links must be installed by
   2043      1.1.1.13  christos manual or automated means on the other subnet hosts.
   2044           1.1  christos While this file is
   2045           1.1  christos not used with the Autokey Version 2 protocol, it is needed to
   2046           1.1  christos authenticate some remote configuration commands used by the <code>ntpq</code> and
   2047           1.1  christos <code>ntpdc</code> utilities.
   2048      1.1.1.13  christos </p><hr>
   2049      1.1.1.13  christos 
   2050           1.1  christos 
   2051           1.1  christos 
   2052      1.1.1.13  christos </body>
   2053      1.1.1.13  christos </html>
   2054