1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Ntp-keygen User’s Manual</title>
8 <meta name="description" content="Ntp-keygen User’s Manual">
9 <meta name="keywords" content="Ntp-keygen User’s Manual">
10 <meta name="resource-type" content="document">
11 <meta name="distribution" content="global">
12 <meta name="Generator" content="makeinfo">
13 <link href="#Top" rel="start" title="Top">
14 <link href="dir.html#Top" rel="up" title="(dir)">
15 <style type="text/css">
17 a.summary-letter {text-decoration: none}
18 blockquote.indentedblock {margin-right: 0em}
19 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
20 blockquote.smallquotation {font-size: smaller}
21 div.display {margin-left: 3.2em}
22 div.example {margin-left: 3.2em}
23 div.lisp {margin-left: 3.2em}
24 div.smalldisplay {margin-left: 3.2em}
25 div.smallexample {margin-left: 3.2em}
26 div.smalllisp {margin-left: 3.2em}
27 kbd {font-style: oblique}
28 pre.display {font-family: inherit}
29 pre.format {font-family: inherit}
30 pre.menu-comment {font-family: serif}
31 pre.menu-preformatted {font-family: serif}
32 pre.smalldisplay {font-family: inherit; font-size: smaller}
33 pre.smallexample {font-size: smaller}
34 pre.smallformat {font-family: inherit; font-size: smaller}
35 pre.smalllisp {font-size: smaller}
36 span.nolinebreak {white-space: nowrap}
37 span.roman {font-family: initial; font-weight: normal}
38 span.sansserif {font-family: sans-serif; font-weight: normal}
39 ul.no-bullet {list-style: none}
47 <h1 class="settitle" align="center">Ntp-keygen User’s Manual</h1>
53 <a name="SEC_Overview"></a>
54 <h2 class="shortcontents-heading">Short Table of Contents</h2>
56 <div class="shortcontents">
57 <ul class="no-bullet">
58 <li><a name="stoc-Description-1" href="#toc-Description-1">1 Description</a></li>
63 <table class="menu" border="0" cellspacing="0">
64 <tr><td align="left" valign="top">• <a href="#Description" accesskey="1">Description</a>:</td><td> </td><td align="left" valign="top">
66 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Invocation" accesskey="2">ntp-keygen Invocation</a>:</td><td> </td><td align="left" valign="top">Invoking ntp-keygen
68 <tr><td align="left" valign="top">• <a href="#Running-the-Program" accesskey="3">Running the Program</a>:</td><td> </td><td align="left" valign="top">
70 <tr><td align="left" valign="top">• <a href="#Random-Seed-File" accesskey="4">Random Seed File</a>:</td><td> </td><td align="left" valign="top">
72 <tr><td align="left" valign="top">• <a href="#Cryptographic-Data-Files" accesskey="5">Cryptographic Data Files</a>:</td><td> </td><td align="left" valign="top">
79 Next: <a href="#Description" accesskey="n" rel="next">Description</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> </p>
81 <a name="NTP-Key-Generation-Program-User-Manual"></a>
82 <h1 class="top">NTP Key Generation Program User Manual</h1>
84 <p>This document describes the use of the NTP Project’s <code>ntp-keygen</code>
85 program, that generates cryptographic data files used by the NTPv4
86 authentication and identity schemes.
87 It can generate message digest keys used in symmetric key cryptography and,
88 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.
92 The message digest keys file is generated in a
93 format compatible with NTPv3.
94 All other files are in PEM-encoded
95 printable ASCII format so they can be embedded as MIME attachments in
98 <p>This document applies to version 4.2.8p13 of <code>ntp-keygen</code>.
100 <table class="menu" border="0" cellspacing="0">
101 <tr><td align="left" valign="top">• <a href="#Description" accesskey="1">Description</a>:</td><td> </td><td align="left" valign="top">
106 <a name="Description"></a>
109 Next: <a href="#Running-the-Program" accesskey="n" rel="next">Running the Program</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> </p>
111 <a name="Description-1"></a>
112 <h2 class="chapter">1 Description</h2>
114 <p>This program generates cryptographic data files used by the NTPv4
115 authentication and identity schemes. It can generate message digest
116 keys used in symmetric key cryptography and, if the OpenSSL software
117 library has been installed, it can generate host keys, sign keys,
118 certificates, and identity keys and parameters used by the Autokey
119 public key cryptography. The message digest keys file is generated in a
120 format compatible with NTPv3. All other files are in PEM-encoded
121 printable ASCII format so they can be embedded as MIME attachments in
124 <p>When used to generate message digest keys, the program produces a file
125 containing ten pseudo-random printable ASCII strings suitable for the
126 MD5 message digest algorithm included in the distribution.
128 OpenSSL library is installed, it produces an additional ten hex-encoded
129 random bit strings suitable for the SHA1 and other message digest
131 The message digest keys file must be distributed and stored
132 using secure means beyond the scope of NTP itself.
134 used for ordinary NTP associations, additional keys can be defined as
135 passwords for the ntpq and ntpdc utility programs.
137 <p>The remaining generated files are compatible with other OpenSSL
138 applications and other Public Key Infrastructure (PKI) resources.
139 Certificates generated by this program are compatible with extant
140 industry practice, although some users might find the interpretation of
141 X509v3 extension fields somewhat liberal.
142 However, the identity keys
143 are probably not compatible with anything other than Autokey.
145 <p>Some files used by this program are encrypted using a private password.
146 The <code>-p</code> option specifies the password for local encrypted files and the
147 <code>-q</code> option the password for encrypted files sent to remote sites.
148 If no password is specified, the host name returned by the Unix
149 <code>gethostname()</code> function, normally the DNS name of the host, is used.
151 <p>The <kbd>pw</kbd> option of the <code>crypto</code> configuration command
152 specifies the read password for previously encrypted local files.
153 This must match the local password used by this program.
154 If not specified, the host name is used.
155 Thus, if files are generated by this program without password,
156 they can be read back by ntpd without password, but only on the same
159 <p>Normally, encrypted files for each host are generated by that host and
160 used only by that host, although exceptions exist as noted later on
162 The symmetric keys file, normally called <code>ntp.keys</code>, is
163 usually installed in <code>/etc</code>.
164 Other files and links are usually installed
165 in <code>/usr/local/etc</code>, which is normally in a shared filesystem in
166 NFS-mounted networks and cannot be changed by shared clients.
167 The location of the keys directory can be changed by the keysdir
168 configuration command in such cases.
169 Normally, this is in <code>/etc</code>.
171 <p>This program directs commentary and error messages to the standard
172 error stream <code>stderr</code> and remote files to the standard output stream
173 <code>stdout</code> where they can be piped to other applications or redirected to
175 The names used for generated files and links all begin with the
176 string <code>ntpkey</code> and include the file type,
177 generating host and filestamp,
178 as described in the <a href="#Cryptographic-Data-Files">Cryptographic Data Files</a> section below.
180 <table class="menu" border="0" cellspacing="0">
181 <tr><td align="left" valign="top">• <a href="#Running-the-Program" accesskey="1">Running the Program</a>:</td><td> </td><td align="left" valign="top">
183 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Invocation" accesskey="2">ntp-keygen Invocation</a>:</td><td> </td><td align="left" valign="top">
185 <tr><td align="left" valign="top">• <a href="#Random-Seed-File" accesskey="3">Random Seed File</a>:</td><td> </td><td align="left" valign="top">
187 <tr><td align="left" valign="top">• <a href="#Cryptographic-Data-Files" accesskey="4">Cryptographic Data Files</a>:</td><td> </td><td align="left" valign="top">
192 <a name="Running-the-Program"></a>
195 Next: <a href="#Random-Seed-File" accesskey="n" rel="next">Random Seed File</a>, Previous: <a href="#Description" accesskey="p" rel="prev">Description</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> </p>
197 <a name="Running-the-Program-1"></a>
198 <h3 class="section">1.1 Running the Program</h3>
200 <p>To test and gain experience with Autokey concepts, log in as root and
201 change to the keys directory, usually <code>/usr/local/etc</code>.
203 first time, or if all files with names beginning <code>ntpkey</code>] have been
204 removed, use the <code>ntp-keygen</code> command without arguments to generate a
205 default RSA host key and matching RSA-MD5 certificate with expiration
207 If run again without options, the program uses the
208 existing keys and parameters and generates only a new certificate with
209 new expiration date one year hence.
211 <p>Run the command on as many hosts as necessary.
212 Designate one of them as the trusted host (TH) using <code>ntp-keygen</code>
213 with the <code>-T</code> option and configure
214 it to synchronize from reliable Internet servers.
215 Then configure the other hosts to synchronize to the TH directly or indirectly.
216 A certificate trail is created when Autokey asks the immediately
217 ascendant host towards the TH to sign its certificate, which is then
218 provided to the immediately descendant host on request.
219 All group hosts should have acyclic certificate trails ending on the TH.
221 <p>The host key is used to encrypt the cookie when required and so must be
223 By default, the host key is also the sign key used to encrypt signatures.
224 A different sign key can be assigned using the <code>-S</code> option
225 and this can be either RSA or DSA type.
226 By default, the signature
227 message digest type is MD5, but any combination of sign key type and
228 message digest type supported by the OpenSSL library can be specified
229 using the <code>-c</code> option.
231 <p>The rules say cryptographic media should be generated with proventic
232 filestamps, which means the host should already be synchronized before
234 This of course creates a chicken-and-egg problem
235 when the host is started for the first time.
236 Accordingly, the host time
237 should be set by some other means, such as eyeball-and-wristwatch, at
238 least so that the certificate lifetime is within the current year.
239 After that and when the host is synchronized to a proventic source, the
240 certificate should be re-generated.
242 <p>Additional information on trusted groups and identity schemes is on the
243 Autokey Public-Key Authentication page.
246 <a name="ntp_002dkeygen-Invocation"></a>
249 Next: <a href="#Random-Seed-File" accesskey="n" rel="next">Random Seed File</a>, Previous: <a href="#Running-the-Program" accesskey="p" rel="prev">Running the Program</a>, Up: <a href="#Description" accesskey="u" rel="up">Description</a> </p>
251 <a name="Invoking-ntp_002dkeygen"></a>
252 <h3 class="section">1.2 Invoking ntp-keygen</h3>
253 <a name="index-ntp_002dkeygen"></a>
254 <a name="index-Create-a-NTP-host-key"></a>
258 <p>This program generates cryptographic data files used by the NTPv4
259 authentication and identification schemes.
260 It can generate message digest keys used in symmetric key cryptography and,
261 if the OpenSSL software library has been installed, it can generate host keys,
262 signing keys, certificates, and identity keys and parameters used in Autokey
263 public key cryptography.
264 These files are used for cookie encryption,
265 digital signature, and challenge/response identification algorithms
266 compatible with the Internet standard security infrastructure.
268 <p>The message digest symmetric keys file is generated in a format
269 compatible with NTPv3.
270 All other files are in PEM-encoded printable ASCII format,
271 so they can be embedded as MIME attachments in email to other sites
272 and certificate authorities.
273 By default, files are not encrypted.
275 <p>When used to generate message digest symmetric keys, the program
276 produces a file containing ten pseudo-random printable ASCII strings
277 suitable for the MD5 message digest algorithm included in the
279 If the OpenSSL library is installed, it produces an additional ten
280 hex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
281 other message digest algorithms.
282 The message digest symmetric keys file must be distributed and stored
283 using secure means beyond the scope of NTP itself.
284 Besides the keys used for ordinary NTP associations, additional keys
285 can be defined as passwords for the
286 <code>ntpq(1ntpqmdoc)</code>
288 <code>ntpdc(1ntpdcmdoc)</code>
291 <p>The remaining generated files are compatible with other OpenSSL
292 applications and other Public Key Infrastructure (PKI) resources.
293 Certificates generated by this program are compatible with extant
294 industry practice, although some users might find the interpretation of
295 X509v3 extension fields somewhat liberal.
296 However, the identity keys are probably not compatible with anything
299 <p>Some files used by this program are encrypted using a private password.
302 option specifies the read password for local encrypted files and the
304 option the write password for encrypted files sent to remote sites.
305 If no password is specified, the host name returned by the Unix
306 <code>hostname(1)</code>
307 command, normally the DNS name of the host, is used as the the default read
308 password, for convenience.
310 <code>ntp-keygen</code>
311 program prompts for the password if it reads an encrypted file
312 and the password is missing or incorrect.
313 If an encrypted file is read successfully and
314 no write password is specified, the read password is used
315 as the write password by default.
321 <code>ntpd(1ntpdmdoc)</code>
322 configuration command specifies the read
323 password for previously encrypted local files.
324 This must match the local read password used by this program.
325 If not specified, the host name is used.
326 Thus, if files are generated by this program without an explicit password,
327 they can be read back by
328 <code>ntpd(1ntpdmdoc)</code>
329 without specifying an explicit password but only on the same host.
330 If the write password used for encryption is specified as the host name,
331 these files can be read by that host with no explicit password.
333 <p>Normally, encrypted files for each host are generated by that host and
334 used only by that host, although exceptions exist as noted later on
336 The symmetric keys file, normally called
337 <samp>ntp.keys</samp>,
338 is usually installed in
340 Other files and links are usually installed in
341 <samp>/usr/local/etc</samp>,
342 which is normally in a shared filesystem in
343 NFS-mounted networks and cannot be changed by shared clients.
344 In these cases, NFS clients can specify the files in another
349 <code>ntpd(1ntpdmdoc)</code>
350 configuration file command.
352 <p>This program directs commentary and error messages to the standard
355 and remote files to the standard output stream
357 where they can be piped to other applications or redirected to files.
358 The names used for generated files and links all begin with the
361 and include the file type, generating host and filestamp,
363 <a href="#Cryptographic-Data-Files">Cryptographic Data Files</a>
366 <table class="menu" border="0" cellspacing="0">
367 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-usage" accesskey="1">ntp-keygen usage</a>:</td><td> </td><td align="left" valign="top">
369 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-imbits" accesskey="2">ntp-keygen imbits</a>:</td><td> </td><td align="left" valign="top">
371 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-certificate" accesskey="3">ntp-keygen certificate</a>:</td><td> </td><td align="left" valign="top">
373 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-cipher" accesskey="4">ntp-keygen cipher</a>:</td><td> </td><td align="left" valign="top">
375 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-id_002dkey" accesskey="5">ntp-keygen id-key</a>:</td><td> </td><td align="left" valign="top">
377 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-gq_002dparams" accesskey="6">ntp-keygen gq-params</a>:</td><td> </td><td align="left" valign="top">
379 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-host_002dkey" accesskey="7">ntp-keygen host-key</a>:</td><td> </td><td align="left" valign="top">
381 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-iffkey" accesskey="8">ntp-keygen iffkey</a>:</td><td> </td><td align="left" valign="top">
383 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-ident" accesskey="9">ntp-keygen ident</a>:</td><td> </td><td align="left" valign="top">
385 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>:</td><td> </td><td align="left" valign="top">
387 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>:</td><td> </td><td align="left" valign="top">
389 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>:</td><td> </td><td align="left" valign="top">
391 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>:</td><td> </td><td align="left" valign="top">
393 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-password">ntp-keygen password</a>:</td><td> </td><td align="left" valign="top">
395 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>:</td><td> </td><td align="left" valign="top">
397 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>:</td><td> </td><td align="left" valign="top">
399 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>:</td><td> </td><td align="left" valign="top">
401 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>:</td><td> </td><td align="left" valign="top">
403 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>:</td><td> </td><td align="left" valign="top">
405 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>:</td><td> </td><td align="left" valign="top">
407 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-config">ntp-keygen config</a>:</td><td> </td><td align="left" valign="top">
409 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>:</td><td> </td><td align="left" valign="top">
411 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>:</td><td> </td><td align="left" valign="top">
413 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>:</td><td> </td><td align="left" valign="top">
415 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a>:</td><td> </td><td align="left" valign="top">
419 <a name="Running-the-Program-2"></a>
420 <h4 class="subsection">1.2.1 Running the Program</h4>
421 <p>The safest way to run the
422 <code>ntp-keygen</code>
423 program is logged in directly as root.
424 The recommended procedure is change to the
427 <samp>/usr/local/etc</samp>,
428 then run the program.
430 <p>To test and gain experience with Autokey concepts, log in as root and
434 <samp>/usr/local/etc</samp>.
435 When run for the first time, or if all files with names beginning with
437 have been removed, use the
438 <code>ntp-keygen</code>
439 command without arguments to generate a default
441 host key and matching
443 certificate file with expiration date one year hence,
444 which is all that is necessary in many cases.
445 The program also generates soft links from the generic names
446 to the respective files.
447 If run again without options, the program uses the
448 existing keys and parameters and generates a new certificate file with
449 new expiration date one year hence, and soft link.
451 <p>The host key is used to encrypt the cookie when required and so must be
454 By default, the host key is also the sign key used to encrypt signatures.
455 When necessary, a different sign key can be specified and this can be
461 By default, the message digest type is
464 of sign key type and message digest type supported by the OpenSSL library
465 can be specified, including those using the
466 <code>AES128CMAC</code>, <code>MD2</code>, <code>MD5</code>, <code>MDC2</code>, <code>SHA</code>, <code>SHA1</code>
469 message digest algorithms.
470 However, the scheme specified in the certificate must be compatible
472 Certificates using any digest algorithm are compatible with
479 certificates are compatible with
483 <p>Private/public key files and certificates are compatible with
484 other OpenSSL applications and very likely other libraries as well.
485 Certificates or certificate requests derived from them should be compatible
486 with extant industry practice, although some users might find
487 the interpretation of X509v3 extension fields somewhat liberal.
488 However, the identification parameter files, although encoded
489 as the other files, are probably not compatible with anything other than Autokey.
491 <p>Running the program as other than root and using the Unix
494 to assume root may not work properly, since by default the OpenSSL library
495 looks for the random seed file
497 in the user home directory.
498 However, there should be only one
501 in the root directory, so it is convenient to define the
503 environment variable used by the OpenSSL library as the path to
506 <p>Installing the keys as root might not work in NFS-mounted
507 shared file systems, as NFS clients may not be able to write
508 to the shared keys directory, even as root.
509 In this case, NFS clients can specify the files in another
514 <code>ntpd(1ntpdmdoc)</code>
515 configuration file command.
516 There is no need for one client to read the keys and certificates
517 of other clients or servers, as these data are obtained automatically
518 by the Autokey protocol.
520 <p>Ordinarily, cryptographic files are generated by the host that uses them,
521 but it is possible for a trusted agent (TA) to generate these files
522 for other hosts; however, in such cases files should always be encrypted.
523 The subject name and trusted name default to the hostname
524 of the host generating the files, but can be changed by command line options.
525 It is convenient to designate the owner name and trusted name
526 as the subject and issuer fields, respectively, of the certificate.
527 The owner name is also used for the host and sign key files,
528 while the trusted name is used for the identity files.
530 <p>All files are installed by default in the keys directory
531 <samp>/usr/local/etc</samp>,
532 which is normally in a shared filesystem
533 in NFS-mounted networks.
534 The actual location of the keys directory
535 and each file can be overridden by configuration commands,
536 but this is not recommended.
537 Normally, the files for each host are generated by that host
538 and used only by that host, although exceptions exist
539 as noted later on this page.
541 <p>Normally, files containing private values,
542 including the host key, sign key and identification parameters,
543 are permitted root read/write-only;
544 while others containing public values are permitted world readable.
545 Alternatively, files containing private values can be encrypted
546 and these files permitted world readable,
547 which simplifies maintenance in shared file systems.
548 Since uniqueness is insured by the
552 file name extensions, the files for an NTP server and
553 dependent clients can all be installed in the same shared directory.
555 <p>The recommended practice is to keep the file name extensions
556 when installing a file and to install a soft link
557 from the generic names specified elsewhere on this page
558 to the generated files.
559 This allows new file generations to be activated simply
560 by changing the link.
561 If a link is present,
562 <code>ntpd(1ntpdmdoc)</code>
563 follows it to the file name to extract the
564 <kbd>filestamp</kbd>.
565 If a link is not present,
566 <code>ntpd(1ntpdmdoc)</code>
569 from the file itself.
570 This allows clients to verify that the file and generation times
573 <code>ntp-keygen</code>
574 program uses the same
576 extension for all files generated
577 at one time, so each generation is distinct and can be readily
578 recognized in monitoring data.
580 <p>Run the command on as many hosts as necessary.
581 Designate one of them as the trusted host (TH) using
582 <code>ntp-keygen</code>
585 option and configure it to synchronize from reliable Internet servers.
586 Then configure the other hosts to synchronize to the TH directly or
588 A certificate trail is created when Autokey asks the immediately
589 ascendant host towards the TH to sign its certificate, which is then
590 provided to the immediately descendant host on request.
591 All group hosts should have acyclic certificate trails ending on the TH.
593 <p>The host key is used to encrypt the cookie when required and so must be
595 By default, the host key is also the sign key used to encrypt
597 A different sign key can be assigned using the
599 option and this can be either
604 By default, the signature
605 message digest type is
607 but any combination of sign key type and
608 message digest type supported by the OpenSSL library can be specified
613 <p>The rules say cryptographic media should be generated with proventic
614 filestamps, which means the host should already be synchronized before
616 This of course creates a chicken-and-egg problem
617 when the host is started for the first time.
618 Accordingly, the host time
619 should be set by some other means, such as eyeball-and-wristwatch, at
620 least so that the certificate lifetime is within the current year.
621 After that and when the host is synchronized to a proventic source, the
622 certificate should be re-generated.
624 <p>Additional information on trusted groups and identity schemes is on the
625 “Autokey Public-Key Authentication”
628 <p>File names begin with the prefix
630 and end with the suffix
631 <samp>_</samp><kbd>hostname</kbd>. <kbd>filestamp</kbd>,
634 is the owner name, usually the string returned
636 <code>hostname(1)</code>
639 is the NTP seconds when the file was generated, in decimal digits.
640 This both guarantees uniqueness and simplifies maintenance
641 procedures, since all files can be quickly removed
643 <code>rm</code> <samp>ntpkey*</samp>
644 command or all files generated
645 at a specific time can be removed by a
646 <code>rm</code> <samp>*</samp><kbd>filestamp</kbd>
648 To further reduce the risk of misconfiguration,
649 the first two lines of a file contain the file name
650 and generation date and time as comments.
652 <a name="Trusted-Hosts-and-Groups"></a>
653 <h4 class="subsubsection">1.2.1.1 Trusted Hosts and Groups</h4>
654 <p>Each cryptographic configuration involves selection of a signature scheme
655 and identification scheme, called a cryptotype,
657 ‘Authentication Options’
659 <code>ntp.conf(5)</code>.
660 The default cryptotype uses
668 First, configure a NTP subnet including one or more low-stratum
669 trusted hosts from which all other hosts derive synchronization
670 directly or indirectly.
671 Trusted hosts have trusted certificates;
672 all other hosts have nontrusted certificates.
673 These hosts will automatically and dynamically build authoritative
674 certificate trails to one or more trusted hosts.
675 A trusted group is the set of all hosts that have, directly or indirectly,
676 a certificate trail ending at a trusted host.
677 The trail is defined by static configuration file entries
678 or dynamic means described on the
679 ‘Automatic NTP Configuration Options’
681 <code>ntp.conf(5)</code>.
683 <p>On each trusted host as root, change to the keys directory.
684 To insure a fresh fileset, remove all
688 <code>ntp-keygen</code>
690 to generate keys and a trusted certificate.
691 On all other hosts do the same, but leave off the
693 flag to generate keys and nontrusted certificates.
694 When complete, start the NTP daemons beginning at the lowest stratum
695 and working up the tree.
696 It may take some time for Autokey to instantiate the certificate trails
697 throughout the subnet, but setting up the environment is completely automatic.
699 <p>If it is necessary to use a different sign key or different digest/signature
700 scheme than the default, run
701 <code>ntp-keygen</code>
703 <code>-S</code> <kbd>type</kbd>
710 The most frequent need to do this is when a
711 <code>DSA</code>-signed
713 If it is necessary to use a different certificate scheme than the default,
715 <code>ntp-keygen</code>
717 <code>-c</code> <kbd>scheme</kbd>
722 <code>ntp-keygen</code>
723 is run again without these options, it generates a new certificate
724 using the same scheme and sign key, and soft link.
726 <p>After setting up the environment it is advisable to update certificates
727 from time to time, if only to extend the validity interval.
729 <code>ntp-keygen</code>
730 with the same flags as before to generate new certificates
731 using existing keys, and soft links.
732 However, if the host or sign key is changed,
733 <code>ntpd(1ntpdmdoc)</code>
736 <code>ntpd(1ntpdmdoc)</code>
737 is restarted, it loads any new files and restarts the protocol.
738 Other dependent hosts will continue as usual until signatures are refreshed,
739 at which time the protocol is restarted.
741 <a name="Identity-Schemes"></a>
742 <h4 class="subsubsection">1.2.1.2 Identity Schemes</h4>
743 <p>As mentioned on the Autonomous Authentication page,
746 identity scheme is vulnerable to a middleman attack.
747 However, there are more secure identity schemes available,
749 <code>PC</code>, <code>IFF</code>, <code>GQ</code>
752 schemes described below.
753 These schemes are based on a TA, one or more trusted hosts
754 and some number of nontrusted hosts.
755 Trusted hosts prove identity using values provided by the TA,
756 while the remaining hosts prove identity using values provided
757 by a trusted host and certificate trails that end on that host.
758 The name of a trusted host is also the name of its sugroup
759 and also the subject and issuer name on its trusted certificate.
760 The TA is not necessarily a trusted host in this sense, but often is.
762 <p>In some schemes there are separate keys for servers and clients.
763 A server can also be a client of another server,
764 but a client can never be a server for another client.
765 In general, trusted hosts and nontrusted hosts that operate
766 as both server and client have parameter files that contain
767 both server and client keys.
769 only as clients have key files that contain only client keys.
771 <p>The PC scheme supports only one trusted host in the group.
772 On trusted host alice run
773 <code>ntp-keygen</code>
775 <code>-p</code> <kbd>password</kbd>
776 to generate the host key file
777 <samp>ntpkey</samp>_ <code>RSA</code> <samp>key_alice.</samp> <kbd>filestamp</kbd>
778 and trusted private certificate file
779 <samp>ntpkey</samp>_ <code>RSA-MD5</code> <code>_</code> <samp>cert_alice.</samp> <kbd>filestamp</kbd>,
781 Copy both files to all group hosts;
782 they replace the files which would be generated in other schemes.
785 install a soft link from the generic name
786 <samp>ntpkey_host_</samp><kbd>bob</kbd>
787 to the host key file and soft link
788 <samp>ntpkey_cert_</samp><kbd>bob</kbd>
789 to the private certificate file.
790 Note the generic links are on bob, but point to files generated
791 by trusted host alice.
792 In this scheme it is not possible to refresh
793 either the keys or certificates without copying them
794 to all other hosts in the group, and recreating the soft links.
798 scheme proceed as in the
800 scheme to generate keys
801 and certificates for all group hosts, then for every trusted host in the group,
805 On trusted host alice run
806 <code>ntp-keygen</code>
809 <code>-p</code> <kbd>password</kbd>
810 to produce her parameter file
811 <samp>ntpkey_IFFpar_alice.</samp><kbd>filestamp</kbd>,
812 which includes both server and client keys.
813 Copy this file to all group hosts that operate as both servers
814 and clients and install a soft link from the generic
815 <samp>ntpkey_iff_alice</samp>
817 If there are no hosts restricted to operate only as clients,
818 there is nothing further to do.
821 scheme is independent
822 of keys and certificates, these files can be refreshed as needed.
824 <p>If a rogue client has the parameter file, it could masquerade
825 as a legitimate server and present a middleman threat.
826 To eliminate this threat, the client keys can be extracted
827 from the parameter file and distributed to all restricted clients.
828 After generating the parameter file, on alice run
829 <code>ntp-keygen</code>
831 and pipe the output to a file or email program.
832 Copy or email this file to all restricted clients.
833 On these clients install a soft link from the generic
834 <samp>ntpkey_iff_alice</samp>
836 To further protect the integrity of the keys,
837 each file can be encrypted with a secret password.
841 scheme proceed as in the
843 scheme to generate keys
844 and certificates for all group hosts, then for every trusted host
845 in the group, generate the
848 On trusted host alice run
849 <code>ntp-keygen</code>
852 <code>-p</code> <kbd>password</kbd>
853 to produce her parameter file
854 <samp>ntpkey_GQpar_alice.</samp><kbd>filestamp</kbd>,
855 which includes both server and client keys.
856 Copy this file to all group hosts and install a soft link
858 <samp>ntpkey_gq_alice</samp>
860 In addition, on each host
864 <samp>ntpkey_gq_</samp><kbd>bob</kbd>
870 parameters file and certificate
871 at the same time, keys and certificates can be regenerated as needed.
875 scheme, proceed as in the
877 scheme to generate keys
878 and certificates for all group hosts.
879 For illustration assume trish is the TA, alice one of several trusted hosts
880 and bob one of her clients.
882 <code>ntp-keygen</code>
883 <code>-V</code> <kbd>n</kbd>
884 <code>-p</code> <kbd>password</kbd>,
887 is the number of revokable keys (typically 5) to produce
889 <samp>ntpkeys_MVpar_trish.</samp><kbd>filestamp</kbd>
891 <samp>ntpkeys_MVkey</samp><kbd>d</kbd> <kbd>_</kbd> <samp>trish.</samp> <kbd>filestamp</kbd>
894 is the key number (0 <
898 Copy the parameter file to alice and install a soft link
900 <samp>ntpkey_mv_alice</samp>
902 Copy one of the client key files to alice for later distribution
904 It does not matter which client key file goes to alice,
905 since they all work the same way.
906 Alice copies the client key file to all of her clients.
907 On client bob install a soft link from generic
908 <samp>ntpkey_mvkey_bob</samp>
909 to the client key file.
912 scheme is independent of keys and certificates,
913 these files can be refreshed as needed.
915 <a name="Command-Line-Options"></a>
916 <h4 class="subsubsection">1.2.1.3 Command Line Options</h4>
917 <dl compact="compact">
918 <dt><code>-b</code> <code>--imbits</code>= <kbd>modulus</kbd></dt>
919 <dd><p>Set the number of bits in the identity modulus for generating identity keys to
922 The number of bits in the identity modulus defaults to 256, but can be set to
923 values from 256 to 2048 (32 to 256 octets).
924 Use the larger moduli with caution, as this can consume considerable computing
925 resources and increases the size of authenticated packets.
927 <dt><code>-c</code> <code>--certificate</code>= <kbd>scheme</kbd></dt>
928 <dd><p>Select certificate signature encryption/message digest scheme.
931 can be one of the following:
932 <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>,
934 <code>DSA-SHA1</code>.
937 schemes must be used with an
941 schemes must be used with a
944 The default without this option is
945 <code>RSA-MD5</code>.
946 If compatibility with FIPS 140-2 is required, either the
949 <code>DSA-SHA1</code>
952 <dt><code>-C</code> <code>--cipher</code>= <kbd>cipher</kbd></dt>
953 <dd><p>Select the OpenSSL cipher to encrypt the files containing private keys.
954 The default without this option is three-key triple DES in CBC mode,
955 <code>des-ede3-cbc</code>.
957 <code>openssl</code> <code>-h</code>
958 command provided with OpenSSL displays available ciphers.
960 <dt><code>-d</code> <code>--debug-level</code></dt>
961 <dd><p>Increase debugging verbosity level.
962 This option displays the cryptographic data produced in eye-friendly billboards.
964 <dt><code>-D</code> <code>--set-debug-level</code>= <kbd>level</kbd></dt>
965 <dd><p>Set the debugging verbosity to
967 This option displays the cryptographic data produced in eye-friendly billboards.
969 <dt><code>-e</code> <code>--id-key</code></dt>
974 public parameters from the
975 <kbd>IFFkey</kbd> <kbd>or</kbd> <kbd>GQkey</kbd>
976 client keys file previously specified
977 as unencrypted data to the standard output stream
979 This is intended for automatic key distribution by email.
981 <dt><code>-G</code> <code>--gq-params</code></dt>
982 <dd><p>Generate a new encrypted
984 parameters and key file for the Guillou-Quisquater (GQ) identity scheme.
985 This option is mutually exclusive with the
991 <dt><code>-H</code> <code>--host-key</code></dt>
992 <dd><p>Generate a new encrypted
994 public/private host key file.
996 <dt><code>-I</code> <code>--iffkey</code></dt>
997 <dd><p>Generate a new encrypted
999 key file for the Schnorr (IFF) identity scheme.
1000 This option is mutually exclusive with the
1006 <dt><code>-i</code> <code>--ident</code>= <kbd>group</kbd></dt>
1007 <dd><p>Set the optional Autokey group name to
1009 This is used in the identity scheme parameter file names of
1010 <code>IFF</code>, <code>GQ</code>,
1013 client parameters files.
1014 In that role, the default is the host name if no group is provided.
1015 The group name, if specified using
1021 character, is also used in certificate subject and issuer names in the form
1022 <kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
1023 and should match the group specified via
1024 <code>crypto</code> <code>ident</code>
1026 <code>server</code> <code>ident</code>
1027 in the ntpd configuration file.
1029 <dt><code>-l</code> <code>--lifetime</code>= <kbd>days</kbd></dt>
1030 <dd><p>Set the lifetime for certificate expiration to
1032 The default lifetime is one year (365 days).
1034 <dt><code>-m</code> <code>--modulus</code>= <kbd>bits</kbd></dt>
1035 <dd><p>Set the number of bits in the prime modulus for generating files to
1037 The modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
1038 Use the larger moduli with caution, as this can consume considerable computing
1039 resources and increases the size of authenticated packets.
1041 <dt><code>-M</code> <code>--md5key</code></dt>
1042 <dd><p>Generate a new symmetric keys file containing 10
1044 keys, and if OpenSSL is available, 10
1049 key is a string of 20 random printable ASCII characters, while a
1051 key is a string of 40 random hex digits.
1052 The file can be edited using a text editor to change the key type or key content.
1053 This option is mutually exclusive with all other options.
1055 <dt><code>-p</code> <code>--password</code>= <kbd>passwd</kbd></dt>
1056 <dd><p>Set the password for reading and writing encrypted files to
1058 These include the host, sign and identify key files.
1059 By default, the password is the string returned by the Unix
1060 <code>hostname</code>
1063 <dt><code>-P</code> <code>--pvt-cert</code></dt>
1064 <dd><p>Generate a new private certificate used by the
1067 By default, the program generates public certificates.
1068 Note: the PC identity scheme is not recommended for new installations.
1070 <dt><code>-q</code> <code>--export-passwd</code>= <kbd>passwd</kbd></dt>
1071 <dd><p>Set the password for writing encrypted
1072 <code>IFF</code>, <code>GQ</code> <code>and</code> <code>MV</code>
1073 identity files redirected to
1077 In effect, these files are decrypted with the
1079 password, then encrypted with the
1082 By default, the password is the string returned by the Unix
1083 <code>hostname</code>
1086 <dt><code>-s</code> <code>--subject-key</code>= <code>[host]</code> <code>[@ <kbd>group</kbd>]</code></dt>
1087 <dd><p>Specify the Autokey host name, where
1089 is the optional host name and
1091 is the optional group name.
1092 The host name, and if provided, group name are used in
1093 <kbd>host</kbd> <kbd>@</kbd> <kbd>group</kbd>
1094 form as certificate subject and issuer.
1096 <code>-s</code> <code>-@</code> <kbd>group</kbd>
1097 is allowed, and results in leaving the host name unchanged, as with
1098 <code>-i</code> <kbd>group</kbd>.
1099 The group name, or if no group is provided, the host name are also used in the
1101 <code>IFF</code>, <code>GQ</code>,
1104 identity scheme client parameter files.
1107 is not specified, the default host name is the string returned by the Unix
1108 <code>hostname</code>
1111 <dt><code>-S</code> <code>--sign-key</code>= <code>[<code>RSA</code> | <code>DSA</code>]</code></dt>
1112 <dd><p>Generate a new encrypted public/private sign key file of the specified type.
1113 By default, the sign key is the host key and has the same type.
1114 If compatibility with FIPS 140-2 is required, the sign key type must be
1117 <dt><code>-T</code> <code>--trusted-cert</code></dt>
1118 <dd><p>Generate a trusted certificate.
1119 By default, the program generates a non-trusted certificate.
1121 <dt><code>-V</code> <code>--mv-params</code> <kbd>nkeys</kbd></dt>
1124 encrypted server keys and parameters for the Mu-Varadharajan (MV)
1126 This option is mutually exclusive with the
1131 Note: support for this option should be considered a work in progress.
1135 <a name="Random-Seed-File-1"></a>
1136 <h4 class="subsubsection">1.2.1.4 Random Seed File</h4>
1137 <p>All cryptographically sound key generation schemes must have means
1138 to randomize the entropy seed used to initialize
1139 the internal pseudo-random number generator used
1140 by the library routines.
1141 The OpenSSL library uses a designated random seed file for this purpose.
1142 The file must be available when starting the NTP daemon and
1143 <code>ntp-keygen</code>
1145 If a site supports OpenSSL or its companion OpenSSH,
1146 it is very likely that means to do this are already available.
1148 <p>It is important to understand that entropy must be evolved
1149 for each generation, for otherwise the random number sequence
1150 would be predictable.
1151 Various means dependent on external events, such as keystroke intervals,
1152 can be used to do this and some systems have built-in entropy sources.
1153 Suitable means are described in the OpenSSL software documentation,
1154 but are outside the scope of this page.
1156 <p>The entropy seed used by the OpenSSL library is contained in a file,
1159 which must be available when starting the NTP daemon
1161 <code>ntp-keygen</code>
1163 The NTP daemon will first look for the file
1164 using the path specified by the
1165 <code>randfile</code>
1168 configuration command.
1169 If not specified in this way, or when starting the
1170 <code>ntp-keygen</code>
1172 the OpenSSL library will look for the file using the path specified
1175 environment variable in the user home directory,
1176 whether root or some other user.
1179 environment variable is not present,
1180 the library will look for the
1182 file in the user home directory.
1184 <code>ntp-keygen</code>
1186 <code>ntpd(1ntpdmdoc)</code>
1187 daemon must run as root, the logical place to put this file is in
1190 <samp>/root/.rnd</samp>.
1191 If the file is not available or cannot be written,
1192 the daemon exits with a message to the system log and the program
1193 exits with a suitable error message.
1195 <a name="Cryptographic-Data-Files-1"></a>
1196 <h4 class="subsubsection">1.2.1.5 Cryptographic Data Files</h4>
1197 <p>All file formats begin with two nonencrypted lines.
1198 The first line contains the file name, including the generated host name
1199 and filestamp, in the format
1200 <samp>ntpkey_</samp><kbd>key</kbd> <kbd>_</kbd> <kbd>name</kbd>. <kbd>filestamp</kbd>,
1203 is the key or parameter type,
1205 is the host or group name and
1206 <kbd>filestamp</kbd>
1207 is the filestamp (NTP seconds) when the file was created.
1210 names in generated file names include both upper and lower case
1213 names in generated link names include only lower case characters.
1214 The filestamp is not used in generated link names.
1215 The second line contains the datestamp in conventional Unix
1218 Lines beginning with
1220 are considered comments and ignored by the
1221 <code>ntp-keygen</code>
1223 <code>ntpd(1ntpdmdoc)</code>
1226 <p>The remainder of the file contains cryptographic data, encoded first using ASN.1
1227 rules, then encrypted if necessary, and finally written in PEM-encoded
1228 printable ASCII text, preceded and followed by MIME content identifier lines.
1230 <p>The format of the symmetric keys file, ordinarily named
1231 <samp>ntp.keys</samp>,
1232 is somewhat different than the other files in the interest of backward compatibility.
1233 Ordinarily, the file is generated by this program, but it can be constructed
1234 and edited using an ordinary text editor.
1235 </p><pre class="verbatim"># ntpkey_MD5key_bk.ntp.org.3595864945
1236 # Thu Dec 12 19:22:25 2013
1238 1 MD5 L";Nw<\`.I<f4U0)247"i # MD5 key
1239 2 MD5 &>l0%XXK9O'51VwV<xq~ # MD5 key
1240 3 MD5 lb4zLW~d^!K:]RsD'qb6 # MD5 key
1241 4 MD5 Yue:tL[+vR)M\`n~bY,'? # MD5 key
1242 5 MD5 B;fx'Kgr/&4ZTbL6=RxA # MD5 key
1243 6 MD5 4eYwa\`o@}3i@@@@V@@..R9!l # MD5 key
1244 7 MD5 \`A.([h+;wTQ|xfi%Sn_! # MD5 key
1245 8 MD5 45:V,r4]l6y^JH6"Sh?F # MD5 key
1246 9 MD5 3-5vcn*6l29DS?Xdsg)* # MD5 key
1247 10 MD5 2late4Me # MD5 key
1248 11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c # SHA1 key
1249 12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74 # SHA1 key
1250 13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9 # SHA1 key
1251 14 SHA a5332809c8878dd3a5b918819108a111509aeceb # SHA key
1252 15 MD2 2fe16c88c760ff2f16d4267e36c1aa6c926e6964 # MD2 key
1253 16 MD4 b2691811dc19cfc0e2f9bcacd74213f29812183d # MD4 key
1254 17 MD5 e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c # MD5 key
1255 18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc # MDC2 key
1256 19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2 # RIPEMD160 key
1257 20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878 # AES128CMAC key
1258 </pre><div class="example">
1259 <pre class="example">Figure 1. Typical Symmetric Key File
1262 <p>Figure 1 shows a typical symmetric keys file used by the reference
1264 Following the header the keys are entered one per line in the format
1265 </p><div class="example">
1266 <pre class="example"><kbd>keyno</kbd> <kbd>type</kbd> <kbd>key</kbd>
1270 is a positive integer in the range 1-65535;
1272 is the key type for the message digest algorithm, which in the absence of the
1273 OpenSSL library must be
1275 to designate the MD5 message digest algorithm;
1276 if the OpenSSL library is installed, the key type can be any
1277 message digest algorithm supported by that library;
1278 however, if compatibility with FIPS 140-2 is required,
1279 the key type must be either
1285 which is a printable ASCII string 20 characters or less in length:
1286 each character is chosen from the 93 printable characters
1287 in the range 0x21 through 0x7e (
1291 ) excluding space and the
1293 character, and terminated by whitespace or a
1296 An OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
1297 is truncated as necessary.
1299 <p>Note that the keys used by the
1300 <code>ntpq(1ntpqmdoc)</code>
1302 <code>ntpdc(1ntpdcmdoc)</code>
1304 are checked against passwords requested by the programs
1305 and entered by hand, so it is generally appropriate to specify these keys
1306 in human readable ASCII format.
1309 <code>ntp-keygen</code>
1310 program generates a symmetric keys file
1311 <samp>ntpkey_MD5key_</samp><kbd>hostname</kbd>. <kbd>filestamp</kbd>.
1312 Since the file contains private shared keys,
1313 it should be visible only to root and distributed by secure means
1314 to other subnet hosts.
1315 The NTP daemon loads the file
1316 <samp>ntp.keys</samp>,
1318 <code>ntp-keygen</code>
1319 installs a soft link from this name to the generated file.
1320 Subsequently, similar soft links must be installed by manual
1321 or automated means on the other subnet hosts.
1322 While this file is not used with the Autokey Version 2 protocol,
1323 it is needed to authenticate some remote configuration commands
1325 <code>ntpq(1ntpqmdoc)</code>
1327 <code>ntpdc(1ntpdcmdoc)</code>
1330 <p>This section was generated by <strong>AutoGen</strong>,
1331 using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntp-keygen</code> program.
1332 This software is released under the NTP license, <http://ntp.org/license>.
1334 <table class="menu" border="0" cellspacing="0">
1335 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-usage" accesskey="1">ntp-keygen usage</a>:</td><td> </td><td align="left" valign="top">ntp-keygen help/usage (<samp>--help</samp>)
1337 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-imbits" accesskey="2">ntp-keygen imbits</a>:</td><td> </td><td align="left" valign="top">imbits option (-b)
1339 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-certificate" accesskey="3">ntp-keygen certificate</a>:</td><td> </td><td align="left" valign="top">certificate option (-c)
1341 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-cipher" accesskey="4">ntp-keygen cipher</a>:</td><td> </td><td align="left" valign="top">cipher option (-C)
1343 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-id_002dkey" accesskey="5">ntp-keygen id-key</a>:</td><td> </td><td align="left" valign="top">id-key option (-e)
1345 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-gq_002dparams" accesskey="6">ntp-keygen gq-params</a>:</td><td> </td><td align="left" valign="top">gq-params option (-G)
1347 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-host_002dkey" accesskey="7">ntp-keygen host-key</a>:</td><td> </td><td align="left" valign="top">host-key option (-H)
1349 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-iffkey" accesskey="8">ntp-keygen iffkey</a>:</td><td> </td><td align="left" valign="top">iffkey option (-I)
1351 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-ident" accesskey="9">ntp-keygen ident</a>:</td><td> </td><td align="left" valign="top">ident option (-i)
1353 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-lifetime">ntp-keygen lifetime</a>:</td><td> </td><td align="left" valign="top">lifetime option (-l)
1355 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-modulus">ntp-keygen modulus</a>:</td><td> </td><td align="left" valign="top">modulus option (-m)
1357 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-md5key">ntp-keygen md5key</a>:</td><td> </td><td align="left" valign="top">md5key option (-M)
1359 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-pvt_002dcert">ntp-keygen pvt-cert</a>:</td><td> </td><td align="left" valign="top">pvt-cert option (-P)
1361 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-password">ntp-keygen password</a>:</td><td> </td><td align="left" valign="top">password option (-p)
1363 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-export_002dpasswd">ntp-keygen export-passwd</a>:</td><td> </td><td align="left" valign="top">export-passwd option (-q)
1365 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-subject_002dname">ntp-keygen subject-name</a>:</td><td> </td><td align="left" valign="top">subject-name option (-s)
1367 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-sign_002dkey">ntp-keygen sign-key</a>:</td><td> </td><td align="left" valign="top">sign-key option (-S)
1369 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-trusted_002dcert">ntp-keygen trusted-cert</a>:</td><td> </td><td align="left" valign="top">trusted-cert option (-T)
1371 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-mv_002dparams">ntp-keygen mv-params</a>:</td><td> </td><td align="left" valign="top">mv-params option (-V)
1373 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-mv_002dkeys">ntp-keygen mv-keys</a>:</td><td> </td><td align="left" valign="top">mv-keys option (-v)
1375 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-config">ntp-keygen config</a>:</td><td> </td><td align="left" valign="top">presetting/configuring ntp-keygen
1377 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-exit-status">ntp-keygen exit status</a>:</td><td> </td><td align="left" valign="top">exit status
1379 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Usage">ntp-keygen Usage</a>:</td><td> </td><td align="left" valign="top">Usage
1381 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Notes">ntp-keygen Notes</a>:</td><td> </td><td align="left" valign="top">Notes
1383 <tr><td align="left" valign="top">• <a href="#ntp_002dkeygen-Bugs">ntp-keygen Bugs</a>:</td><td> </td><td align="left" valign="top">Bugs
1388 <a name="ntp_002dkeygen-usage"></a>
1389 <div class="header">
1391 Next: <a href="#ntp_002dkeygen-imbits" accesskey="n" rel="next">ntp-keygen imbits</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1393 <a name="ntp_002dkeygen-help_002fusage-_0028_002d_002dhelp_0029"></a>
1394 <h4 class="subsection">1.2.2 ntp-keygen help/usage (<samp>--help</samp>)</h4>
1395 <a name="index-ntp_002dkeygen-help"></a>
1397 <p>This is the automatically generated usage text for ntp-keygen.
1399 <p>The text printed is the same whether selected with the <code>help</code> option
1400 (<samp>--help</samp>) or the <code>more-help</code> option (<samp>--more-help</samp>). <code>more-help</code> will print
1401 the usage text by passing it through a pager program.
1402 <code>more-help</code> is disabled on platforms without a working
1403 <code>fork(2)</code> function. The <code>PAGER</code> environment variable is
1404 used to select the program, defaulting to <samp>more</samp>. Both will exit
1405 with a status code of 0.
1407 <div class="example">
1408 <pre class="example">ntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p12
1409 Usage: ntp-keygen [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
1410 Flg Arg Option-Name Description
1411 -b Num imbits identity modulus bits
1412 - it must be in the range:
1414 -c Str certificate certificate scheme
1415 -C Str cipher privatekey cipher
1416 -d no debug-level Increase debug verbosity level
1417 - may appear multiple times
1418 -D Num set-debug-level Set the debug verbosity level
1419 - may appear multiple times
1420 -e no id-key Write IFF or GQ identity keys
1421 -G no gq-params Generate GQ parameters and keys
1422 -H no host-key generate RSA host key
1423 -I no iffkey generate IFF parameters
1424 -i Str ident set Autokey group name
1425 -l Num lifetime set certificate lifetime
1426 -m Num modulus prime modulus
1427 - it must be in the range:
1429 -M no md5key generate symmetric keys
1430 -P no pvt-cert generate PC private certificate
1431 -p Str password local private password
1432 -q Str export-passwd export IFF or GQ group keys with password
1433 -s Str subject-name set host and optionally group name
1434 -S Str sign-key generate sign key (RSA or DSA)
1435 -T no trusted-cert trusted certificate (TC scheme)
1436 -V Num mv-params generate <num> MV parameters
1437 -v Num mv-keys update <num> MV keys
1438 opt version output version information and exit
1439 -? no help display extended usage information and exit
1440 -! no more-help extended usage information passed thru pager
1441 -> opt save-opts save the option state to a config file
1442 -< Str load-opts load options from a config file
1443 - disabled as '--no-load-opts'
1444 - may appear multiple times
1446 Options are specified by doubled hyphens and their name or by a single
1447 hyphen and the flag character.
1450 The following option preset mechanisms are supported:
1451 - reading file $HOME/.ntprc
1452 - reading file ./.ntprc
1453 - examining environment variables named NTP_KEYGEN_*
1455 Please send bug reports to: <http://bugs.ntp.org, bugs@ntp.org>
1459 <a name="ntp_002dkeygen-imbits"></a>
1460 <div class="header">
1462 Next: <a href="#ntp_002dkeygen-certificate" accesskey="n" rel="next">ntp-keygen certificate</a>, Previous: <a href="#ntp_002dkeygen-usage" accesskey="p" rel="prev">ntp-keygen usage</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1464 <a name="imbits-option-_0028_002db_0029"></a>
1465 <h4 class="subsection">1.2.3 imbits option (-b)</h4>
1466 <a name="index-ntp_002dkeygen_002dimbits"></a>
1468 <p>This is the “identity modulus bits” option.
1469 This option takes a number argument <samp>imbits</samp>.
1471 <p>This option has some usage constraints. It:
1473 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1476 <p>The number of bits in the identity modulus. The default is 256.
1478 <a name="ntp_002dkeygen-certificate"></a>
1479 <div class="header">
1481 Next: <a href="#ntp_002dkeygen-cipher" accesskey="n" rel="next">ntp-keygen cipher</a>, Previous: <a href="#ntp_002dkeygen-imbits" accesskey="p" rel="prev">ntp-keygen imbits</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1483 <a name="certificate-option-_0028_002dc_0029"></a>
1484 <h4 class="subsection">1.2.4 certificate option (-c)</h4>
1485 <a name="index-ntp_002dkeygen_002dcertificate"></a>
1487 <p>This is the “certificate scheme” option.
1488 This option takes a string argument <samp>scheme</samp>.
1490 <p>This option has some usage constraints. It:
1492 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1496 RSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
1497 DSA-SHA, or DSA-SHA1.
1499 <p>Select the certificate signature encryption/message digest scheme.
1500 Note that RSA schemes must be used with a RSA sign key and DSA
1501 schemes must be used with a DSA sign key. The default without
1502 this option is RSA-MD5.
1504 <a name="ntp_002dkeygen-cipher"></a>
1505 <div class="header">
1507 Next: <a href="#ntp_002dkeygen-id_002dkey" accesskey="n" rel="next">ntp-keygen id-key</a>, Previous: <a href="#ntp_002dkeygen-certificate" accesskey="p" rel="prev">ntp-keygen certificate</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1509 <a name="cipher-option-_0028_002dC_0029"></a>
1510 <h4 class="subsection">1.2.5 cipher option (-C)</h4>
1511 <a name="index-ntp_002dkeygen_002dcipher"></a>
1513 <p>This is the “privatekey cipher” option.
1514 This option takes a string argument <samp>cipher</samp>.
1516 <p>This option has some usage constraints. It:
1518 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1521 <p>Select the cipher which is used to encrypt the files containing
1522 private keys. The default is three-key triple DES in CBC mode,
1523 equivalent to "<code>-C des-ede3-cbc</code>". The openssl tool lists ciphers
1524 available in "<code>openssl -h</code>" output.
1526 <a name="ntp_002dkeygen-id_002dkey"></a>
1527 <div class="header">
1529 Next: <a href="#ntp_002dkeygen-gq_002dparams" accesskey="n" rel="next">ntp-keygen gq-params</a>, Previous: <a href="#ntp_002dkeygen-cipher" accesskey="p" rel="prev">ntp-keygen cipher</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1531 <a name="id_002dkey-option-_0028_002de_0029"></a>
1532 <h4 class="subsection">1.2.6 id-key option (-e)</h4>
1533 <a name="index-ntp_002dkeygen_002did_002dkey"></a>
1535 <p>This is the “write iff or gq identity keys” option.
1537 <p>This option has some usage constraints. It:
1539 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1542 <p>Write the public parameters from the IFF or GQ client keys to
1543 the standard output.
1544 This is intended for automatic key distribution by email.
1546 <a name="ntp_002dkeygen-gq_002dparams"></a>
1547 <div class="header">
1549 Next: <a href="#ntp_002dkeygen-host_002dkey" accesskey="n" rel="next">ntp-keygen host-key</a>, Previous: <a href="#ntp_002dkeygen-id_002dkey" accesskey="p" rel="prev">ntp-keygen id-key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1551 <a name="gq_002dparams-option-_0028_002dG_0029"></a>
1552 <h4 class="subsection">1.2.7 gq-params option (-G)</h4>
1553 <a name="index-ntp_002dkeygen_002dgq_002dparams"></a>
1555 <p>This is the “generate gq parameters and keys” option.
1557 <p>This option has some usage constraints. It:
1559 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1562 <p>Generate parameters and keys for the GQ identification scheme,
1563 obsoleting any that may exist.
1565 <a name="ntp_002dkeygen-host_002dkey"></a>
1566 <div class="header">
1568 Next: <a href="#ntp_002dkeygen-iffkey" accesskey="n" rel="next">ntp-keygen iffkey</a>, Previous: <a href="#ntp_002dkeygen-gq_002dparams" accesskey="p" rel="prev">ntp-keygen gq-params</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1570 <a name="host_002dkey-option-_0028_002dH_0029"></a>
1571 <h4 class="subsection">1.2.8 host-key option (-H)</h4>
1572 <a name="index-ntp_002dkeygen_002dhost_002dkey"></a>
1574 <p>This is the “generate rsa host key” option.
1576 <p>This option has some usage constraints. It:
1578 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1581 <p>Generate new host keys, obsoleting any that may exist.
1583 <a name="ntp_002dkeygen-iffkey"></a>
1584 <div class="header">
1586 Next: <a href="#ntp_002dkeygen-ident" accesskey="n" rel="next">ntp-keygen ident</a>, Previous: <a href="#ntp_002dkeygen-host_002dkey" accesskey="p" rel="prev">ntp-keygen host-key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1588 <a name="iffkey-option-_0028_002dI_0029"></a>
1589 <h4 class="subsection">1.2.9 iffkey option (-I)</h4>
1590 <a name="index-ntp_002dkeygen_002diffkey"></a>
1592 <p>This is the “generate iff parameters” option.
1594 <p>This option has some usage constraints. It:
1596 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1599 <p>Generate parameters for the IFF identification scheme, obsoleting
1602 <a name="ntp_002dkeygen-ident"></a>
1603 <div class="header">
1605 Next: <a href="#ntp_002dkeygen-lifetime" accesskey="n" rel="next">ntp-keygen lifetime</a>, Previous: <a href="#ntp_002dkeygen-iffkey" accesskey="p" rel="prev">ntp-keygen iffkey</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1607 <a name="ident-option-_0028_002di_0029"></a>
1608 <h4 class="subsection">1.2.10 ident option (-i)</h4>
1609 <a name="index-ntp_002dkeygen_002dident"></a>
1611 <p>This is the “set autokey group name” option.
1612 This option takes a string argument <samp>group</samp>.
1614 <p>This option has some usage constraints. It:
1616 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1619 <p>Set the optional Autokey group name to name. This is used in
1620 the file name of IFF, GQ, and MV client parameters files. In
1621 that role, the default is the host name if this option is not
1622 provided. The group name, if specified using <code>-i/--ident</code> or
1623 using <code>-s/--subject-name</code> following an ’<code>@</code>’ character,
1624 is also a part of the self-signed host certificate subject and
1625 issuer names in the form <code>host@group</code> and should match the
1626 ’<code>crypto ident</code>’ or ’<code>server ident</code>’ configuration in the
1627 <code>ntpd</code> configuration file.
1629 <a name="ntp_002dkeygen-lifetime"></a>
1630 <div class="header">
1632 Next: <a href="#ntp_002dkeygen-modulus" accesskey="n" rel="next">ntp-keygen modulus</a>, Previous: <a href="#ntp_002dkeygen-ident" accesskey="p" rel="prev">ntp-keygen ident</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1634 <a name="lifetime-option-_0028_002dl_0029"></a>
1635 <h4 class="subsection">1.2.11 lifetime option (-l)</h4>
1636 <a name="index-ntp_002dkeygen_002dlifetime"></a>
1638 <p>This is the “set certificate lifetime” option.
1639 This option takes a number argument <samp>lifetime</samp>.
1641 <p>This option has some usage constraints. It:
1643 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1646 <p>Set the certificate expiration to lifetime days from now.
1648 <a name="ntp_002dkeygen-modulus"></a>
1649 <div class="header">
1651 Next: <a href="#ntp_002dkeygen-md5key" accesskey="n" rel="next">ntp-keygen md5key</a>, Previous: <a href="#ntp_002dkeygen-lifetime" accesskey="p" rel="prev">ntp-keygen lifetime</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1653 <a name="modulus-option-_0028_002dm_0029"></a>
1654 <h4 class="subsection">1.2.12 modulus option (-m)</h4>
1655 <a name="index-ntp_002dkeygen_002dmodulus"></a>
1657 <p>This is the “prime modulus” option.
1658 This option takes a number argument <samp>modulus</samp>.
1660 <p>This option has some usage constraints. It:
1662 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1665 <p>The number of bits in the prime modulus. The default is 512.
1667 <a name="ntp_002dkeygen-md5key"></a>
1668 <div class="header">
1670 Next: <a href="#ntp_002dkeygen-pvt_002dcert" accesskey="n" rel="next">ntp-keygen pvt-cert</a>, Previous: <a href="#ntp_002dkeygen-modulus" accesskey="p" rel="prev">ntp-keygen modulus</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1672 <a name="md5key-option-_0028_002dM_0029"></a>
1673 <h4 class="subsection">1.2.13 md5key option (-M)</h4>
1674 <a name="index-ntp_002dkeygen_002dmd5key"></a>
1676 <p>This is the “generate symmetric keys” option.
1677 Generate symmetric keys, obsoleting any that may exist.
1679 <a name="ntp_002dkeygen-pvt_002dcert"></a>
1680 <div class="header">
1682 Next: <a href="#ntp_002dkeygen-password" accesskey="n" rel="next">ntp-keygen password</a>, Previous: <a href="#ntp_002dkeygen-md5key" accesskey="p" rel="prev">ntp-keygen md5key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1684 <a name="pvt_002dcert-option-_0028_002dP_0029"></a>
1685 <h4 class="subsection">1.2.14 pvt-cert option (-P)</h4>
1686 <a name="index-ntp_002dkeygen_002dpvt_002dcert"></a>
1688 <p>This is the “generate pc private certificate” option.
1690 <p>This option has some usage constraints. It:
1692 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1695 <p>Generate a private certificate. By default, the program generates
1696 public certificates.
1698 <a name="ntp_002dkeygen-password"></a>
1699 <div class="header">
1701 Next: <a href="#ntp_002dkeygen-export_002dpasswd" accesskey="n" rel="next">ntp-keygen export-passwd</a>, Previous: <a href="#ntp_002dkeygen-pvt_002dcert" accesskey="p" rel="prev">ntp-keygen pvt-cert</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1703 <a name="password-option-_0028_002dp_0029"></a>
1704 <h4 class="subsection">1.2.15 password option (-p)</h4>
1705 <a name="index-ntp_002dkeygen_002dpassword"></a>
1707 <p>This is the “local private password” option.
1708 This option takes a string argument <samp>passwd</samp>.
1710 <p>This option has some usage constraints. It:
1712 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1715 <p>Local files containing private data are encrypted with the
1716 DES-CBC algorithm and the specified password. The same password
1717 must be specified to the local ntpd via the "crypto pw password"
1718 configuration command. The default password is the local
1721 <a name="ntp_002dkeygen-export_002dpasswd"></a>
1722 <div class="header">
1724 Next: <a href="#ntp_002dkeygen-subject_002dname" accesskey="n" rel="next">ntp-keygen subject-name</a>, Previous: <a href="#ntp_002dkeygen-password" accesskey="p" rel="prev">ntp-keygen password</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1726 <a name="export_002dpasswd-option-_0028_002dq_0029"></a>
1727 <h4 class="subsection">1.2.16 export-passwd option (-q)</h4>
1728 <a name="index-ntp_002dkeygen_002dexport_002dpasswd"></a>
1730 <p>This is the “export iff or gq group keys with password” option.
1731 This option takes a string argument <samp>passwd</samp>.
1733 <p>This option has some usage constraints. It:
1735 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1738 <p>Export IFF or GQ identity group keys to the standard output,
1739 encrypted with the DES-CBC algorithm and the specified password.
1740 The same password must be specified to the remote ntpd via the
1741 "crypto pw password" configuration command. See also the option
1742 –id-key (-e) for unencrypted exports.
1744 <a name="ntp_002dkeygen-subject_002dname"></a>
1745 <div class="header">
1747 Next: <a href="#ntp_002dkeygen-sign_002dkey" accesskey="n" rel="next">ntp-keygen sign-key</a>, Previous: <a href="#ntp_002dkeygen-export_002dpasswd" accesskey="p" rel="prev">ntp-keygen export-passwd</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1749 <a name="subject_002dname-option-_0028_002ds_0029"></a>
1750 <h4 class="subsection">1.2.17 subject-name option (-s)</h4>
1751 <a name="index-ntp_002dkeygen_002dsubject_002dname"></a>
1753 <p>This is the “set host and optionally group name” option.
1754 This option takes a string argument <samp>host@group</samp>.
1756 <p>This option has some usage constraints. It:
1758 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1761 <p>Set the Autokey host name, and optionally, group name specified
1762 following an ’<code>@</code>’ character. The host name is used in the file
1763 name of generated host and signing certificates, without the
1764 group name. The host name, and if provided, group name are used
1765 in <code>host@group</code> form for the host certificate subject and issuer
1766 fields. Specifying ’<code>-s @group</code>’ is allowed, and results in
1767 leaving the host name unchanged while appending <code>@group</code> to the
1768 subject and issuer fields, as with <code>-i group</code>. The group name, or
1769 if not provided, the host name are also used in the file names
1770 of IFF, GQ, and MV client parameter files.
1772 <a name="ntp_002dkeygen-sign_002dkey"></a>
1773 <div class="header">
1775 Next: <a href="#ntp_002dkeygen-trusted_002dcert" accesskey="n" rel="next">ntp-keygen trusted-cert</a>, Previous: <a href="#ntp_002dkeygen-subject_002dname" accesskey="p" rel="prev">ntp-keygen subject-name</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1777 <a name="sign_002dkey-option-_0028_002dS_0029"></a>
1778 <h4 class="subsection">1.2.18 sign-key option (-S)</h4>
1779 <a name="index-ntp_002dkeygen_002dsign_002dkey"></a>
1781 <p>This is the “generate sign key (rsa or dsa)” option.
1782 This option takes a string argument <samp>sign</samp>.
1784 <p>This option has some usage constraints. It:
1786 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1789 <p>Generate a new sign key of the designated type, obsoleting any
1790 that may exist. By default, the program uses the host key as the
1793 <a name="ntp_002dkeygen-trusted_002dcert"></a>
1794 <div class="header">
1796 Next: <a href="#ntp_002dkeygen-mv_002dparams" accesskey="n" rel="next">ntp-keygen mv-params</a>, Previous: <a href="#ntp_002dkeygen-sign_002dkey" accesskey="p" rel="prev">ntp-keygen sign-key</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1798 <a name="trusted_002dcert-option-_0028_002dT_0029"></a>
1799 <h4 class="subsection">1.2.19 trusted-cert option (-T)</h4>
1800 <a name="index-ntp_002dkeygen_002dtrusted_002dcert"></a>
1802 <p>This is the “trusted certificate (tc scheme)” option.
1804 <p>This option has some usage constraints. It:
1806 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1809 <p>Generate a trusted certificate. By default, the program generates
1810 a non-trusted certificate.
1812 <a name="ntp_002dkeygen-mv_002dparams"></a>
1813 <div class="header">
1815 Next: <a href="#ntp_002dkeygen-mv_002dkeys" accesskey="n" rel="next">ntp-keygen mv-keys</a>, Previous: <a href="#ntp_002dkeygen-trusted_002dcert" accesskey="p" rel="prev">ntp-keygen trusted-cert</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1817 <a name="mv_002dparams-option-_0028_002dV_0029"></a>
1818 <h4 class="subsection">1.2.20 mv-params option (-V)</h4>
1819 <a name="index-ntp_002dkeygen_002dmv_002dparams"></a>
1821 <p>This is the “generate <num> mv parameters” option.
1822 This option takes a number argument <samp>num</samp>.
1824 <p>This option has some usage constraints. It:
1826 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1829 <p>Generate parameters and keys for the Mu-Varadharajan (MV)
1830 identification scheme.
1832 <a name="ntp_002dkeygen-mv_002dkeys"></a>
1833 <div class="header">
1835 Next: <a href="#ntp_002dkeygen-config" accesskey="n" rel="next">ntp-keygen config</a>, Previous: <a href="#ntp_002dkeygen-mv_002dparams" accesskey="p" rel="prev">ntp-keygen mv-params</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1837 <a name="mv_002dkeys-option-_0028_002dv_0029"></a>
1838 <h4 class="subsection">1.2.21 mv-keys option (-v)</h4>
1839 <a name="index-ntp_002dkeygen_002dmv_002dkeys"></a>
1841 <p>This is the “update <num> mv keys” option.
1842 This option takes a number argument <samp>num</samp>.
1844 <p>This option has some usage constraints. It:
1846 <li> must be compiled in by defining <code>AUTOKEY</code> during the compilation.
1849 <p>This option has no ‘<samp>doc</samp>’ documentation.
1853 <a name="ntp_002dkeygen-config"></a>
1854 <div class="header">
1856 Next: <a href="#ntp_002dkeygen-exit-status" accesskey="n" rel="next">ntp-keygen exit status</a>, Previous: <a href="#ntp_002dkeygen-mv_002dkeys" accesskey="p" rel="prev">ntp-keygen mv-keys</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1858 <a name="presetting_002fconfiguring-ntp_002dkeygen"></a>
1859 <h4 class="subsection">1.2.22 presetting/configuring ntp-keygen</h4>
1861 <p>Any option that is not marked as <i>not presettable</i> may be preset by
1862 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
1863 the options listed above in upper case and segmented with underscores.
1864 The <code>NTP-KEYGEN</code> variable will be tokenized and parsed like
1865 the command line. The remaining variables are tested for existence and their
1866 values are treated like option arguments.
1869 <p><code>libopts</code> will search in 2 places for configuration files:
1874 <p>The environment variables <code>HOME</code>, and <code>PWD</code>
1875 are expanded and replaced when <samp>ntp-keygen</samp> runs.
1876 For any of these that are plain files, they are simply processed.
1877 For any that are directories, then a file named <samp>.ntprc</samp> is searched for
1878 within that directory and processed.
1880 <p>Configuration files may be in a wide variety of formats.
1881 The basic format is an option name followed by a value (argument) on the
1882 same line. Values may be separated from the option name with a colon,
1883 equal sign or simply white space. Values may be continued across multiple
1884 lines by escaping the newline with a backslash.
1886 <p>Multiple programs may also share the same initialization file.
1887 Common options are collected at the top, followed by program specific
1888 segments. The segments are separated by lines like:
1889 </p><div class="example">
1890 <pre class="example">[NTP-KEYGEN]
1893 </p><div class="example">
1894 <pre class="example"><?program ntp-keygen>
1896 <p>Do not mix these styles within one configuration file.
1898 <p>Compound values and carefully constructed string values may also be
1899 specified using XML syntax:
1900 </p><div class="example">
1901 <pre class="example"><option-name>
1902 <sub-opt>...&lt;...&gt;...</sub-opt>
1903 </option-name>
1905 <p>yielding an <code>option-name.sub-opt</code> string value of
1906 </p><div class="example">
1907 <pre class="example">"...<...>..."
1909 <p><code>AutoOpts</code> does not track suboptions. You simply note that it is a
1910 hierarchicly valued option. <code>AutoOpts</code> does provide a means for searching
1911 the associated name/value pair list (see: optionFindValue).
1913 <p>The command line options relating to configuration and/or usage help are:
1915 <a name="version-_0028_002d_0029"></a>
1916 <h4 class="subsubheading">version (-)</h4>
1918 <p>Print the program version to standard out, optionally with licensing
1919 information, then exit 0. The optional argument specifies how much licensing
1920 detail to provide. The default is to print just the version. The licensing infomation may be selected with an option argument.
1921 Only the first letter of the argument is examined:
1923 <dl compact="compact">
1924 <dt>‘<samp>version</samp>’</dt>
1925 <dd><p>Only print the version. This is the default.
1927 <dt>‘<samp>copyright</samp>’</dt>
1928 <dd><p>Name the copyright usage licensing terms.
1930 <dt>‘<samp>verbose</samp>’</dt>
1931 <dd><p>Print the full copyright usage licensing terms.
1936 <a name="ntp_002dkeygen-exit-status"></a>
1937 <div class="header">
1939 Next: <a href="#ntp_002dkeygen-Usage" accesskey="n" rel="next">ntp-keygen Usage</a>, Previous: <a href="#ntp_002dkeygen-config" accesskey="p" rel="prev">ntp-keygen config</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1941 <a name="ntp_002dkeygen-exit-status-1"></a>
1942 <h4 class="subsection">1.2.23 ntp-keygen exit status</h4>
1944 <p>One of the following exit values will be returned:
1945 </p><dl compact="compact">
1946 <dt>‘<samp>0 (EXIT_SUCCESS)</samp>’</dt>
1947 <dd><p>Successful program execution.
1949 <dt>‘<samp>1 (EXIT_FAILURE)</samp>’</dt>
1950 <dd><p>The operation failed or the command syntax was not valid.
1952 <dt>‘<samp>66 (EX_NOINPUT)</samp>’</dt>
1953 <dd><p>A specified configuration file could not be loaded.
1955 <dt>‘<samp>70 (EX_SOFTWARE)</samp>’</dt>
1956 <dd><p>libopts had an internal operational error. Please report
1957 it to autogen-users@lists.sourceforge.net. Thank you.
1961 <a name="ntp_002dkeygen-Usage"></a>
1962 <div class="header">
1964 Next: <a href="#ntp_002dkeygen-Notes" accesskey="n" rel="next">ntp-keygen Notes</a>, Previous: <a href="#ntp_002dkeygen-exit-status" accesskey="p" rel="prev">ntp-keygen exit status</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1966 <a name="ntp_002dkeygen-Usage-1"></a>
1967 <h4 class="subsection">1.2.24 ntp-keygen Usage</h4>
1969 <a name="ntp_002dkeygen-Notes"></a>
1970 <div class="header">
1972 Next: <a href="#ntp_002dkeygen-Bugs" accesskey="n" rel="next">ntp-keygen Bugs</a>, Previous: <a href="#ntp_002dkeygen-Usage" accesskey="p" rel="prev">ntp-keygen Usage</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1974 <a name="ntp_002dkeygen-Notes-1"></a>
1975 <h4 class="subsection">1.2.25 ntp-keygen Notes</h4>
1977 <a name="ntp_002dkeygen-Bugs"></a>
1978 <div class="header">
1980 Previous: <a href="#ntp_002dkeygen-Notes" accesskey="p" rel="prev">ntp-keygen Notes</a>, Up: <a href="#ntp_002dkeygen-Invocation" accesskey="u" rel="up">ntp-keygen Invocation</a> </p>
1982 <a name="ntp_002dkeygen-Bugs-1"></a>
1983 <h4 class="subsection">1.2.26 ntp-keygen Bugs</h4>
1986 <a name="Random-Seed-File"></a>
1987 <div class="header">
1989 Next: <a href="#Cryptographic-Data-Files" accesskey="n" rel="next">Cryptographic Data Files</a>, Previous: <a href="#Running-the-Program" accesskey="p" rel="prev">Running the Program</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> </p>
1991 <a name="Random-Seed-File-2"></a>
1992 <h3 class="section">1.3 Random Seed File</h3>
1994 <p>All cryptographically sound key generation schemes must have means to
1995 randomize the entropy seed used to initialize the internal
1996 pseudo-random number generator used by the OpenSSL library routines.
1997 If a site supports ssh, it is very likely that means to do this are
1999 The entropy seed used by the OpenSSL library is contained in a file,
2000 usually called <code>.rnd</code>, which must be available when
2001 starting the <code>ntp-keygen</code> program or <code>ntpd</code> daemon.
2003 <p>The OpenSSL library looks for the file using the path specified by the
2004 <code>RANDFILE</code> environment variable in the user home directory, whether root
2006 If the <code>RANDFILE</code> environment variable is not
2007 present, the library looks for the <code>.rnd</code> file in the user home
2009 Since both the <code>ntp-keygen</code> program and <code>ntpd</code> daemon must run
2010 as root, the logical place to put this file is in <code>/.rnd</code> or
2011 <code>/root/.rnd</code>.
2012 If the file is not available or cannot be written, the program exits
2013 with a message to the system log.
2016 <a name="Cryptographic-Data-Files"></a>
2017 <div class="header">
2019 Previous: <a href="#Random-Seed-File" accesskey="p" rel="prev">Random Seed File</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> </p>
2021 <a name="Cryptographic-Data-Files-2"></a>
2022 <h3 class="section">1.4 Cryptographic Data Files</h3>
2024 <p>File and link names are in the <code>form ntpkey_key_name.fstamp</code>,
2025 where <code>key</code> is the key or parameter type,
2026 <code>name</code> is the host or group name and
2027 <code>fstamp</code> is the filestamp (NTP seconds) when the file was created).
2028 By convention, key names in generated file names include both upper and
2029 lower case characters, while key names in generated link names include
2030 only lower case characters. The filestamp is not used in generated link
2033 <p>The key name is a string defining the cryptographic key type.
2034 Key types include public/private keys host and sign, certificate cert
2035 and several challenge/response key types.
2036 By convention, client files used for
2037 challenges have a par subtype, as in the IFF challenge IFFpar, while
2038 server files for responses have a key subtype, as in the GQ response
2041 <p>All files begin with two nonencrypted lines. The first line contains
2042 the file name in the format <code>ntpkey_key_host.fstamp</code>.
2043 The second line contains the datestamp in conventional Unix date format.
2044 Lines beginning with <code>#</code> are ignored.
2046 <p>The remainder of the file contains cryptographic data encoded first
2047 using ASN.1 rules, then encrypted using the DES-CBC algorithm with
2048 given password and finally written in PEM-encoded printable ASCII text
2049 preceded and followed by MIME content identifier lines.
2051 <p>The format of the symmetric keys file, ordinarily named <code>ntp.keys</code>,
2052 is somewhat different than the other files in the interest of backward
2054 Ordinarily, the file is generated by this program, but
2055 it can be constructed and edited using an ordinary text editor.
2057 <div class="example">
2058 <pre class="example"># ntpkey_MD5key_hms.local.3564038757
2059 # Sun Dec 9 02:45:57 2012
2061 1 MD5 "]!ghT%O;3)WJ,/Nc:>I # MD5 key
2062 2 MD5 lu+H^tF46BKR-6~pV_5 # MD5 key
2063 3 MD5 :lnoVsE%Yz*avh%EtNC # MD5 key
2064 4 MD5 |fdZrf0sF~;w-i^V # MD5 key
2065 5 MD5 IyAG>O"y"LmCRS!*bHC # MD5 key
2066 6 MD5 ">e\A>hT/661ri52,,H # MD5 key
2067 7 MD5 c9x=M'CfLxax9v)PV-si # MD5 key
2068 8 MD5 E|=jvFVov?Bn|Ev=&aK\ # MD5 key
2069 9 MD5 T!c4UT&`(m$+m+B6,`Q0 # MD5 key
2070 10 MD5 JVF/1=)=IFbHbJQz..Cd # MD5 key
2071 11 SHA1 6dea311109529e436c2b4fccae9bc753c16d1b48 # SHA1 key
2072 12 SHA1 7076f373d86c4848c59ff8046e49cb7d614ec394 # SHA1 key
2073 13 SHA1 5f48b1b60591eb01b7cf1d33b7774f08d20262d3 # SHA1 key
2074 14 SHA1 eed5ab9d9497319ec60cf3781d52607e76720178 # SHA1 key
2075 15 SHA1 f283562611a04c964da8126296f5f8e58c3f85de # SHA1 key
2076 16 SHA1 1930da171297dd63549af50b29449de17dcf341f # SHA1 key
2077 17 SHA1 fee892110358cd4382322b889869e750db8e8a8f # SHA1 key
2078 18 SHA1 b5520c9fadd7ad3fd8bfa061c8821b65d029bb37 # SHA1 key
2079 19 SHA1 8c74fb440ec80f453ec6aaa62b9baed0ab723b92 # SHA1 key
2080 20 SHA1 6bc05f734306a189326000970c19b3910f403795 # SHA1 key
2083 <p>Figure 1. Typical Symmetric Key File
2085 <p>Figure 1 shows a typical symmetric keys file used by the reference
2087 Each line of the file contains three fields, first an
2088 integer between 1 and 65535, inclusive, representing the key identifier
2089 used in the server and peer configuration commands.
2090 Next is the key type for the message digest algorithm,
2091 which in the absence of the
2092 OpenSSL library must be MD5 to designate the MD5 message digest
2094 If the OpenSSL library is installed, the key type can be any
2095 message digest algorithm supported by that library.
2097 compatibility with FIPS 140-2 is required, the key type must be either
2099 The key type can be changed using an ASCII text editor.
2101 <p>An MD5 key consists of a printable ASCII string less than or equal to
2102 16 characters and terminated by whitespace or a # character.
2104 key consists of a hex-encoded ASCII string of 40 characters, which is
2105 truncated as necessary.
2107 <p>Note that the keys used by the <code>ntpq</code> and <code>ntpdc</code> programs are
2108 checked against passwords requested by the programs and entered by hand,
2110 is generally appropriate to specify these keys in human readable ASCII
2113 <p>The <code>ntp-keygen</code> program generates a MD5 symmetric keys file
2114 <code>ntpkey_MD5key_hostname.filestamp</code>.
2115 Since the file contains private
2116 shared keys, it should be visible only to root and distributed by
2117 secure means to other subnet hosts.
2118 The NTP daemon loads the file <code>ntp.keys</code>, so <code>ntp-keygen</code>
2119 installs a soft link from this name to the generated file.
2120 Subsequently, similar soft links must be installed by
2121 manual or automated means on the other subnet hosts.
2123 not used with the Autokey Version 2 protocol, it is needed to
2124 authenticate some remote configuration commands used by the <code>ntpq</code> and
2125 <code>ntpdc</code> utilities.