xref: /freebsd/contrib/ntp/util/ntp-keygen-opts.def (revision 2b15cb3d0922bd70ea592f0da9b4a5b167f4d53f)
1ea906c41SOllivier Robert/* -*- Mode: Text -*- */
2ea906c41SOllivier Robert
3ea906c41SOllivier Robertautogen definitions options;
4ea906c41SOllivier Robert
5ea906c41SOllivier Robert#include copyright.def
6ea906c41SOllivier Robert#include homerc.def
7ea906c41SOllivier Robert#include autogen-version.def
8ea906c41SOllivier Robert
9ea906c41SOllivier Robertprog-name      = "ntp-keygen";
10ea906c41SOllivier Robertprog-title     = "Create a NTP host key";
11ea906c41SOllivier Robertpackage        = ntp;
12ea906c41SOllivier Robert
13ea906c41SOllivier Robertinclude        = '#include <stdlib.h>';
14ea906c41SOllivier Robert#include       version.def
15ea906c41SOllivier Robert
16ea906c41SOllivier Robertflag = {
17*2b15cb3dSCy Schubert    value     = b;
18*2b15cb3dSCy Schubert    name      = imbits;
19*2b15cb3dSCy Schubert    arg-type  = number;
20*2b15cb3dSCy Schubert    arg-name  = imbits;
21*2b15cb3dSCy Schubert    arg-range = '256->2048';
22*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
23*2b15cb3dSCy Schubert    descrip   = "identity modulus bits";
24*2b15cb3dSCy Schubert    doc = <<-  _EndOfDoc_
25*2b15cb3dSCy Schubert	The number of bits in the identity modulus.  The default is 256.
26*2b15cb3dSCy Schubert	_EndOfDoc_;
27*2b15cb3dSCy Schubert};
28*2b15cb3dSCy Schubert
29*2b15cb3dSCy Schubertflag = {
30ea906c41SOllivier Robert    value     = c;
31*2b15cb3dSCy Schubert    name      = certificate;
32ea906c41SOllivier Robert    arg-type  = string;
33ea906c41SOllivier Robert    arg-name  = scheme;
34*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
35ea906c41SOllivier Robert    descrip   = "certificate scheme";
36ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
37*2b15cb3dSCy Schubert	scheme is one of
38*2b15cb3dSCy Schubert	RSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160,
39*2b15cb3dSCy Schubert	DSA-SHA, or DSA-SHA1.
40*2b15cb3dSCy Schubert
41*2b15cb3dSCy Schubert	Select the certificate message digest/signature encryption scheme.
42*2b15cb3dSCy Schubert	Note that RSA schemes must be used with a RSA sign key and DSA
43*2b15cb3dSCy Schubert	schemes must be used with a DSA sign key.  The default without
44*2b15cb3dSCy Schubert	this option is RSA-MD5.
45*2b15cb3dSCy Schubert	_EndOfDoc_;
46*2b15cb3dSCy Schubert};
47*2b15cb3dSCy Schubert
48*2b15cb3dSCy Schubertflag = {
49*2b15cb3dSCy Schubert    value     = C;
50*2b15cb3dSCy Schubert    name      = cipher;
51*2b15cb3dSCy Schubert    arg-type  = string;
52*2b15cb3dSCy Schubert    arg-name  = cipher;
53*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
54*2b15cb3dSCy Schubert    descrip   = "privatekey cipher";
55*2b15cb3dSCy Schubert    doc = <<-  _EndOfDoc_
56*2b15cb3dSCy Schubert	Select the cipher which is used to encrypt the files containing
57*2b15cb3dSCy Schubert	private keys.  The default is three-key triple DES in CBC mode,
58*2b15cb3dSCy Schubert	equivalent to "@code{-C des-ede3-cbc".  The openssl tool lists ciphers
59*2b15cb3dSCy Schubert	available in "@code{openssl -h}" output.
60ea906c41SOllivier Robert	_EndOfDoc_;
61ea906c41SOllivier Robert};
62ea906c41SOllivier Robert
63ea906c41SOllivier Robert#include       debug-opt.def
64ea906c41SOllivier Robert
65ea906c41SOllivier Robertflag = {
66ea906c41SOllivier Robert    value     = e;
67*2b15cb3dSCy Schubert    name      = id-key;
68*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
69*2b15cb3dSCy Schubert    descrip   = "Write IFF or GQ identity keys";
70ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
71*2b15cb3dSCy Schubert	Write the IFF or GQ client keys to the standard output.  This is
72*2b15cb3dSCy Schubert	intended for automatic key distribution by mail.
73ea906c41SOllivier Robert	_EndOfDoc_;
74ea906c41SOllivier Robert};
75ea906c41SOllivier Robert
76ea906c41SOllivier Robertflag = {
77ea906c41SOllivier Robert    value     = G;
78*2b15cb3dSCy Schubert    name      = gq-params;
79*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
80ea906c41SOllivier Robert    descrip   = "Generate GQ parameters and keys";
81ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
82*2b15cb3dSCy Schubert	Generate parameters and keys for the GQ identification scheme,
83*2b15cb3dSCy Schubert	obsoleting any that may exist.
84ea906c41SOllivier Robert	_EndOfDoc_;
85ea906c41SOllivier Robert};
86ea906c41SOllivier Robert
87ea906c41SOllivier Robertflag = {
88ea906c41SOllivier Robert    value     = H;
89*2b15cb3dSCy Schubert    name      = host-key;
90*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
91ea906c41SOllivier Robert    descrip   = "generate RSA host key";
92ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
93*2b15cb3dSCy Schubert	Generate new host keys, obsoleting any that may exist.
94ea906c41SOllivier Robert	_EndOfDoc_;
95ea906c41SOllivier Robert};
96ea906c41SOllivier Robert
97ea906c41SOllivier Robertflag = {
98ea906c41SOllivier Robert    value     = I;
99*2b15cb3dSCy Schubert    name      = iffkey;
100*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
101ea906c41SOllivier Robert    descrip   = "generate IFF parameters";
102ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
103*2b15cb3dSCy Schubert	Generate parameters for the IFF identification scheme, obsoleting
104*2b15cb3dSCy Schubert	any that may exist.
105ea906c41SOllivier Robert	_EndOfDoc_;
106ea906c41SOllivier Robert};
107ea906c41SOllivier Robert
108ea906c41SOllivier Robertflag = {
109ea906c41SOllivier Robert    value     = i;
110*2b15cb3dSCy Schubert    name      = ident;
111*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
112*2b15cb3dSCy Schubert    arg-type  = string;
113*2b15cb3dSCy Schubert    arg-name  = group;
114*2b15cb3dSCy Schubert    descrip   = "set Autokey group name";
115ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
116*2b15cb3dSCy Schubert	Set the optional Autokey group name to name.  This is used in
117*2b15cb3dSCy Schubert	the file name of IFF, GQ, and MV client parameters files.  In
118*2b15cb3dSCy Schubert	that role, the default is the host name if this option is not
119*2b15cb3dSCy Schubert	provided.  The group name, if specified using @code{-i/--ident} or
120*2b15cb3dSCy Schubert	using @code{-s/--subject-name} following an '@code{@}' character,
121*2b15cb3dSCy Schubert	is also a part of the self-signed host certificate's subject and
122*2b15cb3dSCy Schubert	issuer names in the form @code{host@group} and should match the
123*2b15cb3dSCy Schubert	'@code{crypto ident}' or '@code{server ident}' configuration in
124*2b15cb3dSCy Schubert	@code{ntpd}'s configuration file.
125ea906c41SOllivier Robert	_EndOfDoc_;
126ea906c41SOllivier Robert};
127ea906c41SOllivier Robert
128ea906c41SOllivier Robertflag = {
129*2b15cb3dSCy Schubert    value     = l;
130*2b15cb3dSCy Schubert    name      = lifetime;
131*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
132*2b15cb3dSCy Schubert    arg-type  = number;
133*2b15cb3dSCy Schubert    arg-name  = lifetime;
134*2b15cb3dSCy Schubert    descrip   = "set certificate lifetime";
135*2b15cb3dSCy Schubert    doc = <<-  _EndOfDoc_
136*2b15cb3dSCy Schubert	Set the certificate expiration to lifetime days from now.
137*2b15cb3dSCy Schubert	_EndOfDoc_;
138*2b15cb3dSCy Schubert};
139*2b15cb3dSCy Schubert
140*2b15cb3dSCy Schubertflag = {
141ea906c41SOllivier Robert    value     = M;
142*2b15cb3dSCy Schubert    name      = md5key;
143ea906c41SOllivier Robert    descrip   = "generate MD5 keys";
144ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
145*2b15cb3dSCy Schubert	Generate MD5 keys, obsoleting any that may exist.
146ea906c41SOllivier Robert	_EndOfDoc_;
147ea906c41SOllivier Robert};
148ea906c41SOllivier Robert
149ea906c41SOllivier Robertflag = {
150ea906c41SOllivier Robert    value     = m;
151*2b15cb3dSCy Schubert    name      = modulus;
152ea906c41SOllivier Robert    arg-type  = number;
153ea906c41SOllivier Robert    arg-name  = modulus;
154ea906c41SOllivier Robert    arg-range = '256->2048';
155*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
156ea906c41SOllivier Robert    descrip   = "modulus";
157ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
158*2b15cb3dSCy Schubert	The number of bits in the prime modulus.  The default is 512.
159ea906c41SOllivier Robert	_EndOfDoc_;
160ea906c41SOllivier Robert};
161ea906c41SOllivier Robert
162ea906c41SOllivier Robertflag = {
163ea906c41SOllivier Robert    value     = P;
164*2b15cb3dSCy Schubert    name      = pvt-cert;
165*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
166ea906c41SOllivier Robert    descrip   = "generate PC private certificate";
167ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
168*2b15cb3dSCy Schubert	Generate a private certificate.  By default, the program generates
169*2b15cb3dSCy Schubert	public certificates.
170ea906c41SOllivier Robert	_EndOfDoc_;
171ea906c41SOllivier Robert};
172ea906c41SOllivier Robert
173ea906c41SOllivier Robertflag = {
174ea906c41SOllivier Robert    value     = p;
175*2b15cb3dSCy Schubert    name      = password;	// was: pvt-passwd;
176*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
177ea906c41SOllivier Robert    arg-type  = string;
178ea906c41SOllivier Robert    arg-name  = passwd;
179*2b15cb3dSCy Schubert    descrip   = "local private password";
180ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
181*2b15cb3dSCy Schubert	Local files containing private data are encrypted with the
182*2b15cb3dSCy Schubert	DES-CBC algorithm and the specified password.  The same password
183*2b15cb3dSCy Schubert	must be specified to the local ntpd via the "crypto pw password"
184*2b15cb3dSCy Schubert	configuration command.  The default password is the local
185*2b15cb3dSCy Schubert	hostname.
186ea906c41SOllivier Robert	_EndOfDoc_;
187ea906c41SOllivier Robert};
188ea906c41SOllivier Robert
189ea906c41SOllivier Robertflag = {
190ea906c41SOllivier Robert    value     = q;
191*2b15cb3dSCy Schubert    name      = export-passwd;	// Was: get-pvt-passwd;
192*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
193ea906c41SOllivier Robert    arg-type  = string;
194ea906c41SOllivier Robert    arg-name  = passwd;
195*2b15cb3dSCy Schubert    descrip   = "export IFF or GQ group keys with password";
196ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
197*2b15cb3dSCy Schubert	Export IFF or GQ identity group keys to the standard output,
198*2b15cb3dSCy Schubert	encrypted with the DES-CBC algorithm and the specified password.
199*2b15cb3dSCy Schubert	The same password must be specified to the remote ntpd via the
200*2b15cb3dSCy Schubert	"crypto pw password" configuration command.  See also the option
201*2b15cb3dSCy Schubert	--id-key (-e) for unencrypted exports.
202ea906c41SOllivier Robert	_EndOfDoc_;
203ea906c41SOllivier Robert};
204ea906c41SOllivier Robert
205ea906c41SOllivier Robertflag = {
206ea906c41SOllivier Robert    value     = S;
207*2b15cb3dSCy Schubert    name      = sign-key;
208ea906c41SOllivier Robert    arg-type  = string;
209ea906c41SOllivier Robert    arg-name  = sign;
210*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
211ea906c41SOllivier Robert    descrip   = "generate sign key (RSA or DSA)";
212ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
213*2b15cb3dSCy Schubert	Generate a new sign key of the designated type, obsoleting any
214*2b15cb3dSCy Schubert	that may exist.  By default, the program uses the host key as the
215*2b15cb3dSCy Schubert	sign key.
216ea906c41SOllivier Robert	_EndOfDoc_;
217ea906c41SOllivier Robert};
218ea906c41SOllivier Robert
219ea906c41SOllivier Robertflag = {
220ea906c41SOllivier Robert    value     = s;
221*2b15cb3dSCy Schubert    name      = subject-name;
222ea906c41SOllivier Robert    arg-type  = string;
223*2b15cb3dSCy Schubert    arg-name  = host@group;
224*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
225*2b15cb3dSCy Schubert    descrip   = "set host and optionally group name";
226ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
227*2b15cb3dSCy Schubert	Set the Autokey host name, and optionally, group name specified
228*2b15cb3dSCy Schubert	following an '@code{@}' character.  The host name is used in the file
229*2b15cb3dSCy Schubert	name of generated host and signing certificates, without the
230*2b15cb3dSCy Schubert	group name.  The host name, and if provided, group name are used
231*2b15cb3dSCy Schubert	in @code{host@group} form for the host certificate's subject and issuer
232*2b15cb3dSCy Schubert	fields.  Specifying '@code{-s @group}' is allowed, and results in
233*2b15cb3dSCy Schubert	leaving the host name unchanged while appending @code{@group} to the
234*2b15cb3dSCy Schubert	subject and issuer fields, as with @code{-i group}.  The group name, or
235*2b15cb3dSCy Schubert	if not provided, the host name are also used in the file names
236*2b15cb3dSCy Schubert	of IFF, GQ, and MV client parameter files.
237ea906c41SOllivier Robert		_EndOfDoc_;
238ea906c41SOllivier Robert};
239ea906c41SOllivier Robert
240ea906c41SOllivier Robertflag = {
241ea906c41SOllivier Robert    value     = T;
242*2b15cb3dSCy Schubert    name      = trusted-cert;
243*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
244ea906c41SOllivier Robert    descrip   = "trusted certificate (TC scheme)";
245ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
246*2b15cb3dSCy Schubert	Generate a trusted certificate.  By default, the program generates
247*2b15cb3dSCy Schubert	a non-trusted certificate.
248ea906c41SOllivier Robert	_EndOfDoc_;
249ea906c41SOllivier Robert};
250ea906c41SOllivier Robert
251ea906c41SOllivier Robertflag = {
252ea906c41SOllivier Robert    value     = V;
253*2b15cb3dSCy Schubert    name      = mv-params;
254ea906c41SOllivier Robert    arg-type  = number;
255ea906c41SOllivier Robert    arg-name  = num;
256*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
257ea906c41SOllivier Robert    descrip   = "generate <num> MV parameters";
258ea906c41SOllivier Robert    doc = <<-  _EndOfDoc_
259*2b15cb3dSCy Schubert	Generate parameters and keys for the Mu-Varadharajan (MV)
260*2b15cb3dSCy Schubert	identification scheme.
261ea906c41SOllivier Robert	_EndOfDoc_;
262ea906c41SOllivier Robert};
263ea906c41SOllivier Robert
264ea906c41SOllivier Robertflag = {
265ea906c41SOllivier Robert    value     = v;
266*2b15cb3dSCy Schubert    name      = mv-keys;
267ea906c41SOllivier Robert    arg-type  = number;
268ea906c41SOllivier Robert    arg-name  = num;
269*2b15cb3dSCy Schubert    ifdef     = AUTOKEY;
270ea906c41SOllivier Robert    descrip   = "update <num> MV keys";
271ea906c41SOllivier Robert};
272ea906c41SOllivier Robert
273*2b15cb3dSCy Schubert/* explain: Additional information whenever the usage routine is invoked */
274*2b15cb3dSCy Schubertexplain = <<- _END_EXPLAIN
275*2b15cb3dSCy Schubert	_END_EXPLAIN;
276*2b15cb3dSCy Schubert
277*2b15cb3dSCy Schubertdoc-section	= {
278*2b15cb3dSCy Schubert  ds-type	= 'DESCRIPTION';
279*2b15cb3dSCy Schubert  ds-format	= 'mdoc';
280*2b15cb3dSCy Schubert  ds-text	= <<- _END_PROG_MDOC_DESCRIP
281*2b15cb3dSCy SchubertThis program generates cryptographic data files used by the NTPv4
282*2b15cb3dSCy Schubertauthentication and identification schemes.
283*2b15cb3dSCy SchubertIt generates MD5 key files used in symmetric key cryptography.
284*2b15cb3dSCy SchubertIn addition, if the OpenSSL software library has been installed,
285*2b15cb3dSCy Schubertit generates keys, certificate and identity files used in public key
286*2b15cb3dSCy Schubertcryptography.
287*2b15cb3dSCy SchubertThese files are used for cookie encryption,
288*2b15cb3dSCy Schubertdigital signature and challenge/response identification algorithms
289*2b15cb3dSCy Schubertcompatible with the Internet standard security infrastructure.
290*2b15cb3dSCy Schubert.Pp
291*2b15cb3dSCy SchubertAll files are in PEM-encoded printable ASCII format,
292*2b15cb3dSCy Schubertso they can be embedded as MIME attachments in mail to other sites
293*2b15cb3dSCy Schubertand certificate authorities.
294*2b15cb3dSCy SchubertBy default, files are not encrypted.
295*2b15cb3dSCy Schubert.Pp
296*2b15cb3dSCy SchubertWhen used to generate message digest keys, the program produces a file
297*2b15cb3dSCy Schubertcontaining ten pseudo-random printable ASCII strings suitable for the
298*2b15cb3dSCy SchubertMD5 message digest algorithm included in the distribution.
299*2b15cb3dSCy SchubertIf the OpenSSL library is installed, it produces an additional ten
300*2b15cb3dSCy Schuberthex-encoded random bit strings suitable for the SHA1 and other message
301*2b15cb3dSCy Schubertdigest algorithms.
302*2b15cb3dSCy SchubertThe message digest keys file must be distributed and stored
303*2b15cb3dSCy Schubertusing secure means beyond the scope of NTP itself.
304*2b15cb3dSCy SchubertBesides the keys used for ordinary NTP associations, additional keys
305*2b15cb3dSCy Schubertcan be defined as passwords for the
306*2b15cb3dSCy Schubert.Xr ntpq 1ntpqmdoc
307*2b15cb3dSCy Schubertand
308*2b15cb3dSCy Schubert.Xr ntpdc 1ntpdcmdoc
309*2b15cb3dSCy Schubertutility programs.
310*2b15cb3dSCy Schubert.Pp
311*2b15cb3dSCy SchubertThe remaining generated files are compatible with other OpenSSL
312*2b15cb3dSCy Schubertapplications and other Public Key Infrastructure (PKI) resources.
313*2b15cb3dSCy SchubertCertificates generated by this program are compatible with extant
314*2b15cb3dSCy Schubertindustry practice, although some users might find the interpretation of
315*2b15cb3dSCy SchubertX509v3 extension fields somewhat liberal.
316*2b15cb3dSCy SchubertHowever, the identity keys are probably not compatible with anything
317*2b15cb3dSCy Schubertother than Autokey.
318*2b15cb3dSCy Schubert.Pp
319*2b15cb3dSCy SchubertSome files used by this program are encrypted using a private password.
320*2b15cb3dSCy SchubertThe
321*2b15cb3dSCy Schubert.Fl p
322*2b15cb3dSCy Schubertoption specifies the password for local encrypted files and the
323*2b15cb3dSCy Schubert.Fl q
324*2b15cb3dSCy Schubertoption the password for encrypted files sent to remote sites.
325*2b15cb3dSCy SchubertIf no password is specified, the host name returned by the Unix
326*2b15cb3dSCy Schubert.Fn gethostname
327*2b15cb3dSCy Schubertfunction, normally the DNS name of the host is used.
328*2b15cb3dSCy Schubert.Pp
329*2b15cb3dSCy SchubertThe
330*2b15cb3dSCy Schubert.Ar pw
331*2b15cb3dSCy Schubertoption of the
332*2b15cb3dSCy Schubert.Ar crypto
333*2b15cb3dSCy Schubertconfiguration command specifies the read
334*2b15cb3dSCy Schubertpassword for previously encrypted local files.
335*2b15cb3dSCy SchubertThis must match the local password used by this program.
336*2b15cb3dSCy SchubertIf not specified, the host name is used.
337*2b15cb3dSCy SchubertThus, if files are generated by this program without password,
338*2b15cb3dSCy Schubertthey can be read back by
339*2b15cb3dSCy Schubert.Ar ntpd
340*2b15cb3dSCy Schubertwithout password but only on the same host.
341*2b15cb3dSCy Schubert.Pp
342*2b15cb3dSCy SchubertNormally, encrypted files for each host are generated by that host and
343*2b15cb3dSCy Schubertused only by that host, although exceptions exist as noted later on
344*2b15cb3dSCy Schubertthis page.
345*2b15cb3dSCy SchubertThe symmetric keys file, normally called
346*2b15cb3dSCy Schubert.Ar ntp.keys ,
347*2b15cb3dSCy Schubertis usually installed in
348*2b15cb3dSCy Schubert.Pa /etc .
349*2b15cb3dSCy SchubertOther files and links are usually installed in
350*2b15cb3dSCy Schubert.Pa /usr/local/etc ,
351*2b15cb3dSCy Schubertwhich is normally in a shared filesystem in
352*2b15cb3dSCy SchubertNFS-mounted networks and cannot be changed by shared clients.
353*2b15cb3dSCy SchubertThe location of the keys directory can be changed by the
354*2b15cb3dSCy Schubert.Ar keysdir
355*2b15cb3dSCy Schubertconfiguration command in such cases.
356*2b15cb3dSCy SchubertNormally, this is in
357*2b15cb3dSCy Schubert.Pa /etc .
358*2b15cb3dSCy Schubert.Pp
359*2b15cb3dSCy SchubertThis program directs commentary and error messages to the standard
360*2b15cb3dSCy Schuberterror stream
361*2b15cb3dSCy Schubert.Ar stderr
362*2b15cb3dSCy Schubertand remote files to the standard output stream
363*2b15cb3dSCy Schubert.Ar stdout
364*2b15cb3dSCy Schubertwhere they can be piped to other applications or redirected to files.
365*2b15cb3dSCy SchubertThe names used for generated files and links all begin with the
366*2b15cb3dSCy Schubertstring
367*2b15cb3dSCy Schubert.Ar ntpkey
368*2b15cb3dSCy Schubertand include the file type, generating host and filestamp,
369*2b15cb3dSCy Schubertas described in the
370*2b15cb3dSCy Schubert.Dq Cryptographic Data Files
371*2b15cb3dSCy Schubertsection below.
372*2b15cb3dSCy Schubert.Ss Running the Program
373*2b15cb3dSCy SchubertTo test and gain experience with Autokey concepts, log in as root and
374*2b15cb3dSCy Schubertchange to the keys directory, usually
375*2b15cb3dSCy Schubert.Pa /usr/local/etc
376*2b15cb3dSCy SchubertWhen run for the first time, or if all files with names beginning with
377*2b15cb3dSCy Schubert.Ar ntpkey
378*2b15cb3dSCy Schuberthave been removed, use the
379*2b15cb3dSCy Schubert.Nm
380*2b15cb3dSCy Schubertcommand without arguments to generate a
381*2b15cb3dSCy Schubertdefault RSA host key and matching RSA-MD5 certificate with expiration
382*2b15cb3dSCy Schubertdate one year hence.
383*2b15cb3dSCy SchubertIf run again without options, the program uses the
384*2b15cb3dSCy Schubertexisting keys and parameters and generates only a new certificate with
385*2b15cb3dSCy Schubertnew expiration date one year hence.
386*2b15cb3dSCy Schubert.Pp
387*2b15cb3dSCy SchubertRun the command on as many hosts as necessary.
388*2b15cb3dSCy SchubertDesignate one of them as the trusted host (TH) using
389*2b15cb3dSCy Schubert.Nm
390*2b15cb3dSCy Schubertwith the
391*2b15cb3dSCy Schubert.Fl T
392*2b15cb3dSCy Schubertoption and configure it to synchronize from reliable Internet servers.
393*2b15cb3dSCy SchubertThen configure the other hosts to synchronize to the TH directly or
394*2b15cb3dSCy Schubertindirectly.
395*2b15cb3dSCy SchubertA certificate trail is created when Autokey asks the immediately
396*2b15cb3dSCy Schubertascendant host towards the TH to sign its certificate, which is then
397*2b15cb3dSCy Schubertprovided to the immediately descendant host on request.
398*2b15cb3dSCy SchubertAll group hosts should have acyclic certificate trails ending on the TH.
399*2b15cb3dSCy Schubert.Pp
400*2b15cb3dSCy SchubertThe host key is used to encrypt the cookie when required and so must be
401*2b15cb3dSCy SchubertRSA type.
402*2b15cb3dSCy SchubertBy default, the host key is also the sign key used to encrypt
403*2b15cb3dSCy Schubertsignatures.
404*2b15cb3dSCy SchubertA different sign key can be assigned using the
405*2b15cb3dSCy Schubert.Fl S
406*2b15cb3dSCy Schubertoption and this can be either RSA or DSA type.
407*2b15cb3dSCy SchubertBy default, the signature
408*2b15cb3dSCy Schubertmessage digest type is MD5, but any combination of sign key type and
409*2b15cb3dSCy Schubertmessage digest type supported by the OpenSSL library can be specified
410*2b15cb3dSCy Schubertusing the
411*2b15cb3dSCy Schubert.Fl c
412*2b15cb3dSCy Schubertoption.
413*2b15cb3dSCy SchubertThe rules say cryptographic media should be generated with proventic
414*2b15cb3dSCy Schubertfilestamps, which means the host should already be synchronized before
415*2b15cb3dSCy Schubertthis program is run.
416*2b15cb3dSCy SchubertThis of course creates a chicken-and-egg problem
417*2b15cb3dSCy Schubertwhen the host is started for the first time.
418*2b15cb3dSCy SchubertAccordingly, the host time
419*2b15cb3dSCy Schubertshould be set by some other means, such as eyeball-and-wristwatch, at
420*2b15cb3dSCy Schubertleast so that the certificate lifetime is within the current year.
421*2b15cb3dSCy SchubertAfter that and when the host is synchronized to a proventic source, the
422*2b15cb3dSCy Schubertcertificate should be re-generated.
423*2b15cb3dSCy Schubert.Pp
424*2b15cb3dSCy SchubertAdditional information on trusted groups and identity schemes is on the
425*2b15cb3dSCy Schubert.Dq Autokey Public-Key Authentication
426*2b15cb3dSCy Schubertpage.
427*2b15cb3dSCy Schubert
428*2b15cb3dSCy Schubert
429*2b15cb3dSCy Schubert.Pp
430*2b15cb3dSCy SchubertThe
431*2b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc
432*2b15cb3dSCy Schubertconfiguration command
433*2b15cb3dSCy Schubert.Ic crypto pw Ar password
434*2b15cb3dSCy Schubertspecifies the read password for previously encrypted files.
435*2b15cb3dSCy SchubertThe daemon expires on the spot if the password is missing
436*2b15cb3dSCy Schubertor incorrect.
437*2b15cb3dSCy SchubertFor convenience, if a file has been previously encrypted,
438*2b15cb3dSCy Schubertthe default read password is the name of the host running
439*2b15cb3dSCy Schubertthe program.
440*2b15cb3dSCy SchubertIf the previous write password is specified as the host name,
441*2b15cb3dSCy Schubertthese files can be read by that host with no explicit password.
442*2b15cb3dSCy Schubert
443*2b15cb3dSCy Schubert.Pp
444*2b15cb3dSCy SchubertFile names begin with the prefix
445*2b15cb3dSCy Schubert.Cm ntpkey_
446*2b15cb3dSCy Schubertand end with the postfix
447*2b15cb3dSCy Schubert.Ar _hostname.filestamp ,
448*2b15cb3dSCy Schubertwhere
449*2b15cb3dSCy Schubert.Ar hostname
450*2b15cb3dSCy Schubertis the owner name, usually the string returned
451*2b15cb3dSCy Schubertby the Unix gethostname() routine, and
452*2b15cb3dSCy Schubert.Ar filestamp
453*2b15cb3dSCy Schubertis the NTP seconds when the file was generated, in decimal digits.
454*2b15cb3dSCy SchubertThis both guarantees uniqueness and simplifies maintenance
455*2b15cb3dSCy Schubertprocedures, since all files can be quickly removed
456*2b15cb3dSCy Schubertby a
457*2b15cb3dSCy Schubert.Ic rm ntpkey\&*
458*2b15cb3dSCy Schubertcommand or all files generated
459*2b15cb3dSCy Schubertat a specific time can be removed by a
460*2b15cb3dSCy Schubert.Ic rm
461*2b15cb3dSCy Schubert.Ar \&*filestamp
462*2b15cb3dSCy Schubertcommand.
463*2b15cb3dSCy SchubertTo further reduce the risk of misconfiguration,
464*2b15cb3dSCy Schubertthe first two lines of a file contain the file name
465*2b15cb3dSCy Schubertand generation date and time as comments.
466*2b15cb3dSCy Schubert.Pp
467*2b15cb3dSCy SchubertAll files are installed by default in the keys directory
468*2b15cb3dSCy Schubert.Pa /usr/local/etc ,
469*2b15cb3dSCy Schubertwhich is normally in a shared filesystem
470*2b15cb3dSCy Schubertin NFS-mounted networks.
471*2b15cb3dSCy SchubertThe actual location of the keys directory
472*2b15cb3dSCy Schubertand each file can be overridden by configuration commands,
473*2b15cb3dSCy Schubertbut this is not recommended.
474*2b15cb3dSCy SchubertNormally, the files for each host are generated by that host
475*2b15cb3dSCy Schubertand used only by that host, although exceptions exist
476*2b15cb3dSCy Schubertas noted later on this page.
477*2b15cb3dSCy Schubert.Pp
478*2b15cb3dSCy SchubertNormally, files containing private values,
479*2b15cb3dSCy Schubertincluding the host key, sign key and identification parameters,
480*2b15cb3dSCy Schubertare permitted root read/write-only;
481*2b15cb3dSCy Schubertwhile others containing public values are permitted world readable.
482*2b15cb3dSCy SchubertAlternatively, files containing private values can be encrypted
483*2b15cb3dSCy Schubertand these files permitted world readable,
484*2b15cb3dSCy Schubertwhich simplifies maintenance in shared file systems.
485*2b15cb3dSCy SchubertSince uniqueness is insured by the hostname and
486*2b15cb3dSCy Schubertfile name extensions, the files for a NFS server and
487*2b15cb3dSCy Schubertdependent clients can all be installed in the same shared directory.
488*2b15cb3dSCy Schubert.Pp
489*2b15cb3dSCy SchubertThe recommended practice is to keep the file name extensions
490*2b15cb3dSCy Schubertwhen installing a file and to install a soft link
491*2b15cb3dSCy Schubertfrom the generic names specified elsewhere on this page
492*2b15cb3dSCy Schubertto the generated files.
493*2b15cb3dSCy SchubertThis allows new file generations to be activated simply
494*2b15cb3dSCy Schubertby changing the link.
495*2b15cb3dSCy SchubertIf a link is present, ntpd follows it to the file name
496*2b15cb3dSCy Schubertto extract the filestamp.
497*2b15cb3dSCy SchubertIf a link is not present,
498*2b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc
499*2b15cb3dSCy Schubertextracts the filestamp from the file itself.
500*2b15cb3dSCy SchubertThis allows clients to verify that the file and generation times
501*2b15cb3dSCy Schubertare always current.
502*2b15cb3dSCy SchubertThe
503*2b15cb3dSCy Schubert.Nm
504*2b15cb3dSCy Schubertprogram uses the same timestamp extension for all files generated
505*2b15cb3dSCy Schubertat one time, so each generation is distinct and can be readily
506*2b15cb3dSCy Schubertrecognized in monitoring data.
507*2b15cb3dSCy Schubert.Ss Running the program
508*2b15cb3dSCy SchubertThe safest way to run the
509*2b15cb3dSCy Schubert.Nm
510*2b15cb3dSCy Schubertprogram is logged in directly as root.
511*2b15cb3dSCy SchubertThe recommended procedure is change to the keys directory,
512*2b15cb3dSCy Schubertusually
513*2b15cb3dSCy Schubert.Pa /usr/local/etc ,
514*2b15cb3dSCy Schubertthen run the program.
515*2b15cb3dSCy SchubertWhen run for the first time,
516*2b15cb3dSCy Schubertor if all
517*2b15cb3dSCy Schubert.Cm ntpkey
518*2b15cb3dSCy Schubertfiles have been removed,
519*2b15cb3dSCy Schubertthe program generates a RSA host key file and matching RSA-MD5 certificate file,
520*2b15cb3dSCy Schubertwhich is all that is necessary in many cases.
521*2b15cb3dSCy SchubertThe program also generates soft links from the generic names
522*2b15cb3dSCy Schubertto the respective files.
523*2b15cb3dSCy SchubertIf run again, the program uses the same host key file,
524*2b15cb3dSCy Schubertbut generates a new certificate file and link.
525*2b15cb3dSCy Schubert.Pp
526*2b15cb3dSCy SchubertThe host key is used to encrypt the cookie when required and so must be RSA type.
527*2b15cb3dSCy SchubertBy default, the host key is also the sign key used to encrypt signatures.
528*2b15cb3dSCy SchubertWhen necessary, a different sign key can be specified and this can be
529*2b15cb3dSCy Schuberteither RSA or DSA type.
530*2b15cb3dSCy SchubertBy default, the message digest type is MD5, but any combination
531*2b15cb3dSCy Schubertof sign key type and message digest type supported by the OpenSSL library
532*2b15cb3dSCy Schubertcan be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
533*2b15cb3dSCy Schubertand RIPE160 message digest algorithms.
534*2b15cb3dSCy SchubertHowever, the scheme specified in the certificate must be compatible
535*2b15cb3dSCy Schubertwith the sign key.
536*2b15cb3dSCy SchubertCertificates using any digest algorithm are compatible with RSA sign keys;
537*2b15cb3dSCy Schuberthowever, only SHA and SHA1 certificates are compatible with DSA sign keys.
538*2b15cb3dSCy Schubert.Pp
539*2b15cb3dSCy SchubertPrivate/public key files and certificates are compatible with
540*2b15cb3dSCy Schubertother OpenSSL applications and very likely other libraries as well.
541*2b15cb3dSCy SchubertCertificates or certificate requests derived from them should be compatible
542*2b15cb3dSCy Schubertwith extant industry practice, although some users might find
543*2b15cb3dSCy Schubertthe interpretation of X509v3 extension fields somewhat liberal.
544*2b15cb3dSCy SchubertHowever, the identification parameter files, although encoded
545*2b15cb3dSCy Schubertas the other files, are probably not compatible with anything other than Autokey.
546*2b15cb3dSCy Schubert.Pp
547*2b15cb3dSCy SchubertRunning the program as other than root and using the Unix
548*2b15cb3dSCy Schubert.Ic su
549*2b15cb3dSCy Schubertcommand
550*2b15cb3dSCy Schubertto assume root may not work properly, since by default the OpenSSL library
551*2b15cb3dSCy Schubertlooks for the random seed file
552*2b15cb3dSCy Schubert.Cm .rnd
553*2b15cb3dSCy Schubertin the user home directory.
554*2b15cb3dSCy SchubertHowever, there should be only one
555*2b15cb3dSCy Schubert.Cm .rnd ,
556*2b15cb3dSCy Schubertmost conveniently
557*2b15cb3dSCy Schubertin the root directory, so it is convenient to define the
558*2b15cb3dSCy Schubert.Cm $RANDFILE
559*2b15cb3dSCy Schubertenvironment variable used by the OpenSSL library as the path to
560*2b15cb3dSCy Schubert.Cm /.rnd .
561*2b15cb3dSCy Schubert.Pp
562*2b15cb3dSCy SchubertInstalling the keys as root might not work in NFS-mounted
563*2b15cb3dSCy Schubertshared file systems, as NFS clients may not be able to write
564*2b15cb3dSCy Schubertto the shared keys directory, even as root.
565*2b15cb3dSCy SchubertIn this case, NFS clients can specify the files in another
566*2b15cb3dSCy Schubertdirectory such as
567*2b15cb3dSCy Schubert.Pa /etc
568*2b15cb3dSCy Schubertusing the
569*2b15cb3dSCy Schubert.Ic keysdir
570*2b15cb3dSCy Schubertcommand.
571*2b15cb3dSCy SchubertThere is no need for one client to read the keys and certificates
572*2b15cb3dSCy Schubertof other clients or servers, as these data are obtained automatically
573*2b15cb3dSCy Schubertby the Autokey protocol.
574*2b15cb3dSCy Schubert.Pp
575*2b15cb3dSCy SchubertOrdinarily, cryptographic files are generated by the host that uses them,
576*2b15cb3dSCy Schubertbut it is possible for a trusted agent (TA) to generate these files
577*2b15cb3dSCy Schubertfor other hosts; however, in such cases files should always be encrypted.
578*2b15cb3dSCy SchubertThe subject name and trusted name default to the hostname
579*2b15cb3dSCy Schubertof the host generating the files, but can be changed by command line options.
580*2b15cb3dSCy SchubertIt is convenient to designate the owner name and trusted name
581*2b15cb3dSCy Schubertas the subject and issuer fields, respectively, of the certificate.
582*2b15cb3dSCy SchubertThe owner name is also used for the host and sign key files,
583*2b15cb3dSCy Schubertwhile the trusted name is used for the identity files.
584*2b15cb3dSCy Schubert
585*2b15cb3dSCy Schubert.Pp
586*2b15cb3dSCy SchubertAll files are installed by default in the keys directory
587*2b15cb3dSCy Schubert.Pa /usr/local/etc ,
588*2b15cb3dSCy Schubertwhich is normally in a shared filesystem
589*2b15cb3dSCy Schubertin NFS-mounted networks.
590*2b15cb3dSCy SchubertThe actual location of the keys directory
591*2b15cb3dSCy Schubertand each file can be overridden by configuration commands,
592*2b15cb3dSCy Schubertbut this is not recommended.
593*2b15cb3dSCy SchubertNormally, the files for each host are generated by that host
594*2b15cb3dSCy Schubertand used only by that host, although exceptions exist
595*2b15cb3dSCy Schubertas noted later on this page.
596*2b15cb3dSCy Schubert.Pp
597*2b15cb3dSCy SchubertNormally, files containing private values,
598*2b15cb3dSCy Schubertincluding the host key, sign key and identification parameters,
599*2b15cb3dSCy Schubertare permitted root read/write-only;
600*2b15cb3dSCy Schubertwhile others containing public values are permitted world readable.
601*2b15cb3dSCy SchubertAlternatively, files containing private values can be encrypted
602*2b15cb3dSCy Schubertand these files permitted world readable,
603*2b15cb3dSCy Schubertwhich simplifies maintenance in shared file systems.
604*2b15cb3dSCy SchubertSince uniqueness is insured by the hostname and
605*2b15cb3dSCy Schubertfile name extensions, the files for a NFS server and
606*2b15cb3dSCy Schubertdependent clients can all be installed in the same shared directory.
607*2b15cb3dSCy Schubert.Pp
608*2b15cb3dSCy SchubertThe recommended practice is to keep the file name extensions
609*2b15cb3dSCy Schubertwhen installing a file and to install a soft link
610*2b15cb3dSCy Schubertfrom the generic names specified elsewhere on this page
611*2b15cb3dSCy Schubertto the generated files.
612*2b15cb3dSCy SchubertThis allows new file generations to be activated simply
613*2b15cb3dSCy Schubertby changing the link.
614*2b15cb3dSCy SchubertIf a link is present, ntpd follows it to the file name
615*2b15cb3dSCy Schubertto extract the filestamp.
616*2b15cb3dSCy SchubertIf a link is not present,
617*2b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc
618*2b15cb3dSCy Schubertextracts the filestamp from the file itself.
619*2b15cb3dSCy SchubertThis allows clients to verify that the file and generation times
620*2b15cb3dSCy Schubertare always current.
621*2b15cb3dSCy SchubertThe
622*2b15cb3dSCy Schubert.Nm
623*2b15cb3dSCy Schubertprogram uses the same timestamp extension for all files generated
624*2b15cb3dSCy Schubertat one time, so each generation is distinct and can be readily
625*2b15cb3dSCy Schubertrecognized in monitoring data.
626*2b15cb3dSCy Schubert.Ss Running the program
627*2b15cb3dSCy SchubertThe safest way to run the
628*2b15cb3dSCy Schubert.Nm
629*2b15cb3dSCy Schubertprogram is logged in directly as root.
630*2b15cb3dSCy SchubertThe recommended procedure is change to the keys directory,
631*2b15cb3dSCy Schubertusually
632*2b15cb3dSCy Schubert.Pa /usr/local/etc ,
633*2b15cb3dSCy Schubertthen run the program.
634*2b15cb3dSCy SchubertWhen run for the first time,
635*2b15cb3dSCy Schubertor if all
636*2b15cb3dSCy Schubert.Cm ntpkey
637*2b15cb3dSCy Schubertfiles have been removed,
638*2b15cb3dSCy Schubertthe program generates a RSA host key file and matching RSA-MD5 certificate file,
639*2b15cb3dSCy Schubertwhich is all that is necessary in many cases.
640*2b15cb3dSCy SchubertThe program also generates soft links from the generic names
641*2b15cb3dSCy Schubertto the respective files.
642*2b15cb3dSCy SchubertIf run again, the program uses the same host key file,
643*2b15cb3dSCy Schubertbut generates a new certificate file and link.
644*2b15cb3dSCy Schubert.Pp
645*2b15cb3dSCy SchubertThe host key is used to encrypt the cookie when required and so must be RSA type.
646*2b15cb3dSCy SchubertBy default, the host key is also the sign key used to encrypt signatures.
647*2b15cb3dSCy SchubertWhen necessary, a different sign key can be specified and this can be
648*2b15cb3dSCy Schuberteither RSA or DSA type.
649*2b15cb3dSCy SchubertBy default, the message digest type is MD5, but any combination
650*2b15cb3dSCy Schubertof sign key type and message digest type supported by the OpenSSL library
651*2b15cb3dSCy Schubertcan be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
652*2b15cb3dSCy Schubertand RIPE160 message digest algorithms.
653*2b15cb3dSCy SchubertHowever, the scheme specified in the certificate must be compatible
654*2b15cb3dSCy Schubertwith the sign key.
655*2b15cb3dSCy SchubertCertificates using any digest algorithm are compatible with RSA sign keys;
656*2b15cb3dSCy Schuberthowever, only SHA and SHA1 certificates are compatible with DSA sign keys.
657*2b15cb3dSCy Schubert.Pp
658*2b15cb3dSCy SchubertPrivate/public key files and certificates are compatible with
659*2b15cb3dSCy Schubertother OpenSSL applications and very likely other libraries as well.
660*2b15cb3dSCy SchubertCertificates or certificate requests derived from them should be compatible
661*2b15cb3dSCy Schubertwith extant industry practice, although some users might find
662*2b15cb3dSCy Schubertthe interpretation of X509v3 extension fields somewhat liberal.
663*2b15cb3dSCy SchubertHowever, the identification parameter files, although encoded
664*2b15cb3dSCy Schubertas the other files, are probably not compatible with anything other than Autokey.
665*2b15cb3dSCy Schubert.Pp
666*2b15cb3dSCy SchubertRunning the program as other than root and using the Unix
667*2b15cb3dSCy Schubert.Ic su
668*2b15cb3dSCy Schubertcommand
669*2b15cb3dSCy Schubertto assume root may not work properly, since by default the OpenSSL library
670*2b15cb3dSCy Schubertlooks for the random seed file
671*2b15cb3dSCy Schubert.Cm .rnd
672*2b15cb3dSCy Schubertin the user home directory.
673*2b15cb3dSCy SchubertHowever, there should be only one
674*2b15cb3dSCy Schubert.Cm .rnd ,
675*2b15cb3dSCy Schubertmost conveniently
676*2b15cb3dSCy Schubertin the root directory, so it is convenient to define the
677*2b15cb3dSCy Schubert.Cm $RANDFILE
678*2b15cb3dSCy Schubertenvironment variable used by the OpenSSL library as the path to
679*2b15cb3dSCy Schubert.Cm /.rnd .
680*2b15cb3dSCy Schubert.Pp
681*2b15cb3dSCy SchubertInstalling the keys as root might not work in NFS-mounted
682*2b15cb3dSCy Schubertshared file systems, as NFS clients may not be able to write
683*2b15cb3dSCy Schubertto the shared keys directory, even as root.
684*2b15cb3dSCy SchubertIn this case, NFS clients can specify the files in another
685*2b15cb3dSCy Schubertdirectory such as
686*2b15cb3dSCy Schubert.Pa /etc
687*2b15cb3dSCy Schubertusing the
688*2b15cb3dSCy Schubert.Ic keysdir
689*2b15cb3dSCy Schubertcommand.
690*2b15cb3dSCy SchubertThere is no need for one client to read the keys and certificates
691*2b15cb3dSCy Schubertof other clients or servers, as these data are obtained automatically
692*2b15cb3dSCy Schubertby the Autokey protocol.
693*2b15cb3dSCy Schubert.Pp
694*2b15cb3dSCy SchubertOrdinarily, cryptographic files are generated by the host that uses them,
695*2b15cb3dSCy Schubertbut it is possible for a trusted agent (TA) to generate these files
696*2b15cb3dSCy Schubertfor other hosts; however, in such cases files should always be encrypted.
697*2b15cb3dSCy SchubertThe subject name and trusted name default to the hostname
698*2b15cb3dSCy Schubertof the host generating the files, but can be changed by command line options.
699*2b15cb3dSCy SchubertIt is convenient to designate the owner name and trusted name
700*2b15cb3dSCy Schubertas the subject and issuer fields, respectively, of the certificate.
701*2b15cb3dSCy SchubertThe owner name is also used for the host and sign key files,
702*2b15cb3dSCy Schubertwhile the trusted name is used for the identity files.
703*2b15cb3dSCy Schubertseconds.
704*2b15cb3dSCy Schubertseconds.
705*2b15cb3dSCy Schubert
706*2b15cb3dSCy Schuberts Trusted Hosts and Groups
707*2b15cb3dSCy SchubertEach cryptographic configuration involves selection of a signature scheme
708*2b15cb3dSCy Schubertand identification scheme, called a cryptotype,
709*2b15cb3dSCy Schubertas explained in the
710*2b15cb3dSCy Schubert.Sx Authentication Options
711*2b15cb3dSCy Schubertsection of
712*2b15cb3dSCy Schubert.Xr ntp.conf 5 .
713*2b15cb3dSCy SchubertThe default cryptotype uses RSA encryption, MD5 message digest
714*2b15cb3dSCy Schubertand TC identification.
715*2b15cb3dSCy SchubertFirst, configure a NTP subnet including one or more low-stratum
716*2b15cb3dSCy Schuberttrusted hosts from which all other hosts derive synchronization
717*2b15cb3dSCy Schubertdirectly or indirectly.
718*2b15cb3dSCy SchubertTrusted hosts have trusted certificates;
719*2b15cb3dSCy Schubertall other hosts have nontrusted certificates.
720*2b15cb3dSCy SchubertThese hosts will automatically and dynamically build authoritative
721*2b15cb3dSCy Schubertcertificate trails to one or more trusted hosts.
722*2b15cb3dSCy SchubertA trusted group is the set of all hosts that have, directly or indirectly,
723*2b15cb3dSCy Schuberta certificate trail ending at a trusted host.
724*2b15cb3dSCy SchubertThe trail is defined by static configuration file entries
725*2b15cb3dSCy Schubertor dynamic means described on the
726*2b15cb3dSCy Schubert.Sx Automatic NTP Configuration Options
727*2b15cb3dSCy Schubertsection of
728*2b15cb3dSCy Schubert.Xr ntp.conf 5 .
729*2b15cb3dSCy Schubert.Pp
730*2b15cb3dSCy SchubertOn each trusted host as root, change to the keys directory.
731*2b15cb3dSCy SchubertTo insure a fresh fileset, remove all
732*2b15cb3dSCy Schubert.Cm ntpkey
733*2b15cb3dSCy Schubertfiles.
734*2b15cb3dSCy SchubertThen run
735*2b15cb3dSCy Schubert.Nm
736*2b15cb3dSCy Schubert.Fl T
737*2b15cb3dSCy Schubertto generate keys and a trusted certificate.
738*2b15cb3dSCy SchubertOn all other hosts do the same, but leave off the
739*2b15cb3dSCy Schubert.Fl T
740*2b15cb3dSCy Schubertflag to generate keys and nontrusted certificates.
741*2b15cb3dSCy SchubertWhen complete, start the NTP daemons beginning at the lowest stratum
742*2b15cb3dSCy Schubertand working up the tree.
743*2b15cb3dSCy SchubertIt may take some time for Autokey to instantiate the certificate trails
744*2b15cb3dSCy Schubertthroughout the subnet, but setting up the environment is completely automatic.
745*2b15cb3dSCy Schubert.Pp
746*2b15cb3dSCy SchubertIf it is necessary to use a different sign key or different digest/signature
747*2b15cb3dSCy Schubertscheme than the default, run
748*2b15cb3dSCy Schubert.Nm
749*2b15cb3dSCy Schubertwith the
750*2b15cb3dSCy Schubert.Fl S Ar type
751*2b15cb3dSCy Schubertoption, where
752*2b15cb3dSCy Schubert.Ar type
753*2b15cb3dSCy Schubertis either
754*2b15cb3dSCy Schubert.Cm RSA
755*2b15cb3dSCy Schubertor
756*2b15cb3dSCy Schubert.Cm DSA .
757*2b15cb3dSCy SchubertThe most often need to do this is when a DSA-signed certificate is used.
758*2b15cb3dSCy SchubertIf it is necessary to use a different certificate scheme than the default,
759*2b15cb3dSCy Schubertrun
760*2b15cb3dSCy Schubert.Nm
761*2b15cb3dSCy Schubertwith the
762*2b15cb3dSCy Schubert.Fl c Ar scheme
763*2b15cb3dSCy Schubertoption and selected
764*2b15cb3dSCy Schubert.Ar scheme
765*2b15cb3dSCy Schubertas needed.
766*2b15cb3dSCy Schubertf
767*2b15cb3dSCy Schubert.Nm
768*2b15cb3dSCy Schubertis run again without these options, it generates a new certificate
769*2b15cb3dSCy Schubertusing the same scheme and sign key.
770*2b15cb3dSCy Schubert.Pp
771*2b15cb3dSCy SchubertAfter setting up the environment it is advisable to update certificates
772*2b15cb3dSCy Schubertfrom time to time, if only to extend the validity interval.
773*2b15cb3dSCy SchubertSimply run
774*2b15cb3dSCy Schubert.Nm
775*2b15cb3dSCy Schubertwith the same flags as before to generate new certificates
776*2b15cb3dSCy Schubertusing existing keys.
777*2b15cb3dSCy SchubertHowever, if the host or sign key is changed,
778*2b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc
779*2b15cb3dSCy Schubertshould be restarted.
780*2b15cb3dSCy SchubertWhen
781*2b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc
782*2b15cb3dSCy Schubertis restarted, it loads any new files and restarts the protocol.
783*2b15cb3dSCy SchubertOther dependent hosts will continue as usual until signatures are refreshed,
784*2b15cb3dSCy Schubertat which time the protocol is restarted.
785*2b15cb3dSCy Schubert.Ss Identity Schemes
786*2b15cb3dSCy SchubertAs mentioned on the Autonomous Authentication page,
787*2b15cb3dSCy Schubertthe default TC identity scheme is vulnerable to a middleman attack.
788*2b15cb3dSCy SchubertHowever, there are more secure identity schemes available,
789*2b15cb3dSCy Schubertincluding PC, IFF, GQ and MV described on the
790*2b15cb3dSCy Schubert.Qq Identification Schemes
791*2b15cb3dSCy Schubertpage
792*2b15cb3dSCy Schubert(maybe available at
793*2b15cb3dSCy Schubert.Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
794*2b15cb3dSCy SchubertThese schemes are based on a TA, one or more trusted hosts
795*2b15cb3dSCy Schubertand some number of nontrusted hosts.
796*2b15cb3dSCy SchubertTrusted hosts prove identity using values provided by the TA,
797*2b15cb3dSCy Schubertwhile the remaining hosts prove identity using values provided
798*2b15cb3dSCy Schubertby a trusted host and certificate trails that end on that host.
799*2b15cb3dSCy SchubertThe name of a trusted host is also the name of its sugroup
800*2b15cb3dSCy Schubertand also the subject and issuer name on its trusted certificate.
801*2b15cb3dSCy SchubertThe TA is not necessarily a trusted host in this sense, but often is.
802*2b15cb3dSCy Schubert.Pp
803*2b15cb3dSCy SchubertIn some schemes there are separate keys for servers and clients.
804*2b15cb3dSCy SchubertA server can also be a client of another server,
805*2b15cb3dSCy Schubertbut a client can never be a server for another client.
806*2b15cb3dSCy SchubertIn general, trusted hosts and nontrusted hosts that operate
807*2b15cb3dSCy Schubertas both server and client have parameter files that contain
808*2b15cb3dSCy Schubertboth server and client keys.
809*2b15cb3dSCy SchubertHosts that operate
810*2b15cb3dSCy Schubertonly as clients have key files that contain only client keys.
811*2b15cb3dSCy Schubert.Pp
812*2b15cb3dSCy SchubertThe PC scheme supports only one trusted host in the group.
813*2b15cb3dSCy SchubertOn trusted host alice run
814*2b15cb3dSCy Schubert.Nm
815*2b15cb3dSCy Schubert.Fl P
816*2b15cb3dSCy Schubert.Fl p Ar password
817*2b15cb3dSCy Schubertto generate the host key file
818*2b15cb3dSCy Schubert.Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
819*2b15cb3dSCy Schubertand trusted private certificate file
820*2b15cb3dSCy Schubert.Pa ntpkey_RSA-MD5_cert_ Ns Ar alice.filestamp .
821*2b15cb3dSCy SchubertCopy both files to all group hosts;
822*2b15cb3dSCy Schubertthey replace the files which would be generated in other schemes.
823*2b15cb3dSCy SchubertOn each host bob install a soft link from the generic name
824*2b15cb3dSCy Schubert.Pa ntpkey_host_ Ns Ar bob
825*2b15cb3dSCy Schubertto the host key file and soft link
826*2b15cb3dSCy Schubert.Pa ntpkey_cert_ Ns Ar bob
827*2b15cb3dSCy Schubertto the private certificate file.
828*2b15cb3dSCy SchubertNote the generic links are on bob, but point to files generated
829*2b15cb3dSCy Schubertby trusted host alice.
830*2b15cb3dSCy SchubertIn this scheme it is not possible to refresh
831*2b15cb3dSCy Schuberteither the keys or certificates without copying them
832*2b15cb3dSCy Schubertto all other hosts in the group.
833*2b15cb3dSCy Schubert.Pp
834*2b15cb3dSCy SchubertFor the IFF scheme proceed as in the TC scheme to generate keys
835*2b15cb3dSCy Schubertand certificates for all group hosts, then for every trusted host in the group,
836*2b15cb3dSCy Schubertgenerate the IFF parameter file.
837*2b15cb3dSCy SchubertOn trusted host alice run
838*2b15cb3dSCy Schubert.Nm
839*2b15cb3dSCy Schubert.Fl T
840*2b15cb3dSCy Schubert.Fl I
841*2b15cb3dSCy Schubert.Fl p Ar password
842*2b15cb3dSCy Schubertto produce her parameter file
843*2b15cb3dSCy Schubert.Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
844*2b15cb3dSCy Schubertwhich includes both server and client keys.
845*2b15cb3dSCy SchubertCopy this file to all group hosts that operate as both servers
846*2b15cb3dSCy Schubertand clients and install a soft link from the generic
847*2b15cb3dSCy Schubert.Pa ntpkey_iff_ Ns Ar alice
848*2b15cb3dSCy Schubertto this file.
849*2b15cb3dSCy SchubertIf there are no hosts restricted to operate only as clients,
850*2b15cb3dSCy Schubertthere is nothing further to do.
851*2b15cb3dSCy SchubertAs the IFF scheme is independent
852*2b15cb3dSCy Schubertof keys and certificates, these files can be refreshed as needed.
853*2b15cb3dSCy Schubert.Pp
854*2b15cb3dSCy SchubertIf a rogue client has the parameter file, it could masquerade
855*2b15cb3dSCy Schubertas a legitimate server and present a middleman threat.
856*2b15cb3dSCy SchubertTo eliminate this threat, the client keys can be extracted
857*2b15cb3dSCy Schubertfrom the parameter file and distributed to all restricted clients.
858*2b15cb3dSCy SchubertAfter generating the parameter file, on alice run
859*2b15cb3dSCy Schubert.Nm
860*2b15cb3dSCy Schubert.Fl e
861*2b15cb3dSCy Schubertand pipe the output to a file or mail program.
862*2b15cb3dSCy SchubertCopy or mail this file to all restricted clients.
863*2b15cb3dSCy SchubertOn these clients install a soft link from the generic
864*2b15cb3dSCy Schubert.Pa ntpkey_iff_ Ns Ar alice
865*2b15cb3dSCy Schubertto this file.
866*2b15cb3dSCy SchubertTo further protect the integrity of the keys,
867*2b15cb3dSCy Schuberteach file can be encrypted with a secret password.
868*2b15cb3dSCy Schubert.Pp
869*2b15cb3dSCy SchubertFor the GQ scheme proceed as in the TC scheme to generate keys
870*2b15cb3dSCy Schubertand certificates for all group hosts, then for every trusted host
871*2b15cb3dSCy Schubertin the group, generate the IFF parameter file.
872*2b15cb3dSCy SchubertOn trusted host alice run
873*2b15cb3dSCy Schubert.Nm
874*2b15cb3dSCy Schubert.Fl T
875*2b15cb3dSCy Schubert.Fl G
876*2b15cb3dSCy Schubert.Fl p Ar password
877*2b15cb3dSCy Schubertto produce her parameter file
878*2b15cb3dSCy Schubert.Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
879*2b15cb3dSCy Schubertwhich includes both server and client keys.
880*2b15cb3dSCy SchubertCopy this file to all group hosts and install a soft link
881*2b15cb3dSCy Schubertfrom the generic
882*2b15cb3dSCy Schubert.Pa ntpkey_gq_ Ns Ar alice
883*2b15cb3dSCy Schubertto this file.
884*2b15cb3dSCy SchubertIn addition, on each host bob install a soft link
885*2b15cb3dSCy Schubertfrom generic
886*2b15cb3dSCy Schubert.Pa ntpkey_gq_ Ns Ar bob
887*2b15cb3dSCy Schubertto this file.
888*2b15cb3dSCy SchubertAs the GQ scheme updates the GQ parameters file and certificate
889*2b15cb3dSCy Schubertat the same time, keys and certificates can be regenerated as needed.
890*2b15cb3dSCy Schubert.Pp
891*2b15cb3dSCy SchubertFor the MV scheme, proceed as in the TC scheme to generate keys
892*2b15cb3dSCy Schubertand certificates for all group hosts.
893*2b15cb3dSCy SchubertFor illustration assume trish is the TA, alice one of several trusted hosts
894*2b15cb3dSCy Schubertand bob one of her clients.
895*2b15cb3dSCy SchubertOn TA trish run
896*2b15cb3dSCy Schubert.Nm
897*2b15cb3dSCy Schubert.Fl V Ar n
898*2b15cb3dSCy Schubert.Fl p Ar password ,
899*2b15cb3dSCy Schubertwhere
900*2b15cb3dSCy Schubert.Ar n
901*2b15cb3dSCy Schubertis the number of revokable keys (typically 5) to produce
902*2b15cb3dSCy Schubertthe parameter file
903*2b15cb3dSCy Schubert.Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
904*2b15cb3dSCy Schubertand client key files
905*2b15cb3dSCy Schubert.Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
906*2b15cb3dSCy Schubertwhere
907*2b15cb3dSCy Schubert.Ar d
908*2b15cb3dSCy Schubertis the key number (0 \&<
909*2b15cb3dSCy Schubert.Ar d
910*2b15cb3dSCy Schubert\&<
911*2b15cb3dSCy Schubert.Ar n ) .
912*2b15cb3dSCy SchubertCopy the parameter file to alice and install a soft link
913*2b15cb3dSCy Schubertfrom the generic
914*2b15cb3dSCy Schubert.Pa ntpkey_mv_ Ns Ar alice
915*2b15cb3dSCy Schubertto this file.
916*2b15cb3dSCy SchubertCopy one of the client key files to alice for later distribution
917*2b15cb3dSCy Schubertto her clients.
918*2b15cb3dSCy SchubertIt doesn't matter which client key file goes to alice,
919*2b15cb3dSCy Schubertsince they all work the same way.
920*2b15cb3dSCy SchubertAlice copies the client key file to all of her cliens.
921*2b15cb3dSCy SchubertOn client bob install a soft link from generic
922*2b15cb3dSCy Schubert.Pa ntpkey_mvkey_ Ns Ar bob
923*2b15cb3dSCy Schubertto the client key file.
924*2b15cb3dSCy SchubertAs the MV scheme is independent of keys and certificates,
925*2b15cb3dSCy Schubertthese files can be refreshed as needed.
926*2b15cb3dSCy Schubert.Ss Command Line Options
927*2b15cb3dSCy Schubert.Bl -tag -width indent
928*2b15cb3dSCy Schubert.It Fl c Ar scheme
929*2b15cb3dSCy SchubertSelect certificate message digest/signature encryption scheme.
930*2b15cb3dSCy SchubertThe
931*2b15cb3dSCy Schubert.Ar scheme
932*2b15cb3dSCy Schubertcan be one of the following:
933*2b15cb3dSCy Schubert. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA ,
934*2b15cb3dSCy Schubertor
935*2b15cb3dSCy Schubert.Cm DSA-SHA1 .
936*2b15cb3dSCy SchubertNote that RSA schemes must be used with a RSA sign key and DSA
937*2b15cb3dSCy Schubertschemes must be used with a DSA sign key.
938*2b15cb3dSCy SchubertThe default without this option is
939*2b15cb3dSCy Schubert.Cm RSA-MD5 .
940*2b15cb3dSCy Schubert.It Fl d
941*2b15cb3dSCy SchubertEnable debugging.
942*2b15cb3dSCy SchubertThis option displays the cryptographic data produced in eye-friendly billboards.
943*2b15cb3dSCy Schubert.It Fl e
944*2b15cb3dSCy SchubertWrite the IFF client keys to the standard output.
945*2b15cb3dSCy SchubertThis is intended for automatic key distribution by mail.
946*2b15cb3dSCy Schubert.It Fl G
947*2b15cb3dSCy SchubertGenerate parameters and keys for the GQ identification scheme,
948*2b15cb3dSCy Schubertobsoleting any that may exist.
949*2b15cb3dSCy Schubert.It Fl g
950*2b15cb3dSCy SchubertGenerate keys for the GQ identification scheme
951*2b15cb3dSCy Schubertusing the existing GQ parameters.
952*2b15cb3dSCy SchubertIf the GQ parameters do not yet exist, create them first.
953*2b15cb3dSCy Schubert.It Fl H
954*2b15cb3dSCy SchubertGenerate new host keys, obsoleting any that may exist.
955*2b15cb3dSCy Schubert.It Fl I
956*2b15cb3dSCy SchubertGenerate parameters for the IFF identification scheme,
957*2b15cb3dSCy Schubertobsoleting any that may exist.
958*2b15cb3dSCy Schubert.It Fl i Ar name
959*2b15cb3dSCy SchubertSet the suject name to
960*2b15cb3dSCy Schubert.Ar name .
961*2b15cb3dSCy SchubertThis is used as the subject field in certificates
962*2b15cb3dSCy Schubertand in the file name for host and sign keys.
963*2b15cb3dSCy Schubert.It Fl M
964*2b15cb3dSCy SchubertGenerate MD5 keys, obsoleting any that may exist.
965*2b15cb3dSCy Schubert.It Fl P
966*2b15cb3dSCy SchubertGenerate a private certificate.
967*2b15cb3dSCy SchubertBy default, the program generates public certificates.
968*2b15cb3dSCy Schubert.It Fl p Ar password
969*2b15cb3dSCy SchubertEncrypt generated files containing private data with
970*2b15cb3dSCy Schubert.Ar password
971*2b15cb3dSCy Schubertand the DES-CBC algorithm.
972*2b15cb3dSCy Schubert.It Fl q
973*2b15cb3dSCy SchubertSet the password for reading files to password.
974*2b15cb3dSCy Schubert.It Fl S Oo Cm RSA | DSA Oc
975*2b15cb3dSCy SchubertGenerate a new sign key of the designated type,
976*2b15cb3dSCy Schubertobsoleting any that may exist.
977*2b15cb3dSCy SchubertBy default, the program uses the host key as the sign key.
978*2b15cb3dSCy Schubert.It Fl s Ar name
979*2b15cb3dSCy SchubertSet the issuer name to
980*2b15cb3dSCy Schubert.Ar name .
981*2b15cb3dSCy SchubertThis is used for the issuer field in certificates
982*2b15cb3dSCy Schubertand in the file name for identity files.
983*2b15cb3dSCy Schubert.It Fl T
984*2b15cb3dSCy SchubertGenerate a trusted certificate.
985*2b15cb3dSCy SchubertBy default, the program generates a non-trusted certificate.
986*2b15cb3dSCy Schubert.It Fl V Ar nkeys
987*2b15cb3dSCy SchubertGenerate parameters and keys for the Mu-Varadharajan (MV) identification scheme.
988*2b15cb3dSCy Schubert.El
989*2b15cb3dSCy Schubert.Ss Random Seed File
990*2b15cb3dSCy SchubertAll cryptographically sound key generation schemes must have means
991*2b15cb3dSCy Schubertto randomize the entropy seed used to initialize
992*2b15cb3dSCy Schubertthe internal pseudo-random number generator used
993*2b15cb3dSCy Schubertby the library routines.
994*2b15cb3dSCy SchubertThe OpenSSL library uses a designated random seed file for this purpose.
995*2b15cb3dSCy SchubertThe file must be available when starting the NTP daemon and
996*2b15cb3dSCy Schubert.Nm
997*2b15cb3dSCy Schubertprogram.
998*2b15cb3dSCy SchubertIf a site supports OpenSSL or its companion OpenSSH,
999*2b15cb3dSCy Schubertit is very likely that means to do this are already available.
1000*2b15cb3dSCy Schubert.Pp
1001*2b15cb3dSCy SchubertIt is important to understand that entropy must be evolved
1002*2b15cb3dSCy Schubertfor each generation, for otherwise the random number sequence
1003*2b15cb3dSCy Schubertwould be predictable.
1004*2b15cb3dSCy SchubertVarious means dependent on external events, such as keystroke intervals,
1005*2b15cb3dSCy Schubertcan be used to do this and some systems have built-in entropy sources.
1006*2b15cb3dSCy SchubertSuitable means are described in the OpenSSL software documentation,
1007*2b15cb3dSCy Schubertbut are outside the scope of this page.
1008*2b15cb3dSCy Schubert.Pp
1009*2b15cb3dSCy SchubertThe entropy seed used by the OpenSSL library is contained in a file,
1010*2b15cb3dSCy Schubertusually called
1011*2b15cb3dSCy Schubert.Cm .rnd ,
1012*2b15cb3dSCy Schubertwhich must be available when starting the NTP daemon
1013*2b15cb3dSCy Schubertor the
1014*2b15cb3dSCy Schubert.Nm
1015*2b15cb3dSCy Schubertprogram.
1016*2b15cb3dSCy SchubertThe NTP daemon will first look for the file
1017*2b15cb3dSCy Schubertusing the path specified by the
1018*2b15cb3dSCy Schubert.Ic randfile
1019*2b15cb3dSCy Schubertsubcommand of the
1020*2b15cb3dSCy Schubert.Ic crypto
1021*2b15cb3dSCy Schubertconfiguration command.
1022*2b15cb3dSCy SchubertIf not specified in this way, or when starting the
1023*2b15cb3dSCy Schubert.Nm
1024*2b15cb3dSCy Schubertprogram,
1025*2b15cb3dSCy Schubertthe OpenSSL library will look for the file using the path specified
1026*2b15cb3dSCy Schubertby the
1027*2b15cb3dSCy Schubert.Ev RANDFILE
1028*2b15cb3dSCy Schubertenvironment variable in the user home directory,
1029*2b15cb3dSCy Schubertwhether root or some other user.
1030*2b15cb3dSCy SchubertIf the
1031*2b15cb3dSCy Schubert.Ev RANDFILE
1032*2b15cb3dSCy Schubertenvironment variable is not present,
1033*2b15cb3dSCy Schubertthe library will look for the
1034*2b15cb3dSCy Schubert.Cm .rnd
1035*2b15cb3dSCy Schubertfile in the user home directory.
1036*2b15cb3dSCy SchubertIf the file is not available or cannot be written,
1037*2b15cb3dSCy Schubertthe daemon exits with a message to the system log and the program
1038*2b15cb3dSCy Schubertexits with a suitable error message.
1039*2b15cb3dSCy Schubert.Ss Cryptographic Data Files
1040*2b15cb3dSCy SchubertAll other file formats begin with two lines.
1041*2b15cb3dSCy SchubertThe first contains the file name, including the generated host name
1042*2b15cb3dSCy Schubertand filestamp.
1043*2b15cb3dSCy SchubertThe second contains the datestamp in conventional Unix date format.
1044*2b15cb3dSCy SchubertLines beginning with # are considered comments and ignored by the
1045*2b15cb3dSCy Schubert.Nm
1046*2b15cb3dSCy Schubertprogram and
1047*2b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc
1048*2b15cb3dSCy Schubertdaemon.
1049*2b15cb3dSCy SchubertCryptographic values are encoded first using ASN.1 rules,
1050*2b15cb3dSCy Schubertthen encrypted if necessary, and finally written PEM-encoded
1051*2b15cb3dSCy Schubertprintable ASCII format preceded and followed by MIME content identifier lines.
1052*2b15cb3dSCy Schubert.Pp
1053*2b15cb3dSCy SchubertThe format of the symmetric keys file is somewhat different
1054*2b15cb3dSCy Schubertthan the other files in the interest of backward compatibility.
1055*2b15cb3dSCy SchubertSince DES-CBC is deprecated in NTPv4, the only key format of interest
1056*2b15cb3dSCy Schubertis MD5 alphanumeric strings.
1057*2b15cb3dSCy SchubertFollowing hte heard the keys are
1058*2b15cb3dSCy Schubertentered one per line in the format
1059*2b15cb3dSCy Schubert.D1 Ar keyno type key
1060*2b15cb3dSCy Schubertwhere
1061*2b15cb3dSCy Schubert.Ar keyno
1062*2b15cb3dSCy Schubertis a positive integer in the range 1-65,535,
1063*2b15cb3dSCy Schubert.Ar type
1064*2b15cb3dSCy Schubertis the string MD5 defining the key format and
1065*2b15cb3dSCy Schubert.Ar key
1066*2b15cb3dSCy Schubertis the key itself,
1067*2b15cb3dSCy Schubertwhich is a printable ASCII string 16 characters or less in length.
1068*2b15cb3dSCy SchubertEach character is chosen from the 93 printable characters
1069*2b15cb3dSCy Schubertin the range 0x21 through 0x7f excluding space and the
1070*2b15cb3dSCy Schubert.Ql #
1071*2b15cb3dSCy Schubertcharacter.
1072*2b15cb3dSCy Schubert.Pp
1073*2b15cb3dSCy SchubertNote that the keys used by the
1074*2b15cb3dSCy Schubert.Xr ntpq 1ntpqmdoc
1075*2b15cb3dSCy Schubertand
1076*2b15cb3dSCy Schubert.Xr ntpdc 1ntpdcmdoc
1077*2b15cb3dSCy Schubertprograms
1078*2b15cb3dSCy Schubertare checked against passwords requested by the programs
1079*2b15cb3dSCy Schubertand entered by hand, so it is generally appropriate to specify these keys
1080*2b15cb3dSCy Schubertin human readable ASCII format.
1081*2b15cb3dSCy Schubert.Pp
1082*2b15cb3dSCy SchubertThe
1083*2b15cb3dSCy Schubert.Nm
1084*2b15cb3dSCy Schubertprogram generates a MD5 symmetric keys file
1085*2b15cb3dSCy Schubert.Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
1086*2b15cb3dSCy SchubertSince the file contains private shared keys,
1087*2b15cb3dSCy Schubertit should be visible only to root and distributed by secure means
1088*2b15cb3dSCy Schubertto other subnet hosts.
1089*2b15cb3dSCy SchubertThe NTP daemon loads the file
1090*2b15cb3dSCy Schubert.Pa ntp.keys ,
1091*2b15cb3dSCy Schubertso
1092*2b15cb3dSCy Schubert.Nm
1093*2b15cb3dSCy Schubertinstalls a soft link from this name to the generated file.
1094*2b15cb3dSCy SchubertSubsequently, similar soft links must be installed by manual
1095*2b15cb3dSCy Schubertor automated means on the other subnet hosts.
1096*2b15cb3dSCy SchubertWhile this file is not used with the Autokey Version 2 protocol,
1097*2b15cb3dSCy Schubertit is needed to authenticate some remote configuration commands
1098*2b15cb3dSCy Schubertused by the
1099*2b15cb3dSCy Schubert.Xr ntpq 1ntpqmdoc
1100*2b15cb3dSCy Schubertand
1101*2b15cb3dSCy Schubert.Xr ntpdc 1ntpdcmdoc
1102*2b15cb3dSCy Schubertutilities.
1103*2b15cb3dSCy Schubert	_END_PROG_MDOC_DESCRIP;
1104*2b15cb3dSCy Schubert};
1105*2b15cb3dSCy Schubert
1106*2b15cb3dSCy Schubertdoc-section	= {
1107*2b15cb3dSCy Schubert  ds-type	= 'USAGE';
1108*2b15cb3dSCy Schubert  ds-format	= 'mdoc';
1109*2b15cb3dSCy Schubert  ds-text	= <<- _END_MDOC_USAGE
1110*2b15cb3dSCy SchubertThe
1111*2b15cb3dSCy Schubert.Fl p Ar password
1112*2b15cb3dSCy Schubertoption specifies the write password and
1113*2b15cb3dSCy Schubert.Fl q Ar password
1114*2b15cb3dSCy Schubertoption the read password for previously encrypted files.
1115*2b15cb3dSCy SchubertThe
1116*2b15cb3dSCy Schubert.Nm
1117*2b15cb3dSCy Schubertprogram prompts for the password if it reads an encrypted file
1118*2b15cb3dSCy Schubertand the password is missing or incorrect.
1119*2b15cb3dSCy SchubertIf an encrypted file is read successfully and
1120*2b15cb3dSCy Schubertno write password is specified, the read password is used
1121*2b15cb3dSCy Schubertas the write password by default.
1122*2b15cb3dSCy Schubert	_END_MDOC_USAGE;
1123*2b15cb3dSCy Schubert};
1124*2b15cb3dSCy Schubert
1125*2b15cb3dSCy Schubertdoc-section	= {
1126*2b15cb3dSCy Schubert  ds-type	= 'NOTES';
1127*2b15cb3dSCy Schubert  ds-format	= 'mdoc';
1128*2b15cb3dSCy Schubert  ds-text	= <<- _END_MDOC_NOTES
1129*2b15cb3dSCy SchubertPortions of this document came from FreeBSD.
1130*2b15cb3dSCy Schubert	_END_MDOC_NOTES;
1131*2b15cb3dSCy Schubert};
1132*2b15cb3dSCy Schubert
1133*2b15cb3dSCy Schubertdoc-section	= {
1134*2b15cb3dSCy Schubert  ds-type	= 'BUGS';
1135*2b15cb3dSCy Schubert  ds-format	= 'mdoc';
1136*2b15cb3dSCy Schubert  ds-text	= <<- _END_MDOC_BUGS
1137*2b15cb3dSCy SchubertIt can take quite a while to generate some cryptographic values,
1138*2b15cb3dSCy Schubertfrom one to several minutes with modern architectures
1139*2b15cb3dSCy Schubertsuch as UltraSPARC and up to tens of minutes to an hour
1140*2b15cb3dSCy Schubertwith older architectures such as SPARC IPC.
1141*2b15cb3dSCy Schubert.Pp
1142*2b15cb3dSCy SchubertPlease report bugs to http://bugs.ntp.org .
1143*2b15cb3dSCy Schubert	_END_MDOC_BUGS;
1144*2b15cb3dSCy Schubert};
1145