xref: /netbsd-src/external/bsd/ntp/dist/util/invoke-ntp-keygen.texi (revision 897be3a4bac39d8b2e92077bf29f4a2e67d31983)
18585484eSchristos@node ntp-keygen Invocation
28585484eSchristos@section Invoking ntp-keygen
38585484eSchristos@pindex ntp-keygen
48585484eSchristos@cindex Create a NTP host key
58585484eSchristos@ignore
68585484eSchristos#
78585484eSchristos# EDIT THIS FILE WITH CAUTION  (invoke-ntp-keygen.texi)
88585484eSchristos#
9*897be3a4Schristos# It has been AutoGen-ed  May 25, 2024 at 12:04:48 AM by AutoGen 5.18.16
108585484eSchristos# From the definitions    ntp-keygen-opts.def
118585484eSchristos# and the template file   agtexi-cmd.tpl
128585484eSchristos@end ignore
138585484eSchristos
148585484eSchristos
158585484eSchristos
168585484eSchristosThis program generates cryptographic data files used by the NTPv4
178585484eSchristosauthentication and identification schemes.
1856f2724eSchristosIt can generate message digest keys used in symmetric key cryptography and,
1956f2724eSchristosif the OpenSSL software library has been installed, it can generate host keys,
2056f2724eSchristossigning keys, certificates, and identity keys and parameters used in Autokey
2156f2724eSchristospublic key cryptography.
228585484eSchristosThese files are used for cookie encryption,
2356f2724eSchristosdigital signature, and challenge/response identification algorithms
248585484eSchristoscompatible with the Internet standard security infrastructure.
258585484eSchristos
2656f2724eSchristosThe message digest symmetric keys file is generated in a format
2756f2724eSchristoscompatible with NTPv3.
2856f2724eSchristosAll other files are in PEM-encoded printable ASCII format,
2956f2724eSchristosso they can be embedded as MIME attachments in email to other sites
308585484eSchristosand certificate authorities.
318585484eSchristosBy default, files are not encrypted.
328585484eSchristos
3356f2724eSchristosWhen used to generate message digest symmetric keys, the program
3456f2724eSchristosproduces a file containing ten pseudo-random printable ASCII strings
3556f2724eSchristossuitable for the MD5 message digest algorithm included in the
3656f2724eSchristosdistribution.
378585484eSchristosIf the OpenSSL library is installed, it produces an additional ten
3856f2724eSchristoshex-encoded random bit strings suitable for SHA1, AES-128-CMAC, and
3956f2724eSchristosother message digest algorithms.
4056f2724eSchristosThe message digest symmetric keys file must be distributed and stored
418585484eSchristosusing secure means beyond the scope of NTP itself.
428585484eSchristosBesides the keys used for ordinary NTP associations, additional keys
438585484eSchristoscan be defined as passwords for the
448585484eSchristos@code{ntpq(1ntpqmdoc)}
458585484eSchristosand
468585484eSchristos@code{ntpdc(1ntpdcmdoc)}
478585484eSchristosutility programs.
488585484eSchristos
498585484eSchristosThe remaining generated files are compatible with other OpenSSL
508585484eSchristosapplications and other Public Key Infrastructure (PKI) resources.
518585484eSchristosCertificates generated by this program are compatible with extant
528585484eSchristosindustry practice, although some users might find the interpretation of
538585484eSchristosX509v3 extension fields somewhat liberal.
548585484eSchristosHowever, the identity keys are probably not compatible with anything
558585484eSchristosother than Autokey.
568585484eSchristos
578585484eSchristosSome files used by this program are encrypted using a private password.
588585484eSchristosThe
598585484eSchristos@code{-p}
6056f2724eSchristosoption specifies the read password for local encrypted files and the
618585484eSchristos@code{-q}
6256f2724eSchristosoption the write password for encrypted files sent to remote sites.
638585484eSchristosIf no password is specified, the host name returned by the Unix
6456f2724eSchristos@code{hostname(1)}
6556f2724eSchristoscommand, normally the DNS name of the host, is used as the the default read
6656f2724eSchristospassword, for convenience.
6756f2724eSchristosThe
6856f2724eSchristos@code{ntp-keygen}
6956f2724eSchristosprogram prompts for the password if it reads an encrypted file
7056f2724eSchristosand the password is missing or incorrect.
7156f2724eSchristosIf an encrypted file is read successfully and
7256f2724eSchristosno write password is specified, the read password is used
7356f2724eSchristosas the write password by default.
748585484eSchristos
758585484eSchristosThe
7656f2724eSchristos@code{pw}
778585484eSchristosoption of the
7856f2724eSchristos@code{crypto}
7956f2724eSchristos@code{ntpd(1ntpdmdoc)}
808585484eSchristosconfiguration command specifies the read
818585484eSchristospassword for previously encrypted local files.
8256f2724eSchristosThis must match the local read password used by this program.
838585484eSchristosIf not specified, the host name is used.
8456f2724eSchristosThus, if files are generated by this program without an explicit password,
858585484eSchristosthey can be read back by
8656f2724eSchristos@code{ntpd(1ntpdmdoc)}
8756f2724eSchristoswithout specifying an explicit password but only on the same host.
8856f2724eSchristosIf the write password used for encryption is specified as the host name,
8956f2724eSchristosthese files can be read by that host with no explicit password.
908585484eSchristos
918585484eSchristosNormally, encrypted files for each host are generated by that host and
928585484eSchristosused only by that host, although exceptions exist as noted later on
938585484eSchristosthis page.
948585484eSchristosThe symmetric keys file, normally called
9556f2724eSchristos@file{ntp.keys},
968585484eSchristosis usually installed in
978585484eSchristos@file{/etc}.
988585484eSchristosOther files and links are usually installed in
998585484eSchristos@file{/usr/local/etc},
1008585484eSchristoswhich is normally in a shared filesystem in
1018585484eSchristosNFS-mounted networks and cannot be changed by shared clients.
10256f2724eSchristosIn these cases, NFS clients can specify the files in another
10356f2724eSchristosdirectory such as
10456f2724eSchristos@file{/etc}
10556f2724eSchristosusing the
10656f2724eSchristos@code{keysdir}
10756f2724eSchristos@code{ntpd(1ntpdmdoc)}
10856f2724eSchristosconfiguration file command.
1098585484eSchristos
1108585484eSchristosThis program directs commentary and error messages to the standard
1118585484eSchristoserror stream
11256f2724eSchristos@file{stderr}
1138585484eSchristosand remote files to the standard output stream
11456f2724eSchristos@file{stdout}
1158585484eSchristoswhere they can be piped to other applications or redirected to files.
1168585484eSchristosThe names used for generated files and links all begin with the
1178585484eSchristosstring
11856f2724eSchristos@file{ntpkey*}
1198585484eSchristosand include the file type, generating host and filestamp,
1208585484eSchristosas described in the
12156f2724eSchristos@ref{Cryptographic Data Files}
1228585484eSchristossection below.
12356f2724eSchristos
1248585484eSchristos@subsubsection Running the Program
12556f2724eSchristosThe safest way to run the
12656f2724eSchristos@code{ntp-keygen}
12756f2724eSchristosprogram is logged in directly as root.
12856f2724eSchristosThe recommended procedure is change to the
12956f2724eSchristos@kbd{keys}
13056f2724eSchristosdirectory, usually
13156f2724eSchristos@file{/usr/local/etc},
13256f2724eSchristosthen run the program.
13356f2724eSchristos
1348585484eSchristosTo test and gain experience with Autokey concepts, log in as root and
13556f2724eSchristoschange to the
13656f2724eSchristos@kbd{keys}
13756f2724eSchristosdirectory, usually
13856f2724eSchristos@file{/usr/local/etc}.
1398585484eSchristosWhen run for the first time, or if all files with names beginning with
14056f2724eSchristos@file{ntpkey*}
1418585484eSchristoshave been removed, use the
1428585484eSchristos@code{ntp-keygen}
14356f2724eSchristoscommand without arguments to generate a default
14456f2724eSchristos@code{RSA}
14556f2724eSchristoshost key and matching
14656f2724eSchristos@code{RSA-MD5}
14756f2724eSchristoscertificate file with expiration date one year hence,
14856f2724eSchristoswhich is all that is necessary in many cases.
14956f2724eSchristosThe program also generates soft links from the generic names
15056f2724eSchristosto the respective files.
1518585484eSchristosIf run again without options, the program uses the
15256f2724eSchristosexisting keys and parameters and generates a new certificate file with
15356f2724eSchristosnew expiration date one year hence, and soft link.
15456f2724eSchristos
15556f2724eSchristosThe host key is used to encrypt the cookie when required and so must be
15656f2724eSchristos@code{RSA}
15756f2724eSchristostype.
15856f2724eSchristosBy default, the host key is also the sign key used to encrypt signatures.
15956f2724eSchristosWhen necessary, a different sign key can be specified and this can be
16056f2724eSchristoseither
16156f2724eSchristos@code{RSA}
16256f2724eSchristosor
16356f2724eSchristos@code{DSA}
16456f2724eSchristostype.
16556f2724eSchristosBy default, the message digest type is
16656f2724eSchristos@code{MD5},
16756f2724eSchristosbut any combination
16856f2724eSchristosof sign key type and message digest type supported by the OpenSSL library
16956f2724eSchristoscan be specified, including those using the
17056f2724eSchristos@code{AES128CMAC}, @code{MD2}, @code{MD5}, @code{MDC2}, @code{SHA}, @code{SHA1}
17156f2724eSchristosand
17256f2724eSchristos@code{RIPE160}
17356f2724eSchristosmessage digest algorithms.
17456f2724eSchristosHowever, the scheme specified in the certificate must be compatible
17556f2724eSchristoswith the sign key.
17656f2724eSchristosCertificates using any digest algorithm are compatible with
17756f2724eSchristos@code{RSA}
17856f2724eSchristossign keys;
17956f2724eSchristoshowever, only
18056f2724eSchristos@code{SHA}
18156f2724eSchristosand
18256f2724eSchristos@code{SHA1}
18356f2724eSchristoscertificates are compatible with
18456f2724eSchristos@code{DSA}
18556f2724eSchristossign keys.
18656f2724eSchristos
18756f2724eSchristosPrivate/public key files and certificates are compatible with
18856f2724eSchristosother OpenSSL applications and very likely other libraries as well.
18956f2724eSchristosCertificates or certificate requests derived from them should be compatible
19056f2724eSchristoswith extant industry practice, although some users might find
19156f2724eSchristosthe interpretation of X509v3 extension fields somewhat liberal.
19256f2724eSchristosHowever, the identification parameter files, although encoded
19356f2724eSchristosas the other files, are probably not compatible with anything other than Autokey.
19456f2724eSchristos
19556f2724eSchristosRunning the program as other than root and using the Unix
19656f2724eSchristos@code{su(1)}
19756f2724eSchristoscommand
19856f2724eSchristosto assume root may not work properly, since by default the OpenSSL library
19956f2724eSchristoslooks for the random seed file
20056f2724eSchristos@file{.rnd}
20156f2724eSchristosin the user home directory.
20256f2724eSchristosHowever, there should be only one
20356f2724eSchristos@file{.rnd},
20456f2724eSchristosmost conveniently
20556f2724eSchristosin the root directory, so it is convenient to define the
20656f2724eSchristos.Ev RANDFILE
20756f2724eSchristosenvironment variable used by the OpenSSL library as the path to
20856f2724eSchristos@file{.rnd}.
20956f2724eSchristos
21056f2724eSchristosInstalling the keys as root might not work in NFS-mounted
21156f2724eSchristosshared file systems, as NFS clients may not be able to write
21256f2724eSchristosto the shared keys directory, even as root.
21356f2724eSchristosIn this case, NFS clients can specify the files in another
21456f2724eSchristosdirectory such as
21556f2724eSchristos@file{/etc}
21656f2724eSchristosusing the
21756f2724eSchristos@code{keysdir}
21856f2724eSchristos@code{ntpd(1ntpdmdoc)}
21956f2724eSchristosconfiguration file command.
22056f2724eSchristosThere is no need for one client to read the keys and certificates
22156f2724eSchristosof other clients or servers, as these data are obtained automatically
22256f2724eSchristosby the Autokey protocol.
22356f2724eSchristos
22456f2724eSchristosOrdinarily, cryptographic files are generated by the host that uses them,
22556f2724eSchristosbut it is possible for a trusted agent (TA) to generate these files
22656f2724eSchristosfor other hosts; however, in such cases files should always be encrypted.
22756f2724eSchristosThe subject name and trusted name default to the hostname
22856f2724eSchristosof the host generating the files, but can be changed by command line options.
22956f2724eSchristosIt is convenient to designate the owner name and trusted name
23056f2724eSchristosas the subject and issuer fields, respectively, of the certificate.
23156f2724eSchristosThe owner name is also used for the host and sign key files,
23256f2724eSchristoswhile the trusted name is used for the identity files.
23356f2724eSchristos
23456f2724eSchristosAll files are installed by default in the keys directory
23556f2724eSchristos@file{/usr/local/etc},
23656f2724eSchristoswhich is normally in a shared filesystem
23756f2724eSchristosin NFS-mounted networks.
23856f2724eSchristosThe actual location of the keys directory
23956f2724eSchristosand each file can be overridden by configuration commands,
24056f2724eSchristosbut this is not recommended.
24156f2724eSchristosNormally, the files for each host are generated by that host
24256f2724eSchristosand used only by that host, although exceptions exist
24356f2724eSchristosas noted later on this page.
24456f2724eSchristos
24556f2724eSchristosNormally, files containing private values,
24656f2724eSchristosincluding the host key, sign key and identification parameters,
24756f2724eSchristosare permitted root read/write-only;
24856f2724eSchristoswhile others containing public values are permitted world readable.
24956f2724eSchristosAlternatively, files containing private values can be encrypted
25056f2724eSchristosand these files permitted world readable,
25156f2724eSchristoswhich simplifies maintenance in shared file systems.
25256f2724eSchristosSince uniqueness is insured by the
25356f2724eSchristos@kbd{hostname}
25456f2724eSchristosand
25556f2724eSchristos@kbd{filestamp}
25656f2724eSchristosfile name extensions, the files for an NTP server and
25756f2724eSchristosdependent clients can all be installed in the same shared directory.
25856f2724eSchristos
25956f2724eSchristosThe recommended practice is to keep the file name extensions
26056f2724eSchristoswhen installing a file and to install a soft link
26156f2724eSchristosfrom the generic names specified elsewhere on this page
26256f2724eSchristosto the generated files.
26356f2724eSchristosThis allows new file generations to be activated simply
26456f2724eSchristosby changing the link.
26556f2724eSchristosIf a link is present,
26656f2724eSchristos@code{ntpd(1ntpdmdoc)}
26756f2724eSchristosfollows it to the file name to extract the
26856f2724eSchristos@kbd{filestamp}.
26956f2724eSchristosIf a link is not present,
27056f2724eSchristos@code{ntpd(1ntpdmdoc)}
27156f2724eSchristosextracts the
27256f2724eSchristos@kbd{filestamp}
27356f2724eSchristosfrom the file itself.
27456f2724eSchristosThis allows clients to verify that the file and generation times
27556f2724eSchristosare always current.
27656f2724eSchristosThe
27756f2724eSchristos@code{ntp-keygen}
27856f2724eSchristosprogram uses the same
27956f2724eSchristos@kbd{filestamp}
28056f2724eSchristosextension for all files generated
28156f2724eSchristosat one time, so each generation is distinct and can be readily
28256f2724eSchristosrecognized in monitoring data.
2838585484eSchristos
2848585484eSchristosRun the command on as many hosts as necessary.
2858585484eSchristosDesignate one of them as the trusted host (TH) using
2868585484eSchristos@code{ntp-keygen}
2878585484eSchristoswith the
2888585484eSchristos@code{-T}
2898585484eSchristosoption and configure it to synchronize from reliable Internet servers.
2908585484eSchristosThen configure the other hosts to synchronize to the TH directly or
2918585484eSchristosindirectly.
2928585484eSchristosA certificate trail is created when Autokey asks the immediately
2938585484eSchristosascendant host towards the TH to sign its certificate, which is then
2948585484eSchristosprovided to the immediately descendant host on request.
2958585484eSchristosAll group hosts should have acyclic certificate trails ending on the TH.
2968585484eSchristos
2978585484eSchristosThe host key is used to encrypt the cookie when required and so must be
2988585484eSchristosRSA type.
2998585484eSchristosBy default, the host key is also the sign key used to encrypt
3008585484eSchristossignatures.
3018585484eSchristosA different sign key can be assigned using the
3028585484eSchristos@code{-S}
30356f2724eSchristosoption and this can be either
30456f2724eSchristos@code{RSA}
30556f2724eSchristosor
30656f2724eSchristos@code{DSA}
30756f2724eSchristostype.
3088585484eSchristosBy default, the signature
30956f2724eSchristosmessage digest type is
31056f2724eSchristos@code{MD5},
31156f2724eSchristosbut any combination of sign key type and
3128585484eSchristosmessage digest type supported by the OpenSSL library can be specified
3138585484eSchristosusing the
3148585484eSchristos@code{-c}
3158585484eSchristosoption.
31656f2724eSchristos
3178585484eSchristosThe rules say cryptographic media should be generated with proventic
3188585484eSchristosfilestamps, which means the host should already be synchronized before
3198585484eSchristosthis program is run.
3208585484eSchristosThis of course creates a chicken-and-egg problem
3218585484eSchristoswhen the host is started for the first time.
3228585484eSchristosAccordingly, the host time
3238585484eSchristosshould be set by some other means, such as eyeball-and-wristwatch, at
3248585484eSchristosleast so that the certificate lifetime is within the current year.
3258585484eSchristosAfter that and when the host is synchronized to a proventic source, the
3268585484eSchristoscertificate should be re-generated.
3278585484eSchristos
3288585484eSchristosAdditional information on trusted groups and identity schemes is on the
3298585484eSchristos@quotedblleft{}Autokey Public-Key Authentication@quotedblright{}
3308585484eSchristospage.
3318585484eSchristos
3328585484eSchristosFile names begin with the prefix
33356f2724eSchristos@file{ntpkey}_
33456f2724eSchristosand end with the suffix
33556f2724eSchristos@file{_}@kbd{hostname}. @kbd{filestamp},
3368585484eSchristoswhere
3378585484eSchristos@kbd{hostname}
3388585484eSchristosis the owner name, usually the string returned
33956f2724eSchristosby the Unix
34056f2724eSchristos@code{hostname(1)}
34156f2724eSchristoscommand, and
3428585484eSchristos@kbd{filestamp}
3438585484eSchristosis the NTP seconds when the file was generated, in decimal digits.
3448585484eSchristosThis both guarantees uniqueness and simplifies maintenance
3458585484eSchristosprocedures, since all files can be quickly removed
3468585484eSchristosby a
34756f2724eSchristos@code{rm} @file{ntpkey*}
3488585484eSchristoscommand or all files generated
3498585484eSchristosat a specific time can be removed by a
35056f2724eSchristos@code{rm} @file{*}@kbd{filestamp}
3518585484eSchristoscommand.
3528585484eSchristosTo further reduce the risk of misconfiguration,
3538585484eSchristosthe first two lines of a file contain the file name
3548585484eSchristosand generation date and time as comments.
3558585484eSchristos
35656f2724eSchristos@subsubsection Trusted Hosts and Groups
3578585484eSchristosEach cryptographic configuration involves selection of a signature scheme
3588585484eSchristosand identification scheme, called a cryptotype,
3598585484eSchristosas explained in the
3608585484eSchristos@ref{Authentication Options}
3618585484eSchristossection of
3628585484eSchristos@code{ntp.conf(5)}.
36356f2724eSchristosThe default cryptotype uses
36456f2724eSchristos@code{RSA}
36556f2724eSchristosencryption,
36656f2724eSchristos@code{MD5}
36756f2724eSchristosmessage digest
36856f2724eSchristosand
36956f2724eSchristos@code{TC}
37056f2724eSchristosidentification.
3718585484eSchristosFirst, configure a NTP subnet including one or more low-stratum
3728585484eSchristostrusted hosts from which all other hosts derive synchronization
3738585484eSchristosdirectly or indirectly.
3748585484eSchristosTrusted hosts have trusted certificates;
3758585484eSchristosall other hosts have nontrusted certificates.
3768585484eSchristosThese hosts will automatically and dynamically build authoritative
3778585484eSchristoscertificate trails to one or more trusted hosts.
3788585484eSchristosA trusted group is the set of all hosts that have, directly or indirectly,
3798585484eSchristosa certificate trail ending at a trusted host.
3808585484eSchristosThe trail is defined by static configuration file entries
3818585484eSchristosor dynamic means described on the
3828585484eSchristos@ref{Automatic NTP Configuration Options}
3838585484eSchristossection of
3848585484eSchristos@code{ntp.conf(5)}.
3858585484eSchristos
3868585484eSchristosOn each trusted host as root, change to the keys directory.
3878585484eSchristosTo insure a fresh fileset, remove all
38856f2724eSchristos@file{ntpkey}
3898585484eSchristosfiles.
3908585484eSchristosThen run
3918585484eSchristos@code{ntp-keygen}
3928585484eSchristos@code{-T}
3938585484eSchristosto generate keys and a trusted certificate.
3948585484eSchristosOn all other hosts do the same, but leave off the
3958585484eSchristos@code{-T}
3968585484eSchristosflag to generate keys and nontrusted certificates.
3978585484eSchristosWhen complete, start the NTP daemons beginning at the lowest stratum
3988585484eSchristosand working up the tree.
3998585484eSchristosIt may take some time for Autokey to instantiate the certificate trails
4008585484eSchristosthroughout the subnet, but setting up the environment is completely automatic.
4018585484eSchristos
4028585484eSchristosIf it is necessary to use a different sign key or different digest/signature
4038585484eSchristosscheme than the default, run
4048585484eSchristos@code{ntp-keygen}
4058585484eSchristoswith the
4068585484eSchristos@code{-S} @kbd{type}
4078585484eSchristosoption, where
4088585484eSchristos@kbd{type}
4098585484eSchristosis either
4108585484eSchristos@code{RSA}
4118585484eSchristosor
4128585484eSchristos@code{DSA}.
41356f2724eSchristosThe most frequent need to do this is when a
41456f2724eSchristos@code{DSA}-signed
41556f2724eSchristoscertificate is used.
4168585484eSchristosIf it is necessary to use a different certificate scheme than the default,
4178585484eSchristosrun
4188585484eSchristos@code{ntp-keygen}
4198585484eSchristoswith the
4208585484eSchristos@code{-c} @kbd{scheme}
4218585484eSchristosoption and selected
4228585484eSchristos@kbd{scheme}
4238585484eSchristosas needed.
42456f2724eSchristosIf
4258585484eSchristos@code{ntp-keygen}
4268585484eSchristosis run again without these options, it generates a new certificate
42756f2724eSchristosusing the same scheme and sign key, and soft link.
4288585484eSchristos
4298585484eSchristosAfter setting up the environment it is advisable to update certificates
4308585484eSchristosfrom time to time, if only to extend the validity interval.
4318585484eSchristosSimply run
4328585484eSchristos@code{ntp-keygen}
4338585484eSchristoswith the same flags as before to generate new certificates
43456f2724eSchristosusing existing keys, and soft links.
4358585484eSchristosHowever, if the host or sign key is changed,
4368585484eSchristos@code{ntpd(1ntpdmdoc)}
4378585484eSchristosshould be restarted.
4388585484eSchristosWhen
4398585484eSchristos@code{ntpd(1ntpdmdoc)}
4408585484eSchristosis restarted, it loads any new files and restarts the protocol.
4418585484eSchristosOther dependent hosts will continue as usual until signatures are refreshed,
4428585484eSchristosat which time the protocol is restarted.
44356f2724eSchristos
4448585484eSchristos@subsubsection Identity Schemes
4458585484eSchristosAs mentioned on the Autonomous Authentication page,
44656f2724eSchristosthe default
44756f2724eSchristos@code{TC}
44856f2724eSchristosidentity scheme is vulnerable to a middleman attack.
4498585484eSchristosHowever, there are more secure identity schemes available,
45056f2724eSchristosincluding
45156f2724eSchristos@code{PC}, @code{IFF}, @code{GQ}
45256f2724eSchristosand
45356f2724eSchristos@code{MV}
45456f2724eSchristosschemes described below.
4558585484eSchristosThese schemes are based on a TA, one or more trusted hosts
4568585484eSchristosand some number of nontrusted hosts.
4578585484eSchristosTrusted hosts prove identity using values provided by the TA,
4588585484eSchristoswhile the remaining hosts prove identity using values provided
4598585484eSchristosby a trusted host and certificate trails that end on that host.
4608585484eSchristosThe name of a trusted host is also the name of its sugroup
4618585484eSchristosand also the subject and issuer name on its trusted certificate.
4628585484eSchristosThe TA is not necessarily a trusted host in this sense, but often is.
4638585484eSchristos
4648585484eSchristosIn some schemes there are separate keys for servers and clients.
4658585484eSchristosA server can also be a client of another server,
4668585484eSchristosbut a client can never be a server for another client.
4678585484eSchristosIn general, trusted hosts and nontrusted hosts that operate
4688585484eSchristosas both server and client have parameter files that contain
4698585484eSchristosboth server and client keys.
4708585484eSchristosHosts that operate
4718585484eSchristosonly as clients have key files that contain only client keys.
4728585484eSchristos
4738585484eSchristosThe PC scheme supports only one trusted host in the group.
4748585484eSchristosOn trusted host alice run
4758585484eSchristos@code{ntp-keygen}
4768585484eSchristos@code{-P}
4778585484eSchristos@code{-p} @kbd{password}
4788585484eSchristosto generate the host key file
47956f2724eSchristos@file{ntpkey}_ @code{RSA} @file{key_alice.} @kbd{filestamp}
4808585484eSchristosand trusted private certificate file
48156f2724eSchristos@file{ntpkey}_ @code{RSA-MD5} @code{_} @file{cert_alice.} @kbd{filestamp},
48256f2724eSchristosand soft links.
4838585484eSchristosCopy both files to all group hosts;
4848585484eSchristosthey replace the files which would be generated in other schemes.
48556f2724eSchristosOn each host
48656f2724eSchristos@kbd{bob}
48756f2724eSchristosinstall a soft link from the generic name
4888585484eSchristos@file{ntpkey_host_}@kbd{bob}
4898585484eSchristosto the host key file and soft link
4908585484eSchristos@file{ntpkey_cert_}@kbd{bob}
4918585484eSchristosto the private certificate file.
4928585484eSchristosNote the generic links are on bob, but point to files generated
4938585484eSchristosby trusted host alice.
4948585484eSchristosIn this scheme it is not possible to refresh
4958585484eSchristoseither the keys or certificates without copying them
49656f2724eSchristosto all other hosts in the group, and recreating the soft links.
4978585484eSchristos
49856f2724eSchristosFor the
49956f2724eSchristos@code{IFF}
50056f2724eSchristosscheme proceed as in the
50156f2724eSchristos@code{TC}
50256f2724eSchristosscheme to generate keys
5038585484eSchristosand certificates for all group hosts, then for every trusted host in the group,
50456f2724eSchristosgenerate the
50556f2724eSchristos@code{IFF}
50656f2724eSchristosparameter file.
5078585484eSchristosOn trusted host alice run
5088585484eSchristos@code{ntp-keygen}
5098585484eSchristos@code{-T}
5108585484eSchristos@code{-I}
5118585484eSchristos@code{-p} @kbd{password}
5128585484eSchristosto produce her parameter file
51356f2724eSchristos@file{ntpkey_IFFpar_alice.}@kbd{filestamp},
5148585484eSchristoswhich includes both server and client keys.
5158585484eSchristosCopy this file to all group hosts that operate as both servers
5168585484eSchristosand clients and install a soft link from the generic
51756f2724eSchristos@file{ntpkey_iff_alice}
5188585484eSchristosto this file.
5198585484eSchristosIf there are no hosts restricted to operate only as clients,
5208585484eSchristosthere is nothing further to do.
52156f2724eSchristosAs the
52256f2724eSchristos@code{IFF}
52356f2724eSchristosscheme is independent
5248585484eSchristosof keys and certificates, these files can be refreshed as needed.
5258585484eSchristos
5268585484eSchristosIf a rogue client has the parameter file, it could masquerade
5278585484eSchristosas a legitimate server and present a middleman threat.
5288585484eSchristosTo eliminate this threat, the client keys can be extracted
5298585484eSchristosfrom the parameter file and distributed to all restricted clients.
5308585484eSchristosAfter generating the parameter file, on alice run
5318585484eSchristos@code{ntp-keygen}
5328585484eSchristos@code{-e}
53356f2724eSchristosand pipe the output to a file or email program.
53456f2724eSchristosCopy or email this file to all restricted clients.
5358585484eSchristosOn these clients install a soft link from the generic
53656f2724eSchristos@file{ntpkey_iff_alice}
5378585484eSchristosto this file.
5388585484eSchristosTo further protect the integrity of the keys,
5398585484eSchristoseach file can be encrypted with a secret password.
5408585484eSchristos
54156f2724eSchristosFor the
54256f2724eSchristos@code{GQ}
54356f2724eSchristosscheme proceed as in the
54456f2724eSchristos@code{TC}
54556f2724eSchristosscheme to generate keys
5468585484eSchristosand certificates for all group hosts, then for every trusted host
54756f2724eSchristosin the group, generate the
54856f2724eSchristos@code{IFF}
54956f2724eSchristosparameter file.
5508585484eSchristosOn trusted host alice run
5518585484eSchristos@code{ntp-keygen}
5528585484eSchristos@code{-T}
5538585484eSchristos@code{-G}
5548585484eSchristos@code{-p} @kbd{password}
5558585484eSchristosto produce her parameter file
55656f2724eSchristos@file{ntpkey_GQpar_alice.}@kbd{filestamp},
5578585484eSchristoswhich includes both server and client keys.
5588585484eSchristosCopy this file to all group hosts and install a soft link
5598585484eSchristosfrom the generic
56056f2724eSchristos@file{ntpkey_gq_alice}
5618585484eSchristosto this file.
56256f2724eSchristosIn addition, on each host
56356f2724eSchristos@kbd{bob}
56456f2724eSchristosinstall a soft link
5658585484eSchristosfrom generic
5668585484eSchristos@file{ntpkey_gq_}@kbd{bob}
5678585484eSchristosto this file.
56856f2724eSchristosAs the
56956f2724eSchristos@code{GQ}
57056f2724eSchristosscheme updates the
57156f2724eSchristos@code{GQ}
57256f2724eSchristosparameters file and certificate
5738585484eSchristosat the same time, keys and certificates can be regenerated as needed.
5748585484eSchristos
57556f2724eSchristosFor the
57656f2724eSchristos@code{MV}
57756f2724eSchristosscheme, proceed as in the
57856f2724eSchristos@code{TC}
57956f2724eSchristosscheme to generate keys
5808585484eSchristosand certificates for all group hosts.
5818585484eSchristosFor illustration assume trish is the TA, alice one of several trusted hosts
5828585484eSchristosand bob one of her clients.
5838585484eSchristosOn TA trish run
5848585484eSchristos@code{ntp-keygen}
5858585484eSchristos@code{-V} @kbd{n}
5868585484eSchristos@code{-p} @kbd{password},
5878585484eSchristoswhere
5888585484eSchristos@kbd{n}
5898585484eSchristosis the number of revokable keys (typically 5) to produce
5908585484eSchristosthe parameter file
59156f2724eSchristos@file{ntpkeys_MVpar_trish.}@kbd{filestamp}
5928585484eSchristosand client key files
59356f2724eSchristos@file{ntpkeys_MVkey}@kbd{d} @kbd{_} @file{trish.} @kbd{filestamp}
5948585484eSchristoswhere
5958585484eSchristos@kbd{d}
5968585484eSchristosis the key number (0 <
5978585484eSchristos@kbd{d}
5988585484eSchristos<
5998585484eSchristos@kbd{n}).
6008585484eSchristosCopy the parameter file to alice and install a soft link
6018585484eSchristosfrom the generic
60256f2724eSchristos@file{ntpkey_mv_alice}
6038585484eSchristosto this file.
6048585484eSchristosCopy one of the client key files to alice for later distribution
6058585484eSchristosto her clients.
60656f2724eSchristosIt does not matter which client key file goes to alice,
6078585484eSchristossince they all work the same way.
60856f2724eSchristosAlice copies the client key file to all of her clients.
6098585484eSchristosOn client bob install a soft link from generic
61056f2724eSchristos@file{ntpkey_mvkey_bob}
6118585484eSchristosto the client key file.
61256f2724eSchristosAs the
61356f2724eSchristos@code{MV}
61456f2724eSchristosscheme is independent of keys and certificates,
6158585484eSchristosthese files can be refreshed as needed.
61656f2724eSchristos
6178585484eSchristos@subsubsection Command Line Options
6188585484eSchristos@table @asis
61956f2724eSchristos@item @code{-b} @code{--imbits}= @kbd{modulus}
62056f2724eSchristosSet the number of bits in the identity modulus for generating identity keys to
62156f2724eSchristos@kbd{modulus}
62256f2724eSchristosbits.
62356f2724eSchristosThe number of bits in the identity modulus defaults to 256, but can be set to
62456f2724eSchristosvalues from 256 to 2048 (32 to 256 octets).
62556f2724eSchristosUse the larger moduli with caution, as this can consume considerable computing
62656f2724eSchristosresources and increases the size of authenticated packets.
62756f2724eSchristos@item @code{-c} @code{--certificate}= @kbd{scheme}
62856f2724eSchristosSelect certificate signature encryption/message digest scheme.
6298585484eSchristosThe
6308585484eSchristos@kbd{scheme}
6318585484eSchristoscan be one of the following:
63256f2724eSchristos@code{RSA-MD2}, @code{RSA-MD5}, @code{RSA-MDC2}, @code{RSA-SHA}, @code{RSA-SHA1}, @code{RSA-RIPEMD160}, @code{DSA-SHA},
6338585484eSchristosor
6348585484eSchristos@code{DSA-SHA1}.
63556f2724eSchristosNote that
63656f2724eSchristos@code{RSA}
63756f2724eSchristosschemes must be used with an
63856f2724eSchristos@code{RSA}
63956f2724eSchristossign key and
64056f2724eSchristos@code{DSA}
64156f2724eSchristosschemes must be used with a
64256f2724eSchristos@code{DSA}
64356f2724eSchristossign key.
6448585484eSchristosThe default without this option is
6458585484eSchristos@code{RSA-MD5}.
64656f2724eSchristosIf compatibility with FIPS 140-2 is required, either the
64756f2724eSchristos@code{DSA-SHA}
64856f2724eSchristosor
64956f2724eSchristos@code{DSA-SHA1}
65056f2724eSchristosscheme must be used.
65156f2724eSchristos@item @code{-C} @code{--cipher}= @kbd{cipher}
65256f2724eSchristosSelect the OpenSSL cipher to encrypt the files containing private keys.
65356f2724eSchristosThe default without this option is three-key triple DES in CBC mode,
65456f2724eSchristos@code{des-ede3-cbc}.
65556f2724eSchristosThe
65656f2724eSchristos@code{openssl} @code{-h}
65756f2724eSchristoscommand provided with OpenSSL displays available ciphers.
65856f2724eSchristos@item @code{-d} @code{--debug-level}
65956f2724eSchristosIncrease debugging verbosity level.
6608585484eSchristosThis option displays the cryptographic data produced in eye-friendly billboards.
66156f2724eSchristos@item @code{-D} @code{--set-debug-level}= @kbd{level}
66256f2724eSchristosSet the debugging verbosity to
66356f2724eSchristos@kbd{level}.
66456f2724eSchristosThis option displays the cryptographic data produced in eye-friendly billboards.
66556f2724eSchristos@item @code{-e} @code{--id-key}
66656f2724eSchristosWrite the
66756f2724eSchristos@code{IFF}
66856f2724eSchristosor
66956f2724eSchristos@code{GQ}
67056f2724eSchristospublic parameters from the
67156f2724eSchristos@kbd{IFFkey} @kbd{or} @kbd{GQkey}
67256f2724eSchristosclient keys file previously specified
67356f2724eSchristosas unencrypted data to the standard output stream
67456f2724eSchristos@file{stdout}.
67556f2724eSchristosThis is intended for automatic key distribution by email.
67656f2724eSchristos@item @code{-G} @code{--gq-params}
67756f2724eSchristosGenerate a new encrypted
67856f2724eSchristos@code{GQ}
67956f2724eSchristosparameters and key file for the Guillou-Quisquater (GQ) identity scheme.
68056f2724eSchristosThis option is mutually exclusive with the
68156f2724eSchristos@code{-I}
68256f2724eSchristosand
68356f2724eSchristos@code{-V}
68456f2724eSchristosoptions.
68556f2724eSchristos@item @code{-H} @code{--host-key}
68656f2724eSchristosGenerate a new encrypted
68756f2724eSchristos@code{RSA}
68856f2724eSchristospublic/private host key file.
68956f2724eSchristos@item @code{-I} @code{--iffkey}
69056f2724eSchristosGenerate a new encrypted
69156f2724eSchristos@code{IFF}
69256f2724eSchristoskey file for the Schnorr (IFF) identity scheme.
69356f2724eSchristosThis option is mutually exclusive with the
69456f2724eSchristos@code{-G}
69556f2724eSchristosand
69656f2724eSchristosFl V
69756f2724eSchristosoptions.
69856f2724eSchristos@item @code{-i} @code{--ident}= @kbd{group}
69956f2724eSchristosSet the optional Autokey group name to
70056f2724eSchristos@kbd{group}.
70156f2724eSchristosThis is used in the identity scheme parameter file names of
70256f2724eSchristos@code{IFF}, @code{GQ},
70356f2724eSchristosand
70456f2724eSchristos@code{MV}
70556f2724eSchristosclient parameters files.
70656f2724eSchristosIn that role, the default is the host name if no group is provided.
70756f2724eSchristosThe group name, if specified using
70856f2724eSchristos@code{-i}
70956f2724eSchristosor
71056f2724eSchristos@code{-s}
71156f2724eSchristosfollowing an
71256f2724eSchristos@quoteleft{}@@@quoteright{}
71356f2724eSchristoscharacter, is also used in certificate subject and issuer names in the form
71456f2724eSchristos@kbd{host} @kbd{@@} @kbd{group}
71556f2724eSchristosand should match the group specified via
71656f2724eSchristos@code{crypto} @code{ident}
71756f2724eSchristosor
71856f2724eSchristos@code{server} @code{ident}
71956f2724eSchristosin the ntpd configuration file.
72056f2724eSchristos@item @code{-l} @code{--lifetime}= @kbd{days}
72156f2724eSchristosSet the lifetime for certificate expiration to
72256f2724eSchristos@kbd{days}.
72356f2724eSchristosThe default lifetime is one year (365 days).
72456f2724eSchristos@item @code{-m} @code{--modulus}= @kbd{bits}
72556f2724eSchristosSet the number of bits in the prime modulus for generating files to
72656f2724eSchristos@kbd{bits}.
72756f2724eSchristosThe modulus defaults to 512, but can be set from 256 to 2048 (32 to 256 octets).
72856f2724eSchristosUse the larger moduli with caution, as this can consume considerable computing
72956f2724eSchristosresources and increases the size of authenticated packets.
73056f2724eSchristos@item @code{-M} @code{--md5key}
73156f2724eSchristosGenerate a new symmetric keys file containing 10
73256f2724eSchristos@code{MD5}
73356f2724eSchristoskeys, and if OpenSSL is available, 10
73456f2724eSchristos@code{SHA}
73556f2724eSchristoskeys.
73656f2724eSchristosAn
73756f2724eSchristos@code{MD5}
73856f2724eSchristoskey is a string of 20 random printable ASCII characters, while a
73956f2724eSchristos@code{SHA}
74056f2724eSchristoskey is a string of 40 random hex digits.
74156f2724eSchristosThe file can be edited using a text editor to change the key type or key content.
74256f2724eSchristosThis option is mutually exclusive with all other options.
74356f2724eSchristos@item @code{-p} @code{--password}= @kbd{passwd}
74456f2724eSchristosSet the password for reading and writing encrypted files to
74556f2724eSchristos@kbd{passwd}.
74656f2724eSchristosThese include the host, sign and identify key files.
74756f2724eSchristosBy default, the password is the string returned by the Unix
74856f2724eSchristos@code{hostname}
74956f2724eSchristoscommand.
75056f2724eSchristos@item @code{-P} @code{--pvt-cert}
75156f2724eSchristosGenerate a new private certificate used by the
75256f2724eSchristos@code{PC}
75356f2724eSchristosidentity scheme.
7548585484eSchristosBy default, the program generates public certificates.
75556f2724eSchristosNote: the PC identity scheme is not recommended for new installations.
75656f2724eSchristos@item @code{-q} @code{--export-passwd}= @kbd{passwd}
75756f2724eSchristosSet the password for writing encrypted
75856f2724eSchristos@code{IFF}, @code{GQ} @code{and} @code{MV}
75956f2724eSchristosidentity files redirected to
76056f2724eSchristos@file{stdout}
76156f2724eSchristosto
76256f2724eSchristos@kbd{passwd}.
76356f2724eSchristosIn effect, these files are decrypted with the
76456f2724eSchristos@code{-p}
76556f2724eSchristospassword, then encrypted with the
76656f2724eSchristos@code{-q}
76756f2724eSchristospassword.
76856f2724eSchristosBy default, the password is the string returned by the Unix
76956f2724eSchristos@code{hostname}
77056f2724eSchristoscommand.
77156f2724eSchristos@item @code{-s} @code{--subject-key}= @code{[host]} @code{[@@ @kbd{group}]}
77256f2724eSchristosSpecify the Autokey host name, where
77356f2724eSchristos@kbd{host}
77456f2724eSchristosis the optional host name and
77556f2724eSchristos@kbd{group}
77656f2724eSchristosis the optional group name.
77756f2724eSchristosThe host name, and if provided, group name are used in
77856f2724eSchristos@kbd{host} @kbd{@@} @kbd{group}
77956f2724eSchristosform as certificate subject and issuer.
78056f2724eSchristosSpecifying
78156f2724eSchristos@code{-s} @code{-@@} @kbd{group}
78256f2724eSchristosis allowed, and results in leaving the host name unchanged, as with
78356f2724eSchristos@code{-i} @kbd{group}.
78456f2724eSchristosThe group name, or if no group is provided, the host name are also used in the
78556f2724eSchristosfile names of
78656f2724eSchristos@code{IFF}, @code{GQ},
78756f2724eSchristosand
78856f2724eSchristos@code{MV}
78956f2724eSchristosidentity scheme client parameter files.
79056f2724eSchristosIf
79156f2724eSchristos@kbd{host}
79256f2724eSchristosis not specified, the default host name is the string returned by the Unix
79356f2724eSchristos@code{hostname}
79456f2724eSchristoscommand.
79556f2724eSchristos@item @code{-S} @code{--sign-key}= @code{[@code{RSA} | @code{DSA}]}
79656f2724eSchristosGenerate a new encrypted public/private sign key file of the specified type.
79756f2724eSchristosBy default, the sign key is the host key and has the same type.
79856f2724eSchristosIf compatibility with FIPS 140-2 is required, the sign key type must be
79956f2724eSchristos@code{DSA}.
80056f2724eSchristos@item @code{-T} @code{--trusted-cert}
8018585484eSchristosGenerate a trusted certificate.
8028585484eSchristosBy default, the program generates a non-trusted certificate.
80356f2724eSchristos@item @code{-V} @code{--mv-params} @kbd{nkeys}
80456f2724eSchristosGenerate
80556f2724eSchristos@kbd{nkeys}
80656f2724eSchristosencrypted server keys and parameters for the Mu-Varadharajan (MV)
80756f2724eSchristosidentity scheme.
80856f2724eSchristosThis option is mutually exclusive with the
80956f2724eSchristos@code{-I}
81056f2724eSchristosand
81156f2724eSchristos@code{-G}
81256f2724eSchristosoptions.
81356f2724eSchristosNote: support for this option should be considered a work in progress.
8148585484eSchristos@end table
81556f2724eSchristos
8168585484eSchristos@subsubsection Random Seed File
8178585484eSchristosAll cryptographically sound key generation schemes must have means
8188585484eSchristosto randomize the entropy seed used to initialize
8198585484eSchristosthe internal pseudo-random number generator used
8208585484eSchristosby the library routines.
8218585484eSchristosThe OpenSSL library uses a designated random seed file for this purpose.
8228585484eSchristosThe file must be available when starting the NTP daemon and
8238585484eSchristos@code{ntp-keygen}
8248585484eSchristosprogram.
8258585484eSchristosIf a site supports OpenSSL or its companion OpenSSH,
8268585484eSchristosit is very likely that means to do this are already available.
8278585484eSchristos
8288585484eSchristosIt is important to understand that entropy must be evolved
8298585484eSchristosfor each generation, for otherwise the random number sequence
8308585484eSchristoswould be predictable.
8318585484eSchristosVarious means dependent on external events, such as keystroke intervals,
8328585484eSchristoscan be used to do this and some systems have built-in entropy sources.
8338585484eSchristosSuitable means are described in the OpenSSL software documentation,
8348585484eSchristosbut are outside the scope of this page.
8358585484eSchristos
8368585484eSchristosThe entropy seed used by the OpenSSL library is contained in a file,
8378585484eSchristosusually called
83856f2724eSchristos@file{.rnd},
8398585484eSchristoswhich must be available when starting the NTP daemon
8408585484eSchristosor the
8418585484eSchristos@code{ntp-keygen}
8428585484eSchristosprogram.
8438585484eSchristosThe NTP daemon will first look for the file
8448585484eSchristosusing the path specified by the
8458585484eSchristos@code{randfile}
8468585484eSchristossubcommand of the
8478585484eSchristos@code{crypto}
8488585484eSchristosconfiguration command.
8498585484eSchristosIf not specified in this way, or when starting the
8508585484eSchristos@code{ntp-keygen}
8518585484eSchristosprogram,
8528585484eSchristosthe OpenSSL library will look for the file using the path specified
8538585484eSchristosby the
8548585484eSchristos.Ev RANDFILE
8558585484eSchristosenvironment variable in the user home directory,
8568585484eSchristoswhether root or some other user.
8578585484eSchristosIf the
8588585484eSchristos.Ev RANDFILE
8598585484eSchristosenvironment variable is not present,
8608585484eSchristosthe library will look for the
86156f2724eSchristos@file{.rnd}
8628585484eSchristosfile in the user home directory.
86356f2724eSchristosSince both the
86456f2724eSchristos@code{ntp-keygen}
86556f2724eSchristosprogram and
86656f2724eSchristos@code{ntpd(1ntpdmdoc)}
86756f2724eSchristosdaemon must run as root, the logical place to put this file is in
86856f2724eSchristos@file{/.rnd}
86956f2724eSchristosor
87056f2724eSchristos@file{/root/.rnd}.
8718585484eSchristosIf the file is not available or cannot be written,
8728585484eSchristosthe daemon exits with a message to the system log and the program
8738585484eSchristosexits with a suitable error message.
87456f2724eSchristos
8758585484eSchristos@subsubsection Cryptographic Data Files
87656f2724eSchristosAll file formats begin with two nonencrypted lines.
87756f2724eSchristosThe first line contains the file name, including the generated host name
87856f2724eSchristosand filestamp, in the format
87956f2724eSchristos@file{ntpkey_}@kbd{key} @kbd{_} @kbd{name}. @kbd{filestamp},
88056f2724eSchristoswhere
88156f2724eSchristos@kbd{key}
88256f2724eSchristosis the key or parameter type,
88356f2724eSchristos@kbd{name}
88456f2724eSchristosis the host or group name and
88556f2724eSchristos@kbd{filestamp}
88656f2724eSchristosis the filestamp (NTP seconds) when the file was created.
88756f2724eSchristosBy convention,
88856f2724eSchristos@kbd{key}
88956f2724eSchristosnames in generated file names include both upper and lower case
89056f2724eSchristoscharacters, while
89156f2724eSchristos@kbd{key}
89256f2724eSchristosnames in generated link names include only lower case characters.
89356f2724eSchristosThe filestamp is not used in generated link names.
89456f2724eSchristosThe second line contains the datestamp in conventional Unix
89556f2724eSchristos@file{date}
89656f2724eSchristosformat.
89756f2724eSchristosLines beginning with
89856f2724eSchristos@quoteleft{}#@quoteright{}
89956f2724eSchristosare considered comments and ignored by the
9008585484eSchristos@code{ntp-keygen}
9018585484eSchristosprogram and
9028585484eSchristos@code{ntpd(1ntpdmdoc)}
9038585484eSchristosdaemon.
9048585484eSchristos
90556f2724eSchristosThe remainder of the file contains cryptographic data, encoded first using ASN.1
90656f2724eSchristosrules, then encrypted if necessary, and finally written in PEM-encoded
90756f2724eSchristosprintable ASCII text, preceded and followed by MIME content identifier lines.
90856f2724eSchristos
90956f2724eSchristosThe format of the symmetric keys file, ordinarily named
91056f2724eSchristos@file{ntp.keys},
91156f2724eSchristosis somewhat different than the other files in the interest of backward compatibility.
91256f2724eSchristosOrdinarily, the file is generated by this program, but it can be constructed
91356f2724eSchristosand edited using an ordinary text editor.
91456f2724eSchristos@verbatim
91556f2724eSchristos# ntpkey_MD5key_bk.ntp.org.3595864945
91656f2724eSchristos# Thu Dec 12 19:22:25 2013
91756f2724eSchristos
91856f2724eSchristos1  MD5 L";Nw<\`.I<f4U0)247"i  # MD5 key
91956f2724eSchristos2  MD5 &>l0%XXK9O'51VwV<xq~  # MD5 key
92056f2724eSchristos3  MD5 lb4zLW~d^!K:]RsD'qb6  # MD5 key
92156f2724eSchristos4  MD5 Yue:tL[+vR)M\`n~bY,'?  # MD5 key
92256f2724eSchristos5  MD5 B;fx'Kgr/&4ZTbL6=RxA  # MD5 key
92356f2724eSchristos6  MD5 4eYwa\`o@}3i@@@@V@@..R9!l  # MD5 key
92456f2724eSchristos7  MD5 \`A.([h+;wTQ|xfi%Sn_!  # MD5 key
92556f2724eSchristos8  MD5 45:V,r4]l6y^JH6"Sh?F  # MD5 key
92656f2724eSchristos9  MD5 3-5vcn*6l29DS?Xdsg)*  # MD5 key
92756f2724eSchristos10 MD5 2late4Me              # MD5 key
92856f2724eSchristos11 SHA1 a27872d3030a9025b8446c751b4551a7629af65c  # SHA1 key
92956f2724eSchristos12 SHA1 21bc3b4865dbb9e920902abdccb3e04ff97a5e74  # SHA1 key
93056f2724eSchristos13 SHA1 2b7736fe24fef5ba85ae11594132ab5d6f6daba9  # SHA1 key
93156f2724eSchristos14 SHA  a5332809c8878dd3a5b918819108a111509aeceb  # SHA  key
93256f2724eSchristos15 MD2  2fe16c88c760ff2f16d4267e36c1aa6c926e6964  # MD2  key
93356f2724eSchristos16 MD4  b2691811dc19cfc0e2f9bcacd74213f29812183d  # MD4  key
93456f2724eSchristos17 MD5  e4d6735b8bdad58ec5ffcb087300a17f7fef1f7c  # MD5  key
93556f2724eSchristos18 MDC2 a8d5e2315c025bf3a79174c87fbd10477de2eabc  # MDC2 key
93656f2724eSchristos19 RIPEMD160 77ca332cafb30e3cafb174dcd5b80ded7ba9b3d2  # RIPEMD160 key
93756f2724eSchristos20 AES128CMAC f92ff73eee86c1e7dc638d6489a04e4e555af878  # AES128CMAC key
93856f2724eSchristos@end verbatim
93956f2724eSchristos@example
94056f2724eSchristosFigure 1. Typical Symmetric Key File
94156f2724eSchristos@end example
94256f2724eSchristos
94356f2724eSchristosFigure 1 shows a typical symmetric keys file used by the reference
94456f2724eSchristosimplementation.
94556f2724eSchristosFollowing the header the keys are entered one per line in the format
9468585484eSchristos@example
9478585484eSchristos@kbd{keyno} @kbd{type} @kbd{key}
9488585484eSchristos@end example
9498585484eSchristoswhere
9508585484eSchristos@kbd{keyno}
951397d6dd6Schristosis a positive integer in the range 1-65535;
9528585484eSchristos@kbd{type}
95356f2724eSchristosis the key type for the message digest algorithm, which in the absence of the
95456f2724eSchristosOpenSSL library must be
95556f2724eSchristos@code{MD5}
95656f2724eSchristosto designate the MD5 message digest algorithm;
95756f2724eSchristosif the OpenSSL library is installed, the key type can be any
95856f2724eSchristosmessage digest algorithm supported by that library;
95956f2724eSchristoshowever, if compatibility with FIPS 140-2 is required,
96056f2724eSchristosthe key type must be either
96156f2724eSchristos@code{SHA}
96256f2724eSchristosor
96356f2724eSchristos@code{SHA1};
9648585484eSchristos@kbd{key}
9658585484eSchristosis the key itself,
96656f2724eSchristoswhich is a printable ASCII string 20 characters or less in length:
96756f2724eSchristoseach character is chosen from the 93 printable characters
96856f2724eSchristosin the range 0x21 through 0x7e (
96956f2724eSchristos@quoteleft{}@quoteright{}!
97056f2724eSchristosthrough
97156f2724eSchristos@quoteleft{}~@quoteright{}
97256f2724eSchristos) excluding space and the
97356f2724eSchristos@quoteleft{}#@quoteright{}
97456f2724eSchristoscharacter, and terminated by whitespace or a
9758585484eSchristos@quoteleft{}#@quoteright{}
9768585484eSchristoscharacter.
97756f2724eSchristosAn OpenSSL key consists of a hex-encoded ASCII string of 40 characters, which
97856f2724eSchristosis truncated as necessary.
9798585484eSchristos
9808585484eSchristosNote that the keys used by the
9818585484eSchristos@code{ntpq(1ntpqmdoc)}
9828585484eSchristosand
9838585484eSchristos@code{ntpdc(1ntpdcmdoc)}
9848585484eSchristosprograms
9858585484eSchristosare checked against passwords requested by the programs
9868585484eSchristosand entered by hand, so it is generally appropriate to specify these keys
9878585484eSchristosin human readable ASCII format.
9888585484eSchristos
9898585484eSchristosThe
9908585484eSchristos@code{ntp-keygen}
99156f2724eSchristosprogram generates a symmetric keys file
99256f2724eSchristos@file{ntpkey_MD5key_}@kbd{hostname}. @kbd{filestamp}.
9938585484eSchristosSince the file contains private shared keys,
9948585484eSchristosit should be visible only to root and distributed by secure means
9958585484eSchristosto other subnet hosts.
9968585484eSchristosThe NTP daemon loads the file
9978585484eSchristos@file{ntp.keys},
9988585484eSchristosso
9998585484eSchristos@code{ntp-keygen}
10008585484eSchristosinstalls a soft link from this name to the generated file.
10018585484eSchristosSubsequently, similar soft links must be installed by manual
10028585484eSchristosor automated means on the other subnet hosts.
10038585484eSchristosWhile this file is not used with the Autokey Version 2 protocol,
10048585484eSchristosit is needed to authenticate some remote configuration commands
10058585484eSchristosused by the
10068585484eSchristos@code{ntpq(1ntpqmdoc)}
10078585484eSchristosand
10088585484eSchristos@code{ntpdc(1ntpdcmdoc)}
10098585484eSchristosutilities.
10108585484eSchristos
10118585484eSchristosThis section was generated by @strong{AutoGen},
10128585484eSchristosusing the @code{agtexi-cmd} template and the option descriptions for the @code{ntp-keygen} program.
10138585484eSchristosThis software is released under the NTP license, <http://ntp.org/license>.
10148585484eSchristos
10158585484eSchristos@menu
10168585484eSchristos* ntp-keygen usage::                  ntp-keygen help/usage (@option{--help})
10178585484eSchristos* ntp-keygen imbits::                 imbits option (-b)
10188585484eSchristos* ntp-keygen certificate::            certificate option (-c)
10198585484eSchristos* ntp-keygen cipher::                 cipher option (-C)
10208585484eSchristos* ntp-keygen id-key::                 id-key option (-e)
10218585484eSchristos* ntp-keygen gq-params::              gq-params option (-G)
10228585484eSchristos* ntp-keygen host-key::               host-key option (-H)
10238585484eSchristos* ntp-keygen iffkey::                 iffkey option (-I)
10248585484eSchristos* ntp-keygen ident::                  ident option (-i)
10258585484eSchristos* ntp-keygen lifetime::               lifetime option (-l)
10268585484eSchristos* ntp-keygen modulus::                modulus option (-m)
102756f2724eSchristos* ntp-keygen md5key::                 md5key option (-M)
10288585484eSchristos* ntp-keygen pvt-cert::               pvt-cert option (-P)
1029b8ecfcfeSchristos* ntp-keygen password::               password option (-p)
1030b8ecfcfeSchristos* ntp-keygen export-passwd::          export-passwd option (-q)
10318585484eSchristos* ntp-keygen subject-name::           subject-name option (-s)
103256f2724eSchristos* ntp-keygen sign-key::               sign-key option (-S)
10338585484eSchristos* ntp-keygen trusted-cert::           trusted-cert option (-T)
10348585484eSchristos* ntp-keygen mv-params::              mv-params option (-V)
10358585484eSchristos* ntp-keygen mv-keys::                mv-keys option (-v)
10368585484eSchristos* ntp-keygen config::                 presetting/configuring ntp-keygen
10378585484eSchristos* ntp-keygen exit status::            exit status
10388585484eSchristos* ntp-keygen Usage::                  Usage
10398585484eSchristos* ntp-keygen Notes::                  Notes
10408585484eSchristos* ntp-keygen Bugs::                   Bugs
10418585484eSchristos@end menu
10428585484eSchristos
10438585484eSchristos@node ntp-keygen usage
10448585484eSchristos@subsection ntp-keygen help/usage (@option{--help})
10458585484eSchristos@cindex ntp-keygen help
10468585484eSchristos
10478585484eSchristosThis is the automatically generated usage text for ntp-keygen.
10488585484eSchristos
10498585484eSchristosThe text printed is the same whether selected with the @code{help} option
10508585484eSchristos(@option{--help}) or the @code{more-help} option (@option{--more-help}).  @code{more-help} will print
10518585484eSchristosthe usage text by passing it through a pager program.
10528585484eSchristos@code{more-help} is disabled on platforms without a working
10538585484eSchristos@code{fork(2)} function.  The @code{PAGER} environment variable is
10548585484eSchristosused to select the program, defaulting to @file{more}.  Both will exit
10558585484eSchristoswith a status code of 0.
10568585484eSchristos
10578585484eSchristos@exampleindent 0
10588585484eSchristos@example
1059*897be3a4Schristosntp-keygen (ntp) - Create a NTP host key - Ver. 4.2.8p18
1060397d6dd6SchristosUsage:  ntp-keygen [ -<flag> [<val>] | --<name>[@{=| @}<val>] ]...
10618585484eSchristos  Flg Arg Option-Name    Description
1062397d6dd6Schristos   -b Num imbits         identity modulus bits
1063397d6dd6Schristos                                - it must be in the range:
1064397d6dd6Schristos                                  256 to 2048
10658585484eSchristos   -c Str certificate    certificate scheme
10668585484eSchristos   -C Str cipher         privatekey cipher
10678585484eSchristos   -d no  debug-level    Increase debug verbosity level
10688585484eSchristos                                - may appear multiple times
1069397d6dd6Schristos   -D Num set-debug-level Set the debug verbosity level
10708585484eSchristos                                - may appear multiple times
10718585484eSchristos   -e no  id-key         Write IFF or GQ identity keys
10728585484eSchristos   -G no  gq-params      Generate GQ parameters and keys
10738585484eSchristos   -H no  host-key       generate RSA host key
10748585484eSchristos   -I no  iffkey         generate IFF parameters
10758585484eSchristos   -i Str ident          set Autokey group name
10768585484eSchristos   -l Num lifetime       set certificate lifetime
1077397d6dd6Schristos   -m Num modulus        prime modulus
1078397d6dd6Schristos                                - it must be in the range:
10798585484eSchristos                                  256 to 2048
1080397d6dd6Schristos   -M no  md5key         generate symmetric keys
10818585484eSchristos   -P no  pvt-cert       generate PC private certificate
1082397d6dd6Schristos   -p Str password       local private password
1083397d6dd6Schristos   -q Str export-passwd  export IFF or GQ group keys with password
10848585484eSchristos   -s Str subject-name   set host and optionally group name
1085397d6dd6Schristos   -S Str sign-key       generate sign key (RSA or DSA)
10868585484eSchristos   -T no  trusted-cert   trusted certificate (TC scheme)
10878585484eSchristos   -V Num mv-params      generate <num> MV parameters
10888585484eSchristos   -v Num mv-keys        update <num> MV keys
1089397d6dd6Schristos      opt version        output version information and exit
1090397d6dd6Schristos   -? no  help           display extended usage information and exit
1091397d6dd6Schristos   -! no  more-help      extended usage information passed thru pager
1092397d6dd6Schristos   -> opt save-opts      save the option state to a config file
1093397d6dd6Schristos   -< Str load-opts      load options from a config file
1094397d6dd6Schristos                                - disabled as '--no-load-opts'
10958585484eSchristos                                - may appear multiple times
10968585484eSchristos
10978585484eSchristosOptions are specified by doubled hyphens and their name or by a single
10988585484eSchristoshyphen and the flag character.
10998585484eSchristos
11008585484eSchristos
11018585484eSchristosThe following option preset mechanisms are supported:
11028585484eSchristos - reading file $HOME/.ntprc
11038585484eSchristos - reading file ./.ntprc
11048585484eSchristos - examining environment variables named NTP_KEYGEN_*
11058585484eSchristos
1106*897be3a4SchristosPlease send bug reports to:  <https://bugs.ntp.org, bugs@@ntp.org>
11078585484eSchristos@end example
11088585484eSchristos@exampleindent 4
11098585484eSchristos
11108585484eSchristos@node ntp-keygen imbits
11118585484eSchristos@subsection imbits option (-b)
11128585484eSchristos@cindex ntp-keygen-imbits
11138585484eSchristos
11148585484eSchristosThis is the ``identity modulus bits'' option.
11158585484eSchristosThis option takes a number argument @file{imbits}.
11168585484eSchristos
11178585484eSchristos@noindent
11188585484eSchristosThis option has some usage constraints.  It:
11198585484eSchristos@itemize @bullet
11208585484eSchristos@item
11218585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
11228585484eSchristos@end itemize
11238585484eSchristos
1124*897be3a4SchristosThe number of bits in the identity modulus.  The default is 512.
11258585484eSchristos@node ntp-keygen certificate
11268585484eSchristos@subsection certificate option (-c)
11278585484eSchristos@cindex ntp-keygen-certificate
11288585484eSchristos
11298585484eSchristosThis is the ``certificate scheme'' option.
11308585484eSchristosThis option takes a string argument @file{scheme}.
11318585484eSchristos
11328585484eSchristos@noindent
11338585484eSchristosThis option has some usage constraints.  It:
11348585484eSchristos@itemize @bullet
11358585484eSchristos@item
11368585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
11378585484eSchristos@end itemize
11388585484eSchristos
11398585484eSchristosscheme is one of
114056f2724eSchristosRSA-MD2, RSA-MD5, RSA-MDC2, RSA-SHA, RSA-SHA1, RSA-RIPEMD160,
11418585484eSchristosDSA-SHA, or DSA-SHA1.
11428585484eSchristos
114356f2724eSchristosSelect the certificate signature encryption/message digest scheme.
11448585484eSchristosNote that RSA schemes must be used with a RSA sign key and DSA
11458585484eSchristosschemes must be used with a DSA sign key.  The default without
11468585484eSchristosthis option is RSA-MD5.
11478585484eSchristos@node ntp-keygen cipher
11488585484eSchristos@subsection cipher option (-C)
11498585484eSchristos@cindex ntp-keygen-cipher
11508585484eSchristos
11518585484eSchristosThis is the ``privatekey cipher'' option.
11528585484eSchristosThis option takes a string argument @file{cipher}.
11538585484eSchristos
11548585484eSchristos@noindent
11558585484eSchristosThis option has some usage constraints.  It:
11568585484eSchristos@itemize @bullet
11578585484eSchristos@item
11588585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
11598585484eSchristos@end itemize
11608585484eSchristos
11618585484eSchristosSelect the cipher which is used to encrypt the files containing
11628585484eSchristosprivate keys.  The default is three-key triple DES in CBC mode,
116356f2724eSchristosequivalent to "@code{-C des-ede3-cbc}".  The openssl tool lists ciphers
11648585484eSchristosavailable in "@code{openssl -h}" output.
11658585484eSchristos@node ntp-keygen id-key
11668585484eSchristos@subsection id-key option (-e)
11678585484eSchristos@cindex ntp-keygen-id-key
11688585484eSchristos
11698585484eSchristosThis is the ``write iff or gq identity keys'' option.
11708585484eSchristos
11718585484eSchristos@noindent
11728585484eSchristosThis option has some usage constraints.  It:
11738585484eSchristos@itemize @bullet
11748585484eSchristos@item
11758585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
11768585484eSchristos@end itemize
11778585484eSchristos
117856f2724eSchristosWrite the public parameters from the IFF or GQ client keys to
117956f2724eSchristosthe standard output.
118056f2724eSchristosThis is intended for automatic key distribution by email.
11818585484eSchristos@node ntp-keygen gq-params
11828585484eSchristos@subsection gq-params option (-G)
11838585484eSchristos@cindex ntp-keygen-gq-params
11848585484eSchristos
11858585484eSchristosThis is the ``generate gq parameters and keys'' option.
11868585484eSchristos
11878585484eSchristos@noindent
11888585484eSchristosThis option has some usage constraints.  It:
11898585484eSchristos@itemize @bullet
11908585484eSchristos@item
11918585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
11928585484eSchristos@end itemize
11938585484eSchristos
11948585484eSchristosGenerate parameters and keys for the GQ identification scheme,
11958585484eSchristosobsoleting any that may exist.
11968585484eSchristos@node ntp-keygen host-key
11978585484eSchristos@subsection host-key option (-H)
11988585484eSchristos@cindex ntp-keygen-host-key
11998585484eSchristos
12008585484eSchristosThis is the ``generate rsa host key'' option.
12018585484eSchristos
12028585484eSchristos@noindent
12038585484eSchristosThis option has some usage constraints.  It:
12048585484eSchristos@itemize @bullet
12058585484eSchristos@item
12068585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
12078585484eSchristos@end itemize
12088585484eSchristos
12098585484eSchristosGenerate new host keys, obsoleting any that may exist.
12108585484eSchristos@node ntp-keygen iffkey
12118585484eSchristos@subsection iffkey option (-I)
12128585484eSchristos@cindex ntp-keygen-iffkey
12138585484eSchristos
12148585484eSchristosThis is the ``generate iff parameters'' option.
12158585484eSchristos
12168585484eSchristos@noindent
12178585484eSchristosThis option has some usage constraints.  It:
12188585484eSchristos@itemize @bullet
12198585484eSchristos@item
12208585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
12218585484eSchristos@end itemize
12228585484eSchristos
12238585484eSchristosGenerate parameters for the IFF identification scheme, obsoleting
12248585484eSchristosany that may exist.
12258585484eSchristos@node ntp-keygen ident
12268585484eSchristos@subsection ident option (-i)
12278585484eSchristos@cindex ntp-keygen-ident
12288585484eSchristos
12298585484eSchristosThis is the ``set autokey group name'' option.
12308585484eSchristosThis option takes a string argument @file{group}.
12318585484eSchristos
12328585484eSchristos@noindent
12338585484eSchristosThis option has some usage constraints.  It:
12348585484eSchristos@itemize @bullet
12358585484eSchristos@item
12368585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
12378585484eSchristos@end itemize
12388585484eSchristos
12398585484eSchristosSet the optional Autokey group name to name.  This is used in
12408585484eSchristosthe file name of IFF, GQ, and MV client parameters files.  In
12418585484eSchristosthat role, the default is the host name if this option is not
12428585484eSchristosprovided.  The group name, if specified using @code{-i/--ident} or
124356f2724eSchristosusing @code{-s/--subject-name} following an '@code{@@}' character,
124456f2724eSchristosis also a part of the self-signed host certificate subject and
124556f2724eSchristosissuer names in the form @code{host@@group} and should match the
124656f2724eSchristos'@code{crypto ident}' or '@code{server ident}' configuration in the
124756f2724eSchristos@code{ntpd} configuration file.
12488585484eSchristos@node ntp-keygen lifetime
12498585484eSchristos@subsection lifetime option (-l)
12508585484eSchristos@cindex ntp-keygen-lifetime
12518585484eSchristos
12528585484eSchristosThis is the ``set certificate lifetime'' option.
12538585484eSchristosThis option takes a number argument @file{lifetime}.
12548585484eSchristos
12558585484eSchristos@noindent
12568585484eSchristosThis option has some usage constraints.  It:
12578585484eSchristos@itemize @bullet
12588585484eSchristos@item
12598585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
12608585484eSchristos@end itemize
12618585484eSchristos
12628585484eSchristosSet the certificate expiration to lifetime days from now.
12638585484eSchristos@node ntp-keygen modulus
12648585484eSchristos@subsection modulus option (-m)
12658585484eSchristos@cindex ntp-keygen-modulus
12668585484eSchristos
126756f2724eSchristosThis is the ``prime modulus'' option.
12688585484eSchristosThis option takes a number argument @file{modulus}.
12698585484eSchristos
12708585484eSchristos@noindent
12718585484eSchristosThis option has some usage constraints.  It:
12728585484eSchristos@itemize @bullet
12738585484eSchristos@item
12748585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
12758585484eSchristos@end itemize
12768585484eSchristos
12778585484eSchristosThe number of bits in the prime modulus.  The default is 512.
127856f2724eSchristos@node ntp-keygen md5key
127956f2724eSchristos@subsection md5key option (-M)
128056f2724eSchristos@cindex ntp-keygen-md5key
128156f2724eSchristos
128256f2724eSchristosThis is the ``generate symmetric keys'' option.
128356f2724eSchristosGenerate symmetric keys, obsoleting any that may exist.
12848585484eSchristos@node ntp-keygen pvt-cert
12858585484eSchristos@subsection pvt-cert option (-P)
12868585484eSchristos@cindex ntp-keygen-pvt-cert
12878585484eSchristos
12888585484eSchristosThis is the ``generate pc private certificate'' option.
12898585484eSchristos
12908585484eSchristos@noindent
12918585484eSchristosThis option has some usage constraints.  It:
12928585484eSchristos@itemize @bullet
12938585484eSchristos@item
12948585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
12958585484eSchristos@end itemize
12968585484eSchristos
12978585484eSchristosGenerate a private certificate.  By default, the program generates
12988585484eSchristospublic certificates.
1299b8ecfcfeSchristos@node ntp-keygen password
1300b8ecfcfeSchristos@subsection password option (-p)
1301b8ecfcfeSchristos@cindex ntp-keygen-password
13028585484eSchristos
1303b8ecfcfeSchristosThis is the ``local private password'' option.
13048585484eSchristosThis option takes a string argument @file{passwd}.
13058585484eSchristos
13068585484eSchristos@noindent
13078585484eSchristosThis option has some usage constraints.  It:
13088585484eSchristos@itemize @bullet
13098585484eSchristos@item
13108585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
13118585484eSchristos@end itemize
13128585484eSchristos
1313b8ecfcfeSchristosLocal files containing private data are encrypted with the
1314b8ecfcfeSchristosDES-CBC algorithm and the specified password.  The same password
1315b8ecfcfeSchristosmust be specified to the local ntpd via the "crypto pw password"
1316b8ecfcfeSchristosconfiguration command.  The default password is the local
1317b8ecfcfeSchristoshostname.
1318b8ecfcfeSchristos@node ntp-keygen export-passwd
1319b8ecfcfeSchristos@subsection export-passwd option (-q)
1320b8ecfcfeSchristos@cindex ntp-keygen-export-passwd
13218585484eSchristos
1322b8ecfcfeSchristosThis is the ``export iff or gq group keys with password'' option.
13238585484eSchristosThis option takes a string argument @file{passwd}.
13248585484eSchristos
13258585484eSchristos@noindent
13268585484eSchristosThis option has some usage constraints.  It:
13278585484eSchristos@itemize @bullet
13288585484eSchristos@item
13298585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
13308585484eSchristos@end itemize
13318585484eSchristos
1332b8ecfcfeSchristosExport IFF or GQ identity group keys to the standard output,
1333b8ecfcfeSchristosencrypted with the DES-CBC algorithm and the specified password.
1334b8ecfcfeSchristosThe same password must be specified to the remote ntpd via the
1335b8ecfcfeSchristos"crypto pw password" configuration command.  See also the option
1336b8ecfcfeSchristos--id-key (-e) for unencrypted exports.
133756f2724eSchristos@node ntp-keygen subject-name
133856f2724eSchristos@subsection subject-name option (-s)
133956f2724eSchristos@cindex ntp-keygen-subject-name
134056f2724eSchristos
134156f2724eSchristosThis is the ``set host and optionally group name'' option.
134256f2724eSchristosThis option takes a string argument @file{host@@group}.
134356f2724eSchristos
134456f2724eSchristos@noindent
134556f2724eSchristosThis option has some usage constraints.  It:
134656f2724eSchristos@itemize @bullet
134756f2724eSchristos@item
134856f2724eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
134956f2724eSchristos@end itemize
135056f2724eSchristos
135156f2724eSchristosSet the Autokey host name, and optionally, group name specified
135256f2724eSchristosfollowing an '@code{@@}' character.  The host name is used in the file
135356f2724eSchristosname of generated host and signing certificates, without the
135456f2724eSchristosgroup name.  The host name, and if provided, group name are used
135556f2724eSchristosin @code{host@@group} form for the host certificate subject and issuer
135656f2724eSchristosfields.  Specifying '@code{-s @@group}' is allowed, and results in
135756f2724eSchristosleaving the host name unchanged while appending @code{@@group} to the
135856f2724eSchristossubject and issuer fields, as with @code{-i group}.  The group name, or
135956f2724eSchristosif not provided, the host name are also used in the file names
136056f2724eSchristosof IFF, GQ, and MV client parameter files.
13618585484eSchristos@node ntp-keygen sign-key
13628585484eSchristos@subsection sign-key option (-S)
13638585484eSchristos@cindex ntp-keygen-sign-key
13648585484eSchristos
13658585484eSchristosThis is the ``generate sign key (rsa or dsa)'' option.
13668585484eSchristosThis option takes a string argument @file{sign}.
13678585484eSchristos
13688585484eSchristos@noindent
13698585484eSchristosThis option has some usage constraints.  It:
13708585484eSchristos@itemize @bullet
13718585484eSchristos@item
13728585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
13738585484eSchristos@end itemize
13748585484eSchristos
13758585484eSchristosGenerate a new sign key of the designated type, obsoleting any
13768585484eSchristosthat may exist.  By default, the program uses the host key as the
13778585484eSchristossign key.
13788585484eSchristos@node ntp-keygen trusted-cert
13798585484eSchristos@subsection trusted-cert option (-T)
13808585484eSchristos@cindex ntp-keygen-trusted-cert
13818585484eSchristos
13828585484eSchristosThis is the ``trusted certificate (tc scheme)'' option.
13838585484eSchristos
13848585484eSchristos@noindent
13858585484eSchristosThis option has some usage constraints.  It:
13868585484eSchristos@itemize @bullet
13878585484eSchristos@item
13888585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
13898585484eSchristos@end itemize
13908585484eSchristos
13918585484eSchristosGenerate a trusted certificate.  By default, the program generates
13928585484eSchristosa non-trusted certificate.
13938585484eSchristos@node ntp-keygen mv-params
13948585484eSchristos@subsection mv-params option (-V)
13958585484eSchristos@cindex ntp-keygen-mv-params
13968585484eSchristos
13978585484eSchristosThis is the ``generate <num> mv parameters'' option.
13988585484eSchristosThis option takes a number argument @file{num}.
13998585484eSchristos
14008585484eSchristos@noindent
14018585484eSchristosThis option has some usage constraints.  It:
14028585484eSchristos@itemize @bullet
14038585484eSchristos@item
14048585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
14058585484eSchristos@end itemize
14068585484eSchristos
14078585484eSchristosGenerate parameters and keys for the Mu-Varadharajan (MV)
14088585484eSchristosidentification scheme.
14098585484eSchristos@node ntp-keygen mv-keys
14108585484eSchristos@subsection mv-keys option (-v)
14118585484eSchristos@cindex ntp-keygen-mv-keys
14128585484eSchristos
14138585484eSchristosThis is the ``update <num> mv keys'' option.
14148585484eSchristosThis option takes a number argument @file{num}.
14158585484eSchristos
14168585484eSchristos@noindent
14178585484eSchristosThis option has some usage constraints.  It:
14188585484eSchristos@itemize @bullet
14198585484eSchristos@item
14208585484eSchristosmust be compiled in by defining @code{AUTOKEY} during the compilation.
14218585484eSchristos@end itemize
14228585484eSchristos
14238585484eSchristosThis option has no @samp{doc} documentation.
14248585484eSchristos
14258585484eSchristos
14268585484eSchristos@node ntp-keygen config
14278585484eSchristos@subsection presetting/configuring ntp-keygen
14288585484eSchristos
14298585484eSchristosAny option that is not marked as @i{not presettable} may be preset by
14308585484eSchristosloading values from configuration ("rc" or "ini") files, and values from environment variables named @code{NTP-KEYGEN} and @code{NTP-KEYGEN_<OPTION_NAME>}.  @code{<OPTION_NAME>} must be one of
14318585484eSchristosthe options listed above in upper case and segmented with underscores.
14328585484eSchristosThe @code{NTP-KEYGEN} variable will be tokenized and parsed like
14338585484eSchristosthe command line.  The remaining variables are tested for existence and their
14348585484eSchristosvalues are treated like option arguments.
14358585484eSchristos
14368585484eSchristos
14378585484eSchristos@noindent
14388585484eSchristos@code{libopts} will search in 2 places for configuration files:
14398585484eSchristos@itemize @bullet
14408585484eSchristos@item
14418585484eSchristos$HOME
14428585484eSchristos@item
14438585484eSchristos$PWD
14448585484eSchristos@end itemize
14458585484eSchristosThe environment variables @code{HOME}, and @code{PWD}
14468585484eSchristosare expanded and replaced when @file{ntp-keygen} runs.
14478585484eSchristosFor any of these that are plain files, they are simply processed.
14488585484eSchristosFor any that are directories, then a file named @file{.ntprc} is searched for
14498585484eSchristoswithin that directory and processed.
14508585484eSchristos
14518585484eSchristosConfiguration files may be in a wide variety of formats.
14528585484eSchristosThe basic format is an option name followed by a value (argument) on the
14538585484eSchristossame line.  Values may be separated from the option name with a colon,
14548585484eSchristosequal sign or simply white space.  Values may be continued across multiple
14558585484eSchristoslines by escaping the newline with a backslash.
14568585484eSchristos
14578585484eSchristosMultiple programs may also share the same initialization file.
14588585484eSchristosCommon options are collected at the top, followed by program specific
14598585484eSchristossegments.  The segments are separated by lines like:
14608585484eSchristos@example
14618585484eSchristos[NTP-KEYGEN]
14628585484eSchristos@end example
14638585484eSchristos@noindent
14648585484eSchristosor by
14658585484eSchristos@example
14668585484eSchristos<?program ntp-keygen>
14678585484eSchristos@end example
14688585484eSchristos@noindent
14698585484eSchristosDo not mix these styles within one configuration file.
14708585484eSchristos
14718585484eSchristosCompound values and carefully constructed string values may also be
14728585484eSchristosspecified using XML syntax:
14738585484eSchristos@example
14748585484eSchristos<option-name>
14758585484eSchristos   <sub-opt>...&lt;...&gt;...</sub-opt>
14768585484eSchristos</option-name>
14778585484eSchristos@end example
14788585484eSchristos@noindent
14798585484eSchristosyielding an @code{option-name.sub-opt} string value of
14808585484eSchristos@example
14818585484eSchristos"...<...>..."
14828585484eSchristos@end example
14838585484eSchristos@code{AutoOpts} does not track suboptions.  You simply note that it is a
14848585484eSchristoshierarchicly valued option.  @code{AutoOpts} does provide a means for searching
14858585484eSchristosthe associated name/value pair list (see: optionFindValue).
14868585484eSchristos
14878585484eSchristosThe command line options relating to configuration and/or usage help are:
14888585484eSchristos
14898585484eSchristos@subsubheading version (-)
14908585484eSchristos
14918585484eSchristosPrint the program version to standard out, optionally with licensing
14928585484eSchristosinformation, then exit 0.  The optional argument specifies how much licensing
1493*897be3a4Schristosdetail to provide.  The default is to print just the version.  The licensing information may be selected with an option argument.
14948585484eSchristosOnly the first letter of the argument is examined:
14958585484eSchristos
14968585484eSchristos@table @samp
14978585484eSchristos@item version
14988585484eSchristosOnly print the version.  This is the default.
14998585484eSchristos@item copyright
15008585484eSchristosName the copyright usage licensing terms.
15018585484eSchristos@item verbose
15028585484eSchristosPrint the full copyright usage licensing terms.
15038585484eSchristos@end table
15048585484eSchristos
15058585484eSchristos@node ntp-keygen exit status
15068585484eSchristos@subsection ntp-keygen exit status
15078585484eSchristos
15088585484eSchristosOne of the following exit values will be returned:
15098585484eSchristos@table @samp
15108585484eSchristos@item 0 (EXIT_SUCCESS)
15118585484eSchristosSuccessful program execution.
15128585484eSchristos@item 1 (EXIT_FAILURE)
15138585484eSchristosThe operation failed or the command syntax was not valid.
15148585484eSchristos@item 66 (EX_NOINPUT)
15158585484eSchristosA specified configuration file could not be loaded.
15168585484eSchristos@item 70 (EX_SOFTWARE)
15178585484eSchristoslibopts had an internal operational error.  Please report
15188585484eSchristosit to autogen-users@@lists.sourceforge.net.  Thank you.
15198585484eSchristos@end table
15208585484eSchristos@node ntp-keygen Usage
15218585484eSchristos@subsection ntp-keygen Usage
15228585484eSchristos@node ntp-keygen Notes
15238585484eSchristos@subsection ntp-keygen Notes
15248585484eSchristos@node ntp-keygen Bugs
15258585484eSchristos@subsection ntp-keygen Bugs
1526