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