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; }
22 <h1 class="settitle">Ntp-keygen User's Manual</h1>
23 <div class="shortcontents">
24 <h2>Short Contents</h2>
26 <a href="#Top">Top</a>
27 <a href="#Top">NTP Key Generation Program User Manual</a>
35 <a name="Top"></a>Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
39 <h2 class="unnumbered">Top</h2>
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>
51 <a name="Top"></a>Next: <a rel="next" accesskey="n" href="#Description">Description</a>,
52 Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
53 Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
57 <h2 class="unnumbered">NTP Key Generation Program User Manual</h2>
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
73 <p>This document applies to version 4.2.8p11 of <code>ntp-keygen</code>.
77 <a name="Description"></a>Next: <a rel="next" accesskey="n" href="#Running-the-Program">Running the Program</a>,
78 Previous: <a rel="previous" accesskey="p" href="#Top">Top</a>,
79 Up: <a rel="up" accesskey="u" href="#Top">Top</a>
83 <!-- node-name, next, previous, up -->
84 <h3 class="section">Description</h3>
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
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.
100 OpenSSL library is installed, it produces an additional ten hex-encoded
101 random bit strings suitable for the SHA1 and other message digest
103 The message digest keys file must be distributed and stored
104 using secure means beyond the scope of NTP itself.
106 used for ordinary NTP associations, additional keys can be defined as
107 passwords for the ntpq and ntpdc utility programs.
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.
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.
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
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
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>.
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
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.
154 <a name="Running-the-Program"></a>Next: <a rel="next" accesskey="n" href="#Random-Seed-File">Random Seed File</a>,
155 Previous: <a rel="previous" accesskey="p" href="#Description">Description</a>,
156 Up: <a rel="up" accesskey="u" href="#Top">Top</a>
160 <!-- node-name, next, previous, up -->
161 <h3 class="section">Running the Program</h3>
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>.
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
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.
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.
184 <p>The host key is used to encrypt the cookie when required and so must be
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.
194 <p>The rules say cryptographic media should be generated with proventic
195 filestamps, which means the host should already be synchronized before
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.
205 <p>Additional information on trusted groups and identity schemes is on the
206 Autokey Public-Key Authentication page.
210 <a name="ntp_002dkeygen-Invocation"></a>
214 <h3 class="section">Invoking ntp-keygen</h3>
216 <p><a name="index-ntp_002dkeygen-1"></a><a name="index-Create-a-NTP-host-key-2"></a>
218 <p>This program generates cryptographic data files used by the NTPv4
219 authentication and identification schemes.
220 It can generate message digest keys used in symmetric key cryptography and,
221 if the OpenSSL software library has been installed, it can generate host keys,
222 signing keys, certificates, and identity keys and parameters used in Autokey
223 public key 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.
228 <p>The message digest symmetric keys file is generated in a format
229 compatible with NTPv3.
230 All other files are in PEM-encoded printable ASCII format,
231 so they can be embedded as MIME attachments in email to other sites
232 and certificate authorities.
233 By default, files are not encrypted.
235 <p>When used to generate message digest symmetric keys, the program
236 produces a file containing ten pseudo-random printable ASCII strings
237 suitable for the MD5 message digest algorithm included in the
239 If the OpenSSL library is installed, it produces an additional ten
240 hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
241 other message digest algorithms.
242 The message digest symmetric keys file must be distributed and stored
243 using secure means beyond the scope of NTP itself.
244 Besides the keys used for ordinary NTP associations, additional keys
245 can be defined as passwords for the
246 <code>ntpq(1ntpqmdoc)</code>
248 <code>ntpdc(1ntpdcmdoc)</code>
251 <p>The remaining generated files are compatible with other OpenSSL
252 applications and other Public Key Infrastructure (PKI) resources.
253 Certificates generated by this program are compatible with extant
254 industry practice, although some users might find the interpretation of
255 X509v3 extension fields somewhat liberal.
256 However, the identity keys are probably not compatible with anything
259 <p>Some files used by this program are encrypted using a private password.
262 option specifies the read password for local encrypted files and the
264 option the write password for encrypted files sent to remote sites.
265 If no password is specified, the host name returned by the Unix
266 <code>hostname(1)</code>
267 command, normally the DNS name of the host, is used as the the default read
268 password, for convenience.
270 <code>ntp-keygen</code>
271 program prompts for the password if it reads an encrypted file
272 and the password is missing or incorrect.
273 If an encrypted file is read successfully and
274 no write password is specified, the read password is used
275 as the write password by default.
281 <code>ntpd(1ntpdmdoc)</code>
282 configuration command specifies the read
283 password for previously encrypted local files.
284 This must match the local read password used by this program.
285 If not specified, the host name is used.
286 Thus, if files are generated by this program without an explicit password,
287 they can be read back by
288 <code>ntpd(1ntpdmdoc)</code>
289 without specifying an explicit password but only on the same host.
290 If the write password used for encryption is specified as the host name,
291 these files can be read by that host with no explicit password.
293 <p>Normally, encrypted files for each host are generated by that host and
294 used only by that host, although exceptions exist as noted later on
296 The symmetric keys file, normally called
297 <span class="file">ntp.keys</span>,
298 is usually installed in
299 <span class="file">/etc</span>.
300 Other files and links are usually installed in
301 <span class="file">/usr/local/etc</span>,
302 which is normally in a shared filesystem in
303 NFS-mounted networks and cannot be changed by shared clients.
304 In these cases, NFS clients can specify the files in another
306 <span class="file">/etc</span>
309 <code>ntpd(1ntpdmdoc)</code>
310 configuration file command.
312 <p>This program directs commentary and error messages to the standard
314 <span class="file">stderr</span>
315 and remote files to the standard output stream
316 <span class="file">stdout</span>
317 where they can be piped to other applications or redirected to files.
318 The names used for generated files and links all begin with the
320 <span class="file">ntpkey*</span>
321 and include the file type, generating host and filestamp,
323 <a href="#Cryptographic-Data-Files">Cryptographic Data Files</a>
326 <h5 class="subsubsection">Running the Program</h5>
328 <p>The safest way to run the
329 <code>ntp-keygen</code>
330 program is logged in directly as root.
331 The recommended procedure is change to the
334 <span class="file">/usr/local/etc</span>,
335 then run the program.
337 <p>To test and gain experience with Autokey concepts, log in as root and
341 <span class="file">/usr/local/etc</span>.
342 When run for the first time, or if all files with names beginning with
343 <span class="file">ntpkey*</span>
344 have been removed, use the
345 <code>ntp-keygen</code>
346 command without arguments to generate a default
348 host key and matching
350 certificate file with expiration date one year hence,
351 which is all that is necessary in many cases.
352 The program also generates soft links from the generic names
353 to the respective files.
354 If run again without options, the program uses the
355 existing keys and parameters and generates a new certificate file with
356 new expiration date one year hence, and soft link.
358 <p>The host key is used to encrypt the cookie when required and so must be
361 By default, the host key is also the sign key used to encrypt signatures.
362 When necessary, a different sign key can be specified and this can be
368 By default, the message digest type is
371 of sign key type and message digest type supported by the OpenSSL library
372 can be specified, including those using the
373 <code>AES128CMAC</code>, <code>MD2</code>, <code>MD5</code>, <code>MDC2</code>, <code>SHA</code>, <code>SHA1</code>
376 message digest algorithms.
377 However, the scheme specified in the certificate must be compatible
379 Certificates using any digest algorithm are compatible with
386 certificates are compatible with
390 <p>Private/public key files and certificates are compatible with
391 other OpenSSL applications and very likely other libraries as well.
392 Certificates or certificate requests derived from them should be compatible
393 with extant industry practice, although some users might find
394 the interpretation of X509v3 extension fields somewhat liberal.
395 However, the identification parameter files, although encoded
396 as the other files, are probably not compatible with anything other than Autokey.
398 <p>Running the program as other than root and using the Unix
401 to assume root may not work properly, since by default the OpenSSL library
402 looks for the random seed file
403 <span class="file">.rnd</span>
404 in the user home directory.
405 However, there should be only one
406 <span class="file">.rnd</span>,
408 in the root directory, so it is convenient to define the
410 environment variable used by the OpenSSL library as the path to
411 <span class="file">.rnd</span>.
413 <p>Installing the keys as root might not work in NFS-mounted
414 shared file systems, as NFS clients may not be able to write
415 to the shared keys directory, even as root.
416 In this case, NFS clients can specify the files in another
418 <span class="file">/etc</span>
421 <code>ntpd(1ntpdmdoc)</code>
422 configuration file command.
423 There is no need for one client to read the keys and certificates
424 of other clients or servers, as these data are obtained automatically
425 by the Autokey protocol.
427 <p>Ordinarily, cryptographic files are generated by the host that uses them,
428 but it is possible for a trusted agent (TA) to generate these files
429 for other hosts; however, in such cases files should always be encrypted.
430 The subject name and trusted name default to the hostname
431 of the host generating the files, but can be changed by command line options.
432 It is convenient to designate the owner name and trusted name
433 as the subject and issuer fields, respectively, of the certificate.
434 The owner name is also used for the host and sign key files,
435 while the trusted name is used for the identity files.
437 <p>All files are installed by default in the keys directory
438 <span class="file">/usr/local/etc</span>,
439 which is normally in a shared filesystem
440 in NFS-mounted networks.
441 The actual location of the keys directory
442 and each file can be overridden by configuration commands,
443 but this is not recommended.
444 Normally, the files for each host are generated by that host
445 and used only by that host, although exceptions exist
446 as noted later on this page.
448 <p>Normally, files containing private values,
449 including the host key, sign key and identification parameters,
450 are permitted root read/write-only;
451 while others containing public values are permitted world readable.
452 Alternatively, files containing private values can be encrypted
453 and these files permitted world readable,
454 which simplifies maintenance in shared file systems.
455 Since uniqueness is insured by the
459 file name extensions, the files for an NTP server and
460 dependent clients can all be installed in the same shared directory.
462 <p>The recommended practice is to keep the file name extensions
463 when installing a file and to install a soft link
464 from the generic names specified elsewhere on this page
465 to the generated files.
466 This allows new file generations to be activated simply
467 by changing the link.
468 If a link is present,
469 <code>ntpd(1ntpdmdoc)</code>
470 follows it to the file name to extract the
471 <kbd>filestamp</kbd>.
472 If a link is not present,
473 <code>ntpd(1ntpdmdoc)</code>
476 from the file itself.
477 This allows clients to verify that the file and generation times
480 <code>ntp-keygen</code>
481 program uses the same
483 extension for all files generated
484 at one time, so each generation is distinct and can be readily
485 recognized in monitoring data.
487 <p>Run the command on as many hosts as necessary.
488 Designate one of them as the trusted host (TH) using
489 <code>ntp-keygen</code>
492 option and configure it to synchronize from reliable Internet servers.
493 Then configure the other hosts to synchronize to the TH directly or
495 A certificate trail is created when Autokey asks the immediately
496 ascendant host towards the TH to sign its certificate, which is then
497 provided to the immediately descendant host on request.
498 All group hosts should have acyclic certificate trails ending on the TH.
500 <p>The host key is used to encrypt the cookie when required and so must be
502 By default, the host key is also the sign key used to encrypt
504 A different sign key can be assigned using the
506 option and this can be either
511 By default, the signature
512 message digest type is
514 but any combination of sign key type and
515 message digest type supported by the OpenSSL library can be specified
520 <p>The rules say cryptographic media should be generated with proventic
521 filestamps, which means the host should already be synchronized before
523 This of course creates a chicken-and-egg problem
524 when the host is started for the first time.
525 Accordingly, the host time
526 should be set by some other means, such as eyeball-and-wristwatch, at
527 least so that the certificate lifetime is within the current year.
528 After that and when the host is synchronized to a proventic source, the
529 certificate should be re-generated.
531 <p>Additional information on trusted groups and identity schemes is on the
532 Autokey Public-Key Authentication
535 <p>File names begin with the prefix
536 <span class="file">ntpkey</span>_
537 and end with the suffix
538 <span class="file">_</span><kbd>hostname</kbd>. <kbd>filestamp</kbd>,
541 is the owner name, usually the string returned
543 <code>hostname(1)</code>
546 is the NTP seconds when the file was generated, in decimal digits.
547 This both guarantees uniqueness and simplifies maintenance
548 procedures, since all files can be quickly removed
550 <code>rm</code> <span class="file">ntpkey*</span>
551 command or all files generated
552 at a specific time can be removed by a
553 <code>rm</code> <span class="file">*</span><kbd>filestamp</kbd>
555 To further reduce the risk of misconfiguration,
556 the first two lines of a file contain the file name
557 and generation date and time as comments.
559 <h5 class="subsubsection">Trusted Hosts and Groups</h5>
561 <p>Each cryptographic configuration involves selection of a signature scheme
562 and identification scheme, called a cryptotype,
564 <a href="#Authentication-Options">Authentication Options</a>
566 <code>ntp.conf(5)</code>.
567 The default cryptotype uses
575 First, configure a NTP subnet including one or more low-stratum
576 trusted hosts from which all other hosts derive synchronization
577 directly or indirectly.
578 Trusted hosts have trusted certificates;
579 all other hosts have nontrusted certificates.
580 These hosts will automatically and dynamically build authoritative
581 certificate trails to one or more trusted hosts.
582 A trusted group is the set of all hosts that have, directly or indirectly,
583 a certificate trail ending at a trusted host.
584 The trail is defined by static configuration file entries
585 or dynamic means described on the
586 <a href="#Automatic-NTP-Configuration-Options">Automatic NTP Configuration Options</a>
588 <code>ntp.conf(5)</code>.
590 <p>On each trusted host as root, change to the keys directory.
591 To insure a fresh fileset, remove all
592 <span class="file">ntpkey</span>
595 <code>ntp-keygen</code>
597 to generate keys and a trusted certificate.
598 On all other hosts do the same, but leave off the
600 flag to generate keys and nontrusted certificates.
601 When complete, start the NTP daemons beginning at the lowest stratum
602 and working up the tree.
603 It may take some time for Autokey to instantiate the certificate trails
604 throughout the subnet, but setting up the environment is completely automatic.
606 <p>If it is necessary to use a different sign key or different digest/signature
607 scheme than the default, run
608 <code>ntp-keygen</code>
610 <code>-S</code> <kbd>type</kbd>
617 The most frequent need to do this is when a
618 <code>DSA</code>-signed
620 If it is necessary to use a different certificate scheme than the default,
622 <code>ntp-keygen</code>
624 <code>-c</code> <kbd>scheme</kbd>
629 <code>ntp-keygen</code>
630 is run again without these options, it generates a new certificate
631 using the same scheme and sign key, and soft link.
633 <p>After setting up the environment it is advisable to update certificates
634 from time to time, if only to extend the validity interval.
636 <code>ntp-keygen</code>
637 with the same flags as before to generate new certificates
638 using existing keys, and soft links.
639 However, if the host or sign key is changed,
640 <code>ntpd(1ntpdmdoc)</code>
643 <code>ntpd(1ntpdmdoc)</code>
644 is restarted, it loads any new files and restarts the protocol.
645 Other dependent hosts will continue as usual until signatures are refreshed,
646 at which time the protocol is restarted.
648 <h5 class="subsubsection">Identity Schemes</h5>
650 <p>As mentioned on the Autonomous Authentication page,
653 identity scheme is vulnerable to a middleman attack.
654 However, there are more secure identity schemes available,
656 <code>PC</code>, <code>IFF</code>, <code>GQ</code>
659 schemes described below.
660 These schemes are based on a TA, one or more trusted hosts
661 and some number of nontrusted hosts.
662 Trusted hosts prove identity using values provided by the TA,
663 while the remaining hosts prove identity using values provided
664 by a trusted host and certificate trails that end on that host.
665 The name of a trusted host is also the name of its sugroup
666 and also the subject and issuer name on its trusted certificate.
667 The TA is not necessarily a trusted host in this sense, but often is.
669 <p>In some schemes there are separate keys for servers and clients.
670 A server can also be a client of another server,
671 but a client can never be a server for another client.
672 In general, trusted hosts and nontrusted hosts that operate
673 as both server and client have parameter files that contain
674 both server and client keys.
676 only as clients have key files that contain only client keys.
678 <p>The PC scheme supports only one trusted host in the group.
679 On trusted host alice run
680 <code>ntp-keygen</code>
682 <code>-p</code> <kbd>password</kbd>
683 to generate the host key file
684 <span class="file">ntpkey</span>_ <code>RSA</code> <span class="file">key_alice.</span> <kbd>filestamp</kbd>
685 and trusted private certificate file
686 <span class="file">ntpkey</span>_ <code>RSA-MD5</code> <code>_</code> <span class="file">cert_alice.</span> <kbd>filestamp</kbd>,
688 Copy both files to all group hosts;
689 they replace the files which would be generated in other schemes.
692 install a soft link from the generic name
693 <span class="file">ntpkey_host_</span><kbd>bob</kbd>
694 to the host key file and soft link
695 <span class="file">ntpkey_cert_</span><kbd>bob</kbd>
696 to the private certificate file.
697 Note the generic links are on bob, but point to files generated
698 by trusted host alice.
699 In this scheme it is not possible to refresh
700 either the keys or certificates without copying them
701 to all other hosts in the group, and recreating the soft links.
705 scheme proceed as in the
707 scheme to generate keys
708 and certificates for all group hosts, then for every trusted host in the group,
712 On trusted host alice run
713 <code>ntp-keygen</code>
716 <code>-p</code> <kbd>password</kbd>
717 to produce her parameter file
718 <span class="file">ntpkey_IFFpar_alice.</span><kbd>filestamp</kbd>,
719 which includes both server and client keys.
720 Copy this file to all group hosts that operate as both servers
721 and clients and install a soft link from the generic
722 <span class="file">ntpkey_iff_alice</span>
724 If there are no hosts restricted to operate only as clients,
725 there is nothing further to do.
728 scheme is independent
729 of keys and certificates, these files can be refreshed as needed.
731 <p>If a rogue client has the parameter file, it could masquerade
732 as a legitimate server and present a middleman threat.
733 To eliminate this threat, the client keys can be extracted
734 from the parameter file and distributed to all restricted clients.
735 After generating the parameter file, on alice run
736 <code>ntp-keygen</code>
738 and pipe the output to a file or email program.
739 Copy or email this file to all restricted clients.
740 On these clients install a soft link from the generic
741 <span class="file">ntpkey_iff_alice</span>
743 To further protect the integrity of the keys,
744 each file can be encrypted with a secret password.
748 scheme proceed as in the
750 scheme to generate keys
751 and certificates for all group hosts, then for every trusted host
752 in the group, generate the
755 On trusted host alice run
756 <code>ntp-keygen</code>
759 <code>-p</code> <kbd>password</kbd>
760 to produce her parameter file
761 <span class="file">ntpkey_GQpar_alice.</span><kbd>filestamp</kbd>,
762 which includes both server and client keys.
763 Copy this file to all group hosts and install a soft link
765 <span class="file">ntpkey_gq_alice</span>
767 In addition, on each host
771 <span class="file">ntpkey_gq_</span><kbd>bob</kbd>
777 parameters file and certificate
778 at the same time, keys and certificates can be regenerated as needed.
782 scheme, proceed as in the
784 scheme to generate keys
785 and certificates for all group hosts.
786 For illustration assume trish is the TA, alice one of several trusted hosts
787 and bob one of her clients.
789 <code>ntp-keygen</code>
790 <code>-V</code> <kbd>n</kbd>
791 <code>-p</code> <kbd>password</kbd>,
794 is the number of revokable keys (typically 5) to produce
796 <span class="file">ntpkeys_MVpar_trish.</span><kbd>filestamp</kbd>
798 <span class="file">ntpkeys_MVkey</span><kbd>d</kbd> <kbd>_</kbd> <span class="file">trish.</span> <kbd>filestamp</kbd>
801 is the key number (0 <
805 Copy the parameter file to alice and install a soft link
807 <span class="file">ntpkey_mv_alice</span>
809 Copy one of the client key files to alice for later distribution
811 It does not matter which client key file goes to alice,
812 since they all work the same way.
813 Alice copies the client key file to all of her clients.
814 On client bob install a soft link from generic
815 <span class="file">ntpkey_mvkey_bob</span>
816 to the client key file.
819 scheme is independent of keys and certificates,
820 these files can be refreshed as needed.
822 <h5 class="subsubsection">Command Line Options</h5>
825 <dt><code>-b</code> <code>--imbits</code>= <kbd>modulus</kbd><dd>Set the number of bits in the identity modulus for generating identity keys to
828 The number of bits in the identity modulus defaults to 256, but can be set to
829 values from 256 to 2048 (32 to 256 octets).
830 Use the larger moduli with caution, as this can consume considerable computing
831 resources and increases the size of authenticated packets.
832 <br><dt><code>-c</code> <code>--certificate</code>= <kbd>scheme</kbd><dd>Select certificate signature encryption/message digest scheme.
835 can be one of the following:
836 <code>RSA-MD2</code>, <code>RSA-MD5</code>, <code>RSA-MDC2</code>, <code>RSA-SHA</code>, <code>RSA-SHA1</code>, <code>RSA-RIPEMD160</code>, <code>DSA-SHA</code>,
838 <code>DSA-SHA1</code>.
841 schemes must be used with an
845 schemes must be used with a
848 The default without this option is
849 <code>RSA-MD5</code>.
850 If compatibility with FIPS 140-2 is required, either the
853 <code>DSA-SHA1</code>
855 <br><dt><code>-C</code> <code>--cipher</code>= <kbd>cipher</kbd><dd>Select the OpenSSL cipher to encrypt the files containing private keys.
856 The default without this option is three-key triple DES in CBC mode,
857 <code>des-ede3-cbc</code>.
859 <code>openssl</code> <code>-h</code>
860 command provided with OpenSSL displays available ciphers.
861 <br><dt><code>-d</code> <code>--debug-level</code><dd>Increase debugging verbosity level.
862 This option displays the cryptographic data produced in eye-friendly billboards.
863 <br><dt><code>-D</code> <code>--set-debug-level</code>= <kbd>level</kbd><dd>Set the debugging verbosity to
865 This option displays the cryptographic data produced in eye-friendly billboards.
866 <br><dt><code>-e</code> <code>--id-key</code><dd>Write the
870 public parameters from the
871 <kbd>IFFkey</kbd> <kbd>or</kbd> <kbd>GQkey</kbd>
872 client keys file previously specified
873 as unencrypted data to the standard output stream
874 <span class="file">stdout</span>.
875 This is intended for automatic key distribution by email.
876 <br><dt><code>-G</code> <code>--gq-params</code><dd>Generate a new encrypted
878 parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
879 This option is mutually exclusive with the
884 <br><dt><code>-H</code> <code>--host-key</code><dd>Generate a new encrypted
886 public/private host key file.
887 <br><dt><code>-I</code> <code>--iffkey</code><dd>Generate a new encrypted
889 key file for the Schnorr (IFF) identity scheme.
890 This option is mutually exclusive with the
895 <br><dt><code>-i</code> <code>--ident</code>= <kbd>group</kbd><dd>Set the optional Autokey group name to
897 This is used in the identity scheme parameter file names of
898 <code>IFF</code>, <code>GQ</code>,
901 client parameters files.
902 In that role, the default is the host name if no group is provided.
903 The group name, if specified using
909 character, is also used in certificate subject and issuer names in the form
910 <kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
911 and should match the group specified via
912 <code>crypto</code> <code>ident</code>
914 <code>server</code> <code>ident</code>
915 in the ntpd configuration file.
916 <br><dt><code>-l</code> <code>--lifetime</code>= <kbd>days</kbd><dd>Set the lifetime for certificate expiration to
918 The default lifetime is one year (365 days).
919 <br><dt><code>-m</code> <code>--modulus</code>= <kbd>bits</kbd><dd>Set the number of bits in the prime modulus for generating files to
921 The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
922 Use the larger moduli with caution, as this can consume considerable computing
923 resources and increases the size of authenticated packets.
924 <br><dt><code>-M</code> <code>--md5key</code><dd>Generate a new symmetric keys file containing 10
926 keys, and if OpenSSL is available, 10
931 key is a string of 20 random printable ASCII characters, while a
933 key is a string of 40 random hex digits.
934 The file can be edited using a text editor to change the key type or key content.
935 This option is mutually exclusive with all other options.
936 <br><dt><code>-p</code> <code>--password</code>= <kbd>passwd</kbd><dd>Set the password for reading and writing encrypted files to
938 These include the host, sign and identify key files.
939 By default, the password is the string returned by the Unix
940 <code>hostname</code>
942 <br><dt><code>-P</code> <code>--pvt-cert</code><dd>Generate a new private certificate used by the
945 By default, the program generates public certificates.
946 Note: the PC identity scheme is not recommended for new installations.
947 <br><dt><code>-q</code> <code>--export-passwd</code>= <kbd>passwd</kbd><dd>Set the password for writing encrypted
948 <code>IFF</code>, <code>GQ</code> <code>and</code> <code>MV</code>
949 identity files redirected to
950 <span class="file">stdout</span>
953 In effect, these files are decrypted with the
955 password, then encrypted with the
958 By default, the password is the string returned by the Unix
959 <code>hostname</code>
961 <br><dt><code>-s</code> <code>--subject-key</code>= <code>[host]</code> <code>[@ </code><kbd>group</kbd><code>]</code><dd>Specify the Autokey host name, where
963 is the optional host name and
965 is the optional group name.
966 The host name, and if provided, group name are used in
967 <kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
968 form as certificate subject and issuer.
970 <code>-s</code> <code>-@</code> <kbd>group</kbd>
971 is allowed, and results in leaving the host name unchanged, as with
972 <code>-i</code> <kbd>group</kbd>.
973 The group name, or if no group is provided, the host name are also used in the
975 <code>IFF</code>, <code>GQ</code>,
978 identity scheme client parameter files.
981 is not specified, the default host name is the string returned by the Unix
982 <code>hostname</code>
984 <br><dt><code>-S</code> <code>--sign-key</code>= <code>[RSA | DSA]</code><dd>Generate a new encrypted public/private sign key file of the specified type.
985 By default, the sign key is the host key and has the same type.
986 If compatibility with FIPS 140-2 is required, the sign key type must be
988 <br><dt><code>-T</code> <code>--trusted-cert</code><dd>Generate a trusted certificate.
989 By default, the program generates a non-trusted certificate.
990 <br><dt><code>-V</code> <code>--mv-params</code> <kbd>nkeys</kbd><dd>Generate
992 encrypted server keys and parameters for the Mu-Varadharajan (MV)
994 This option is mutually exclusive with the
999 Note: support for this option should be considered a work in progress.
1002 <h5 class="subsubsection">Random Seed File</h5>
1004 <p>All cryptographically sound key generation schemes must have means
1005 to randomize the entropy seed used to initialize
1006 the internal pseudo-random number generator used
1007 by the library routines.
1008 The OpenSSL library uses a designated random seed file for this purpose.
1009 The file must be available when starting the NTP daemon and
1010 <code>ntp-keygen</code>
1012 If a site supports OpenSSL or its companion OpenSSH,
1013 it is very likely that means to do this are already available.
1015 <p>It is important to understand that entropy must be evolved
1016 for each generation, for otherwise the random number sequence
1017 would be predictable.
1018 Various means dependent on external events, such as keystroke intervals,
1019 can be used to do this and some systems have built-in entropy sources.
1020 Suitable means are described in the OpenSSL software documentation,
1021 but are outside the scope of this page.
1023 <p>The entropy seed used by the OpenSSL library is contained in a file,
1025 <span class="file">.rnd</span>,
1026 which must be available when starting the NTP daemon
1028 <code>ntp-keygen</code>
1030 The NTP daemon will first look for the file
1031 using the path specified by the
1032 <code>randfile</code>
1035 configuration command.
1036 If not specified in this way, or when starting the
1037 <code>ntp-keygen</code>
1039 the OpenSSL library will look for the file using the path specified
1042 environment variable in the user home directory,
1043 whether root or some other user.
1046 environment variable is not present,
1047 the library will look for the
1048 <span class="file">.rnd</span>
1049 file in the user home directory.
1051 <code>ntp-keygen</code>
1053 <code>ntpd(1ntpdmdoc)</code>
1054 daemon must run as root, the logical place to put this file is in
1055 <span class="file">/.rnd</span>
1057 <span class="file">/root/.rnd</span>.
1058 If the file is not available or cannot be written,
1059 the daemon exits with a message to the system log and the program
1060 exits with a suitable error message.
1062 <h5 class="subsubsection">Cryptographic Data Files</h5>
1064 <p>All file formats begin with two nonencrypted lines.
1065 The first line contains the file name, including the generated host name
1066 and filestamp, in the format
1067 <span class="file">ntpkey_</span><kbd>key</kbd> <kbd>_</kbd> <kbd>name</kbd>. <kbd>filestamp</kbd>,
1070 is the key or parameter type,
1072 is the host or group name and
1073 <kbd>filestamp</kbd>
1074 is the filestamp (NTP seconds) when the file was created.
1077 names in generated file names include both upper and lower case
1080 names in generated link names include only lower case characters.
1081 The filestamp is not used in generated link names.
1082 The second line contains the datestamp in conventional Unix
1083 <span class="file">date</span>
1085 Lines beginning with
1087 are considered comments and ignored by the
1088 <code>ntp-keygen</code>
1090 <code>ntpd(1ntpdmdoc)</code>
1093 <p>The remainder of the file contains cryptographic data, encoded first using ASN.1
1094 rules, then encrypted if necessary, and finally written in PEM-encoded
1095 printable ASCII text, preceded and followed by MIME content identifier lines.
1097 <p>The format of the symmetric keys file, ordinarily named
1098 <span class="file">ntp.keys</span>,
1099 is somewhat different than the other files in the interest of backward compatibility.
1100 Ordinarily, the file is generated by this program, but it can be constructed
1101 and edited using an ordinary text editor.
1102 <pre class="verbatim">
1103 # ntpkey_MD5key_bk.ntp.org.3595864945
1104 # Thu Dec 12 19:22:25 2013
1106 1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
1107 2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
1108 3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
1109 4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
1110 5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
1111 6 MD5 4eYwa\`o@}3i@@@@V@@..R9!l # MD5 key
1112 7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
1113 8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
1114 9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
1115 10 MD5 2late4Me # MD5 key
1116 11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
1117 12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
1118 13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
1119 14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
1120 15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
1121 16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
1122 17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
1123 18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
1124 19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
1125 20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
1127 <pre class="example"> Figure 1. Typical Symmetric Key File
1129 <p>Figure 1 shows a typical symmetric keys file used by the reference
1131 Following the header the keys are entered one per line in the format
1132 <pre class="example"> <kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
1136 is a positive integer in the range 1-65534;
1138 is the key type for the message digest algorithm, which in the absence of the
1139 OpenSSL library must be
1141 to designate the MD5 message digest algorithm;
1142 if the OpenSSL library is installed, the key type can be any
1143 message digest algorithm supported by that library;
1144 however, if compatibility with FIPS 140-2 is required,
1145 the key type must be either
1151 which is a printable ASCII string 20 characters or less in length:
1152 each character is chosen from the 93 printable characters
1153 in the range 0x21 through 0x7e (
1157 ) excluding space and the
1159 character, and terminated by whitespace or a
1162 An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
1163 is truncated as necessary.
1165 <p>Note that the keys used by the
1166 <code>ntpq(1ntpqmdoc)</code>
1168 <code>ntpdc(1ntpdcmdoc)</code>
1170 are checked against passwords requested by the programs
1171 and entered by hand, so it is generally appropriate to specify these keys
1172 in human readable ASCII format.
1175 <code>ntp-keygen</code>
1176 program generates a symmetric keys file
1177 <span class="file">ntpkey_MD5key_</span><kbd>hostname</kbd>. <kbd>filestamp</kbd>.
1178 Since the file contains private shared keys,
1179 it should be visible only to root and distributed by secure means
1180 to other subnet hosts.
1181 The NTP daemon loads the file
1182 <span class="file">ntp.keys</span>,
1184 <code>ntp-keygen</code>
1185 installs a soft link from this name to the generated file.
1186 Subsequently, similar soft links must be installed by manual
1187 or automated means on the other subnet hosts.
1188 While this file is not used with the Autokey Version 2 protocol,
1189 it is needed to authenticate some remote configuration commands
1191 <code>ntpq(1ntpqmdoc)</code>
1193 <code>ntpdc(1ntpdcmdoc)</code>
1196 <p>This section was generated by <strong>AutoGen</strong>,
1197 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-keygen</code> program.
1198 This software is released under the NTP license, <http://ntp.org/license>.
1201 <li><a accesskey="1" href="#ntp_002dkeygen-usage">ntp-keygen usage</a>: ntp-keygen help/usage (<span class="option">--help</span>)
1202 <li><a accesskey="2" href="#ntp_002dkeygen-imbits">ntp-keygen imbits</a>: imbits option (-b)
1203 <li><a accesskey="3" href="#ntp_002dkeygen-certificate">ntp-keygen certificate</a>: certificate option (-c)
1204 <li><a accesskey="4" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>: cipher option (-C)
1205 <li><a accesskey="5" href="#ntp_002dkeygen-id_002dkey">ntp-keygen id-key</a>: id-key option (-e)
1206 <li><a accesskey="6" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>: gq-params option (-G)
1207 <li><a accesskey="7" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>: host-key option (-H)
1208 <li><a accesskey="8" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>: iffkey option (-I)
1209 <li><a accesskey="9" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>: ident option (-i)
1210 <li><a href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>: lifetime option (-l)
1211 <li><a href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>: modulus option (-m)
1212 <li><a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>: md5key option (-M)
1213 <li><a href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>: pvt-cert option (-P)
1214 <li><a href="#ntp_002dkeygen-password">ntp-keygen password</a>: password option (-p)
1215 <li><a href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>: export-passwd option (-q)
1216 <li><a href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>: subject-name option (-s)
1217 <li><a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>: sign-key option (-S)
1218 <li><a href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>: trusted-cert option (-T)
1219 <li><a href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>: mv-params option (-V)
1220 <li><a href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>: mv-keys option (-v)
1221 <li><a href="#ntp_002dkeygen-config">ntp-keygen config</a>: presetting/configuring ntp-keygen
1222 <li><a href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>: exit status
1223 <li><a href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>: Usage
1224 <li><a href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>: Notes
1225 <li><a href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a>: Bugs
1230 <a name="ntp_002dkeygen-usage"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-imbits">ntp-keygen imbits</a>,
1231 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1235 <h4 class="subsection">ntp-keygen help/usage (<span class="option">--help</span>)</h4>
1237 <p><a name="index-ntp_002dkeygen-help-3"></a>
1238 This is the automatically generated usage text for ntp-keygen.
1240 <p>The text printed is the same whether selected with the <code>help</code> option
1241 (<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>). <code>more-help</code> will print
1242 the usage text by passing it through a pager program.
1243 <code>more-help</code> is disabled on platforms without a working
1244 <code>fork(2)</code> function. The <code>PAGER</code> environment variable is
1245 used to select the program, defaulting to <span class="file">more</span>. Both will exit
1246 with a status code of 0.
1248 <pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p10
1249 Usage: ntp-keygen [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
1250 Flg Arg Option-Name Description
1251 -b Num imbits identity modulus bits
1252 - it must be in the range:
1254 -c Str certificate certificate scheme
1255 -C Str cipher privatekey cipher
1256 -d no debug-level Increase debug verbosity level
1257 - may appear multiple times
1258 -D Num set-debug-level Set the debug verbosity level
1259 - may appear multiple times
1260 -e no id-key Write IFF or GQ identity keys
1261 -G no gq-params Generate GQ parameters and keys
1262 -H no host-key generate RSA host key
1263 -I no iffkey generate IFF parameters
1264 -i Str ident set Autokey group name
1265 -l Num lifetime set certificate lifetime
1266 -m Num modulus prime modulus
1267 - it must be in the range:
1269 -M no md5key generate symmetric keys
1270 -P no pvt-cert generate PC private certificate
1271 -p Str password local private password
1272 -q Str export-passwd export IFF or GQ group keys with password
1273 -s Str subject-name set host and optionally group name
1274 -S Str sign-key generate sign key (RSA or DSA)
1275 -T no trusted-cert trusted certificate (TC scheme)
1276 -V Num mv-params generate <num> MV parameters
1277 -v Num mv-keys update <num> MV keys
1278 opt version output version information and exit
1279 -? no help display extended usage information and exit
1280 -! no more-help extended usage information passed thru pager
1281 -> opt save-opts save the option state to a config file
1282 -< Str load-opts load options from a config file
1283 - disabled as '--no-load-opts'
1284 - may appear multiple times
1286 Options are specified by doubled hyphens and their name or by a single
1287 hyphen and the flag character.
1290 The following option preset mechanisms are supported:
1291 - reading file $HOME/.ntprc
1292 - reading file ./.ntprc
1293 - examining environment variables named NTP_KEYGEN_*
1295 Please send bug reports to: <http://bugs.ntp.org, bugs@ntp.org>
1299 <a name="ntp_002dkeygen-imbits"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-certificate">ntp-keygen certificate</a>,
1300 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-usage">ntp-keygen usage</a>,
1301 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1305 <h4 class="subsection">imbits option (-b)</h4>
1307 <p><a name="index-ntp_002dkeygen_002dimbits-4"></a>
1308 This is the “identity modulus bits” option.
1309 This option takes a number argument <span class="file">imbits</span>.
1311 <p class="noindent">This option has some usage constraints. It:
1313 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1316 <p>The number of bits in the identity modulus. The default is 256.
1319 <a name="ntp_002dkeygen-certificate"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>,
1320 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-imbits">ntp-keygen imbits</a>,
1321 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1325 <h4 class="subsection">certificate option (-c)</h4>
1327 <p><a name="index-ntp_002dkeygen_002dcertificate-5"></a>
1328 This is the “certificate scheme” option.
1329 This option takes a string argument <span class="file">scheme</span>.
1331 <p class="noindent">This option has some usage constraints. It:
1333 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1337 RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
1338 DSA-SHA, or DSA-SHA1.
1340 <p>Select the certificate signature encryption/message digest scheme.
1341 Note that RSA schemes must be used with a RSA sign key and DSA
1342 schemes must be used with a DSA sign key. The default without
1343 this option is RSA-MD5.
1346 <a name="ntp_002dkeygen-cipher"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-id_002dkey">ntp-keygen id-key</a>,
1347 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-certificate">ntp-keygen certificate</a>,
1348 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1352 <h4 class="subsection">cipher option (-C)</h4>
1354 <p><a name="index-ntp_002dkeygen_002dcipher-6"></a>
1355 This is the “privatekey cipher” option.
1356 This option takes a string argument <span class="file">cipher</span>.
1358 <p class="noindent">This option has some usage constraints. It:
1360 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1363 <p>Select the cipher which is used to encrypt the files containing
1364 private keys. The default is three-key triple DES in CBC mode,
1365 equivalent to "<code>-C des-ede3-cbc</code>". The openssl tool lists ciphers
1366 available in "<code>openssl -h</code>" output.
1369 <a name="ntp_002dkeygen-id_002dkey"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>,
1370 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-cipher">ntp-keygen cipher</a>,
1371 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1375 <h4 class="subsection">id-key option (-e)</h4>
1377 <p><a name="index-ntp_002dkeygen_002did_002dkey-7"></a>
1378 This is the “write iff or gq identity keys” option.
1380 <p class="noindent">This option has some usage constraints. It:
1382 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1385 <p>Write the public parameters from the IFF or GQ client keys to
1386 the standard output.
1387 This is intended for automatic key distribution by email.
1390 <a name="ntp_002dkeygen-gq_002dparams"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>,
1391 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-id_002dkey">ntp-keygen id-key</a>,
1392 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1396 <h4 class="subsection">gq-params option (-G)</h4>
1398 <p><a name="index-ntp_002dkeygen_002dgq_002dparams-8"></a>
1399 This is the “generate gq parameters and keys” option.
1401 <p class="noindent">This option has some usage constraints. It:
1403 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1406 <p>Generate parameters and keys for the GQ identification scheme,
1407 obsoleting any that may exist.
1410 <a name="ntp_002dkeygen-host_002dkey"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>,
1411 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-gq_002dparams">ntp-keygen gq-params</a>,
1412 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1416 <h4 class="subsection">host-key option (-H)</h4>
1418 <p><a name="index-ntp_002dkeygen_002dhost_002dkey-9"></a>
1419 This is the “generate rsa host key” option.
1421 <p class="noindent">This option has some usage constraints. It:
1423 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1426 <p>Generate new host keys, obsoleting any that may exist.
1429 <a name="ntp_002dkeygen-iffkey"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>,
1430 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-host_002dkey">ntp-keygen host-key</a>,
1431 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1435 <h4 class="subsection">iffkey option (-I)</h4>
1437 <p><a name="index-ntp_002dkeygen_002diffkey-10"></a>
1438 This is the “generate iff parameters” option.
1440 <p class="noindent">This option has some usage constraints. It:
1442 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1445 <p>Generate parameters for the IFF identification scheme, obsoleting
1449 <a name="ntp_002dkeygen-ident"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>,
1450 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-iffkey">ntp-keygen iffkey</a>,
1451 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1455 <h4 class="subsection">ident option (-i)</h4>
1457 <p><a name="index-ntp_002dkeygen_002dident-11"></a>
1458 This is the “set autokey group name” option.
1459 This option takes a string argument <span class="file">group</span>.
1461 <p class="noindent">This option has some usage constraints. It:
1463 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1466 <p>Set the optional Autokey group name to name. This is used in
1467 the file name of IFF, GQ, and MV client parameters files. In
1468 that role, the default is the host name if this option is not
1469 provided. The group name, if specified using <code>-i/--ident</code> or
1470 using <code>-s/--subject-name</code> following an '<code>@</code>' character,
1471 is also a part of the self-signed host certificate subject and
1472 issuer names in the form <code>host@group</code> and should match the
1473 '<code>crypto ident</code>' or '<code>server ident</code>' configuration in the
1474 <code>ntpd</code> configuration file.
1477 <a name="ntp_002dkeygen-lifetime"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
1478 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-ident">ntp-keygen ident</a>,
1479 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1483 <h4 class="subsection">lifetime option (-l)</h4>
1485 <p><a name="index-ntp_002dkeygen_002dlifetime-12"></a>
1486 This is the “set certificate lifetime” option.
1487 This option takes a number argument <span class="file">lifetime</span>.
1489 <p class="noindent">This option has some usage constraints. It:
1491 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1494 <p>Set the certificate expiration to lifetime days from now.
1497 <a name="ntp_002dkeygen-modulus"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
1498 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>,
1499 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1503 <h4 class="subsection">modulus option (-m)</h4>
1505 <p><a name="index-ntp_002dkeygen_002dmodulus-13"></a>
1506 This is the “prime modulus” option.
1507 This option takes a number argument <span class="file">modulus</span>.
1509 <p class="noindent">This option has some usage constraints. It:
1511 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1514 <p>The number of bits in the prime modulus. The default is 512.
1517 <a name="ntp_002dkeygen-md5key"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>,
1518 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>,
1519 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1523 <h4 class="subsection">md5key option (-M)</h4>
1525 <p><a name="index-ntp_002dkeygen_002dmd5key-14"></a>
1526 This is the “generate symmetric keys” option.
1527 Generate symmetric keys, obsoleting any that may exist.
1530 <a name="ntp_002dkeygen-pvt_002dcert"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
1531 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>,
1532 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1536 <h4 class="subsection">pvt-cert option (-P)</h4>
1538 <p><a name="index-ntp_002dkeygen_002dpvt_002dcert-15"></a>
1539 This is the “generate pc private certificate” option.
1541 <p class="noindent">This option has some usage constraints. It:
1543 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1546 <p>Generate a private certificate. By default, the program generates
1547 public certificates.
1550 <a name="ntp_002dkeygen-password"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>,
1551 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>,
1552 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1556 <h4 class="subsection">password option (-p)</h4>
1558 <p><a name="index-ntp_002dkeygen_002dpassword-16"></a>
1559 This is the “local private password” option.
1560 This option takes a string argument <span class="file">passwd</span>.
1562 <p class="noindent">This option has some usage constraints. It:
1564 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1567 <p>Local files containing private data are encrypted with the
1568 DES-CBC algorithm and the specified password. The same password
1569 must be specified to the local ntpd via the "crypto pw password"
1570 configuration command. The default password is the local
1574 <a name="ntp_002dkeygen-export_002dpasswd"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
1575 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-password">ntp-keygen password</a>,
1576 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1580 <h4 class="subsection">export-passwd option (-q)</h4>
1582 <p><a name="index-ntp_002dkeygen_002dexport_002dpasswd-17"></a>
1583 This is the “export iff or gq group keys with password” option.
1584 This option takes a string argument <span class="file">passwd</span>.
1586 <p class="noindent">This option has some usage constraints. It:
1588 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1591 <p>Export IFF or GQ identity group keys to the standard output,
1592 encrypted with the DES-CBC algorithm and the specified password.
1593 The same password must be specified to the remote ntpd via the
1594 "crypto pw password" configuration command. See also the option
1595 –id-key (-e) for unencrypted exports.
1598 <a name="ntp_002dkeygen-subject_002dname"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
1599 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>,
1600 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1604 <h4 class="subsection">subject-name option (-s)</h4>
1606 <p><a name="index-ntp_002dkeygen_002dsubject_002dname-18"></a>
1607 This is the “set host and optionally group name” option.
1608 This option takes a string argument <span class="file">host@group</span>.
1610 <p class="noindent">This option has some usage constraints. It:
1612 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1615 <p>Set the Autokey host name, and optionally, group name specified
1616 following an '<code>@</code>' character. The host name is used in the file
1617 name of generated host and signing certificates, without the
1618 group name. The host name, and if provided, group name are used
1619 in <code>host@group</code> form for the host certificate subject and issuer
1620 fields. Specifying '<code>-s @group</code>' is allowed, and results in
1621 leaving the host name unchanged while appending <code>@group</code> to the
1622 subject and issuer fields, as with <code>-i group</code>. The group name, or
1623 if not provided, the host name are also used in the file names
1624 of IFF, GQ, and MV client parameter files.
1627 <a name="ntp_002dkeygen-sign_002dkey"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>,
1628 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>,
1629 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1633 <h4 class="subsection">sign-key option (-S)</h4>
1635 <p><a name="index-ntp_002dkeygen_002dsign_002dkey-19"></a>
1636 This is the “generate sign key (rsa or dsa)” option.
1637 This option takes a string argument <span class="file">sign</span>.
1639 <p class="noindent">This option has some usage constraints. It:
1641 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1644 <p>Generate a new sign key of the designated type, obsoleting any
1645 that may exist. By default, the program uses the host key as the
1649 <a name="ntp_002dkeygen-trusted_002dcert"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>,
1650 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>,
1651 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1655 <h4 class="subsection">trusted-cert option (-T)</h4>
1657 <p><a name="index-ntp_002dkeygen_002dtrusted_002dcert-20"></a>
1658 This is the “trusted certificate (tc scheme)” option.
1660 <p class="noindent">This option has some usage constraints. It:
1662 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1665 <p>Generate a trusted certificate. By default, the program generates
1666 a non-trusted certificate.
1669 <a name="ntp_002dkeygen-mv_002dparams"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>,
1670 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>,
1671 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1675 <h4 class="subsection">mv-params option (-V)</h4>
1677 <p><a name="index-ntp_002dkeygen_002dmv_002dparams-21"></a>
1678 This is the “generate <num> mv parameters” option.
1679 This option takes a number argument <span class="file">num</span>.
1681 <p class="noindent">This option has some usage constraints. It:
1683 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1686 <p>Generate parameters and keys for the Mu-Varadharajan (MV)
1687 identification scheme.
1690 <a name="ntp_002dkeygen-mv_002dkeys"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-config">ntp-keygen config</a>,
1691 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>,
1692 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1696 <h4 class="subsection">mv-keys option (-v)</h4>
1698 <p><a name="index-ntp_002dkeygen_002dmv_002dkeys-22"></a>
1699 This is the “update <num> mv keys” option.
1700 This option takes a number argument <span class="file">num</span>.
1702 <p class="noindent">This option has some usage constraints. It:
1704 <li>must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1707 <p>This option has no <span class="samp">doc</span> documentation.
1711 <a name="ntp_002dkeygen-config"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>,
1712 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>,
1713 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1717 <h4 class="subsection">presetting/configuring ntp-keygen</h4>
1719 <p>Any option that is not marked as <i>not presettable</i> may be preset by
1720 loading values from configuration ("rc" or "ini") files, and values from environment variables named <code>NTP-KEYGEN</code> and <code>NTP-KEYGEN_<OPTION_NAME></code>. <code><OPTION_NAME></code> must be one of
1721 the options listed above in upper case and segmented with underscores.
1722 The <code>NTP-KEYGEN</code> variable will be tokenized and parsed like
1723 the command line. The remaining variables are tested for existence and their
1724 values are treated like option arguments.
1726 <p class="noindent"><code>libopts</code> will search in 2 places for configuration files:
1731 The environment variables <code>HOME</code>, and <code>PWD</code>
1732 are expanded and replaced when <span class="file">ntp-keygen</span> runs.
1733 For any of these that are plain files, they are simply processed.
1734 For any that are directories, then a file named <span class="file">.ntprc</span> is searched for
1735 within that directory and processed.
1737 <p>Configuration files may be in a wide variety of formats.
1738 The basic format is an option name followed by a value (argument) on the
1739 same line. Values may be separated from the option name with a colon,
1740 equal sign or simply white space. Values may be continued across multiple
1741 lines by escaping the newline with a backslash.
1743 <p>Multiple programs may also share the same initialization file.
1744 Common options are collected at the top, followed by program specific
1745 segments. The segments are separated by lines like:
1746 <pre class="example"> [NTP-KEYGEN]
1748 <p class="noindent">or by
1749 <pre class="example"> <?program ntp-keygen>
1751 <p class="noindent">Do not mix these styles within one configuration file.
1753 <p>Compound values and carefully constructed string values may also be
1754 specified using XML syntax:
1755 <pre class="example"> <option-name>
1756 <sub-opt>...&lt;...&gt;...</sub-opt>
1757 </option-name>
1759 <p class="noindent">yielding an <code>option-name.sub-opt</code> string value of
1760 <pre class="example"> "...<...>..."
1762 <p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
1763 hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
1764 the associated name/value pair list (see: optionFindValue).
1766 <p>The command line options relating to configuration and/or usage help are:
1768 <h5 class="subsubheading">version (-)</h5>
1770 <p>Print the program version to standard out, optionally with licensing
1771 information, then exit 0. The optional argument specifies how much licensing
1772 detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
1773 Only the first letter of the argument is examined:
1776 <dt><span class="samp">version</span><dd>Only print the version. This is the default.
1777 <br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
1778 <br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
1783 <a name="ntp_002dkeygen-exit-status"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>,
1784 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-config">ntp-keygen config</a>,
1785 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1789 <h4 class="subsection">ntp-keygen exit status</h4>
1791 <p>One of the following exit values will be returned:
1793 <dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
1794 <br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
1795 <br><dt><span class="samp">66 (EX_NOINPUT)</span><dd>A specified configuration file could not be loaded.
1796 <br><dt><span class="samp">70 (EX_SOFTWARE)</span><dd>libopts had an internal operational error. Please report
1797 it to autogen-users@lists.sourceforge.net. Thank you.
1801 <a name="ntp_002dkeygen-Usage"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>,
1802 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>,
1803 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1807 <h4 class="subsection">ntp-keygen Usage</h4>
1811 <a name="ntp_002dkeygen-Notes"></a>Next: <a rel="next" accesskey="n" href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a>,
1812 Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>,
1813 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1817 <h4 class="subsection">ntp-keygen Notes</h4>
1821 <a name="ntp_002dkeygen-Bugs"></a>Previous: <a rel="previous" accesskey="p" href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>,
1822 Up: <a rel="up" accesskey="u" href="#ntp_002dkeygen-Invocation">ntp-keygen Invocation</a>
1826 <h4 class="subsection">ntp-keygen Bugs</h4>
1830 <a name="Random-Seed-File"></a>Next: <a rel="next" accesskey="n" href="#Cryptographic-Data-Files">Cryptographic Data Files</a>,
1831 Previous: <a rel="previous" accesskey="p" href="#Running-the-Program">Running the Program</a>,
1832 Up: <a rel="up" accesskey="u" href="#Top">Top</a>
1836 <!-- node-name, next, previous, up -->
1837 <h3 class="section">Random Seed File</h3>
1839 <p>All cryptographically sound key generation schemes must have means to
1840 randomize the entropy seed used to initialize the internal
1841 pseudo-random number generator used by the OpenSSL library routines.
1842 If a site supports ssh, it is very likely that means to do this are
1844 The entropy seed used by the OpenSSL library is contained in a file,
1845 usually called <code>.rnd</code>, which must be available when
1846 starting the <code>ntp-keygen</code> program or <code>ntpd</code> daemon.
1848 <p>The OpenSSL library looks for the file using the path specified by the
1849 <code>RANDFILE</code> environment variable in the user home directory, whether root
1851 If the <code>RANDFILE</code> environment variable is not
1852 present, the library looks for the <code>.rnd</code> file in the user home
1854 Since both the <code>ntp-keygen</code> program and <code>ntpd</code> daemon must run
1855 as root, the logical place to put this file is in <code>/.rnd</code> or
1856 <code>/root/.rnd</code>.
1857 If the file is not available or cannot be written, the program exits
1858 with a message to the system log.
1862 <a name="Cryptographic-Data-Files"></a>Previous: <a rel="previous" accesskey="p" href="#Random-Seed-File">Random Seed File</a>,
1863 Up: <a rel="up" accesskey="u" href="#Top">Top</a>
1867 <!-- node-name, next, previous, up -->
1868 <h3 class="section">Cryptographic Data Files</h3>
1870 <p>File and link names are in the <code>form ntpkey_key_name.fstamp</code>,
1871 where <code>key</code> is the key or parameter type,
1872 <code>name</code> is the host or group name and
1873 <code>fstamp</code> is the filestamp (NTP seconds) when the file was created).
1874 By convention, key names in generated file names include both upper and
1875 lower case characters, while key names in generated link names include
1876 only lower case characters. The filestamp is not used in generated link
1879 <p>The key name is a string defining the cryptographic key type.
1880 Key types include public/private keys host and sign, certificate cert
1881 and several challenge/response key types.
1882 By convention, client files used for
1883 challenges have a par subtype, as in the IFF challenge IFFpar, while
1884 server files for responses have a key subtype, as in the GQ response
1887 <p>All files begin with two nonencrypted lines. The first line contains
1888 the file name in the format <code>ntpkey_key_host.fstamp</code>.
1889 The second line contains the datestamp in conventional Unix date format.
1890 Lines beginning with <code>#</code> are ignored.
1892 <p>The remainder of the file contains cryptographic data encoded first
1893 using ASN.1 rules, then encrypted using the DES-CBC algorithm with
1894 given password and finally written in PEM-encoded printable ASCII text
1895 preceded and followed by MIME content identifier lines.
1897 <p>The format of the symmetric keys file, ordinarily named <code>ntp.keys</code>,
1898 is somewhat different than the other files in the interest of backward
1900 Ordinarily, the file is generated by this program, but
1901 it can be constructed and edited using an ordinary text editor.
1903 <pre class="example"> # ntpkey_MD5key_hms.local.3564038757
1904 # Sun Dec 9 02:45:57 2012
1906 1 MD5 "]!ghT%O;3)WJ,/Nc:>I # MD5 key
1907 2 MD5 lu+H^tF46BKR-6~pV_5 # MD5 key
1908 3 MD5 :lnoVsE%Yz*avh%EtNC # MD5 key
1909 4 MD5 |fdZrf0sF~^V # MD5 key
1910 5 MD5 IyAG>O"y"LmCRS!*bHC # MD5 key
1911 6 MD5 ">e\A # MD5 key
1912 7 MD5 c9x=M'CfLxax9v)PV-si # MD5 key
1913 8 MD5 E|=jvFVov?Bn|Ev=&aK\ # MD5 key
1914 9 MD5 T!c4UT&`(m$+m+B6,`Q0 # MD5 key
1915 10 MD5 JVF/1=)=IFbHbJQz..Cd # MD5 key
1916 11 SHA1 6dea311109529e436c2b4fccae9bc753c16d1b48 # SHA1 key
1917 12 SHA1 7076f373d86c4848c59ff8046e49cb7d614ec394 # SHA1 key
1918 13 SHA1 5f48b1b60591eb01b7cf1d33b7774f08d20262d3 # SHA1 key
1919 14 SHA1 eed5ab9d9497319ec60cf3781d52607e76720178 # SHA1 key
1920 15 SHA1 f283562611a04c964da8126296f5f8e58c3f85de # SHA1 key
1921 16 SHA1 1930da171297dd63549af50b29449de17dcf341f # SHA1 key
1922 17 SHA1 fee892110358cd4382322b889869e750db8e8a8f # SHA1 key
1923 18 SHA1 b5520c9fadd7ad3fd8bfa061c8821b65d029bb37 # SHA1 key
1924 19 SHA1 8c74fb440ec80f453ec6aaa62b9baed0ab723b92 # SHA1 key
1925 20 SHA1 6bc05f734306a189326000970c19b3910f403795 # SHA1 key
1927 <p>Figure 1. Typical Symmetric Key File
1929 <p>Figure 1 shows a typical symmetric keys file used by the reference
1931 Each line of the file contains three fields, first an
1932 integer between 1 and 65534, inclusive, representing the key identifier
1933 used in the server and peer configuration commands.
1934 Next is the key type for the message digest algorithm,
1935 which in the absence of the
1936 OpenSSL library must be MD5 to designate the MD5 message digest
1938 If the OpenSSL library is installed, the key type can be any
1939 message digest algorithm supported by that library.
1941 compatibility with FIPS 140-2 is required, the key type must be either
1943 The key type can be changed using an ASCII text editor.
1945 <p>An MD5 key consists of a printable ASCII string less than or equal to
1946 16 characters and terminated by whitespace or a # character.
1948 key consists of a hex-encoded ASCII string of 40 characters, which is
1949 truncated as necessary.
1951 <p>Note that the keys used by the <code>ntpq</code> and <code>ntpdc</code> programs are
1952 checked against passwords requested by the programs and entered by hand,
1954 is generally appropriate to specify these keys in human readable ASCII
1957 <p>The <code>ntp-keygen</code> program generates a MD5 symmetric keys file
1958 <code>ntpkey_MD5key_hostname.filestamp</code>.
1959 Since the file contains private
1960 shared keys, it should be visible only to root and distributed by
1961 secure means to other subnet hosts.
1962 The NTP daemon loads the file <code>ntp.keys</code>, so <code>ntp-keygen</code>
1963 installs a soft link from this name to the generated file.
1964 Subsequently, similar soft links must be installed by
1965 manual or automated means on the other subnet hosts.
1967 not used with the Autokey Version 2 protocol, it is needed to
1968 authenticate some remote configuration commands used by the <code>ntpq</code> and
1969 <code>ntpdc</code> utilities.