Home | History | Annotate | Line # | Download | only in util
ntp-keygen.1ntp-keygenmdoc revision 1.1
      1  1.1  christos .Dd December 24 2013
      2  1.1  christos .Dt NTP_KEYGEN 1ntp-keygenmdoc User Commands
      3  1.1  christos .Os SunOS 5.10
      4  1.1  christos .\"  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.mdoc)
      5  1.1  christos .\"
      6  1.1  christos .\"  It has been AutoGen-ed  December 24, 2013 at 11:39:38 AM by AutoGen 5.18.3pre5
      7  1.1  christos .\"  From the definitions    ntp-keygen-opts.def
      8  1.1  christos .\"  and the template file   agmdoc-cmd.tpl
      9  1.1  christos .Sh NAME
     10  1.1  christos .Nm ntp-keygen
     11  1.1  christos .Nd Create a NTP host key
     12  1.1  christos .Sh SYNOPSIS
     13  1.1  christos .Nm
     14  1.1  christos .\" Mixture of short (flag) options and long options
     15  1.1  christos .Op Fl flags
     16  1.1  christos .Op Fl flag Op Ar value
     17  1.1  christos .Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
     18  1.1  christos .Pp
     19  1.1  christos All arguments must be options.
     20  1.1  christos .Pp
     21  1.1  christos .Sh DESCRIPTION
     22  1.1  christos This program generates cryptographic data files used by the NTPv4
     23  1.1  christos authentication and identification schemes.
     24  1.1  christos It generates MD5 key files used in symmetric key cryptography.
     25  1.1  christos In addition, if the OpenSSL software library has been installed,
     26  1.1  christos it generates keys, certificate and identity files used in public key
     27  1.1  christos cryptography.
     28  1.1  christos These files are used for cookie encryption,
     29  1.1  christos digital signature and challenge/response identification algorithms
     30  1.1  christos compatible with the Internet standard security infrastructure.
     31  1.1  christos .Pp
     32  1.1  christos All files are in PEM\-encoded printable ASCII format,
     33  1.1  christos so they can be embedded as MIME attachments in mail to other sites
     34  1.1  christos and certificate authorities.
     35  1.1  christos By default, files are not encrypted.
     36  1.1  christos .Pp
     37  1.1  christos When used to generate message digest keys, the program produces a file
     38  1.1  christos containing ten pseudo\-random printable ASCII strings suitable for the
     39  1.1  christos MD5 message digest algorithm included in the distribution.
     40  1.1  christos If the OpenSSL library is installed, it produces an additional ten
     41  1.1  christos hex\-encoded random bit strings suitable for the SHA1 and other message
     42  1.1  christos digest algorithms.
     43  1.1  christos The message digest keys file must be distributed and stored
     44  1.1  christos using secure means beyond the scope of NTP itself.
     45  1.1  christos Besides the keys used for ordinary NTP associations, additional keys
     46  1.1  christos can be defined as passwords for the
     47  1.1  christos .Xr ntpq 1ntpqmdoc
     48  1.1  christos and
     49  1.1  christos .Xr ntpdc 1ntpdcmdoc
     50  1.1  christos utility programs.
     51  1.1  christos .Pp
     52  1.1  christos The remaining generated files are compatible with other OpenSSL
     53  1.1  christos applications and other Public Key Infrastructure (PKI) resources.
     54  1.1  christos Certificates generated by this program are compatible with extant
     55  1.1  christos industry practice, although some users might find the interpretation of
     56  1.1  christos X509v3 extension fields somewhat liberal.
     57  1.1  christos However, the identity keys are probably not compatible with anything
     58  1.1  christos other than Autokey.
     59  1.1  christos .Pp
     60  1.1  christos Some files used by this program are encrypted using a private password.
     61  1.1  christos The
     62  1.1  christos .Fl p
     63  1.1  christos option specifies the password for local encrypted files and the
     64  1.1  christos .Fl q
     65  1.1  christos option the password for encrypted files sent to remote sites.
     66  1.1  christos If no password is specified, the host name returned by the Unix
     67  1.1  christos .Fn gethostname
     68  1.1  christos function, normally the DNS name of the host is used.
     69  1.1  christos .Pp
     70  1.1  christos The
     71  1.1  christos .Ar pw
     72  1.1  christos option of the
     73  1.1  christos .Ar crypto
     74  1.1  christos configuration command specifies the read
     75  1.1  christos password for previously encrypted local files.
     76  1.1  christos This must match the local password used by this program.
     77  1.1  christos If not specified, the host name is used.
     78  1.1  christos Thus, if files are generated by this program without password,
     79  1.1  christos they can be read back by
     80  1.1  christos .Ar ntpd
     81  1.1  christos without password but only on the same host.
     82  1.1  christos .Pp
     83  1.1  christos Normally, encrypted files for each host are generated by that host and
     84  1.1  christos used only by that host, although exceptions exist as noted later on
     85  1.1  christos this page.
     86  1.1  christos The symmetric keys file, normally called
     87  1.1  christos .Ar ntp.keys ,
     88  1.1  christos is usually installed in
     89  1.1  christos .Pa /etc .
     90  1.1  christos Other files and links are usually installed in
     91  1.1  christos .Pa /usr/local/etc ,
     92  1.1  christos which is normally in a shared filesystem in
     93  1.1  christos NFS\-mounted networks and cannot be changed by shared clients.
     94  1.1  christos The location of the keys directory can be changed by the
     95  1.1  christos .Ar keysdir
     96  1.1  christos configuration command in such cases.
     97  1.1  christos Normally, this is in
     98  1.1  christos .Pa /etc .
     99  1.1  christos .Pp
    100  1.1  christos This program directs commentary and error messages to the standard
    101  1.1  christos error stream
    102  1.1  christos .Ar stderr
    103  1.1  christos and remote files to the standard output stream
    104  1.1  christos .Ar stdout
    105  1.1  christos where they can be piped to other applications or redirected to files.
    106  1.1  christos The names used for generated files and links all begin with the
    107  1.1  christos string
    108  1.1  christos .Ar ntpkey
    109  1.1  christos and include the file type, generating host and filestamp,
    110  1.1  christos as described in the
    111  1.1  christos .Dq Cryptographic Data Files
    112  1.1  christos section below.
    113  1.1  christos .Ss Running the Program
    114  1.1  christos To test and gain experience with Autokey concepts, log in as root and
    115  1.1  christos change to the keys directory, usually
    116  1.1  christos .Pa /usr/local/etc 
    117  1.1  christos When run for the first time, or if all files with names beginning with
    118  1.1  christos .Ar ntpkey
    119  1.1  christos have been removed, use the
    120  1.1  christos .Nm
    121  1.1  christos command without arguments to generate a
    122  1.1  christos default RSA host key and matching RSA\-MD5 certificate with expiration
    123  1.1  christos date one year hence.
    124  1.1  christos If run again without options, the program uses the
    125  1.1  christos existing keys and parameters and generates only a new certificate with
    126  1.1  christos new expiration date one year hence.
    127  1.1  christos .Pp
    128  1.1  christos Run the command on as many hosts as necessary.
    129  1.1  christos Designate one of them as the trusted host (TH) using
    130  1.1  christos .Nm
    131  1.1  christos with the
    132  1.1  christos .Fl T
    133  1.1  christos option and configure it to synchronize from reliable Internet servers.
    134  1.1  christos Then configure the other hosts to synchronize to the TH directly or
    135  1.1  christos indirectly.
    136  1.1  christos A certificate trail is created when Autokey asks the immediately
    137  1.1  christos ascendant host towards the TH to sign its certificate, which is then
    138  1.1  christos provided to the immediately descendant host on request.
    139  1.1  christos All group hosts should have acyclic certificate trails ending on the TH.
    140  1.1  christos .Pp
    141  1.1  christos The host key is used to encrypt the cookie when required and so must be
    142  1.1  christos RSA type.
    143  1.1  christos By default, the host key is also the sign key used to encrypt
    144  1.1  christos signatures.
    145  1.1  christos A different sign key can be assigned using the
    146  1.1  christos .Fl S
    147  1.1  christos option and this can be either RSA or DSA type.
    148  1.1  christos By default, the signature
    149  1.1  christos message digest type is MD5, but any combination of sign key type and
    150  1.1  christos message digest type supported by the OpenSSL library can be specified
    151  1.1  christos using the
    152  1.1  christos .Fl c
    153  1.1  christos option.
    154  1.1  christos The rules say cryptographic media should be generated with proventic
    155  1.1  christos filestamps, which means the host should already be synchronized before
    156  1.1  christos this program is run.
    157  1.1  christos This of course creates a chicken\-and\-egg problem
    158  1.1  christos when the host is started for the first time.
    159  1.1  christos Accordingly, the host time
    160  1.1  christos should be set by some other means, such as eyeball\-and\-wristwatch, at
    161  1.1  christos least so that the certificate lifetime is within the current year.
    162  1.1  christos After that and when the host is synchronized to a proventic source, the
    163  1.1  christos certificate should be re\-generated.
    164  1.1  christos .Pp
    165  1.1  christos Additional information on trusted groups and identity schemes is on the
    166  1.1  christos .Dq Autokey Public\-Key Authentication
    167  1.1  christos page.
    168  1.1  christos .Pp
    169  1.1  christos The
    170  1.1  christos .Xr ntpd 1ntpdmdoc
    171  1.1  christos configuration command
    172  1.1  christos .Ic crypto pw Ar password
    173  1.1  christos specifies the read password for previously encrypted files.
    174  1.1  christos The daemon expires on the spot if the password is missing
    175  1.1  christos or incorrect.
    176  1.1  christos For convenience, if a file has been previously encrypted,
    177  1.1  christos the default read password is the name of the host running
    178  1.1  christos the program.
    179  1.1  christos If the previous write password is specified as the host name,
    180  1.1  christos these files can be read by that host with no explicit password.
    181  1.1  christos .Pp
    182  1.1  christos File names begin with the prefix
    183  1.1  christos .Cm ntpkey_
    184  1.1  christos and end with the postfix
    185  1.1  christos .Ar _hostname.filestamp ,
    186  1.1  christos where
    187  1.1  christos .Ar hostname
    188  1.1  christos is the owner name, usually the string returned
    189  1.1  christos by the Unix gethostname() routine, and
    190  1.1  christos .Ar filestamp
    191  1.1  christos is the NTP seconds when the file was generated, in decimal digits.
    192  1.1  christos This both guarantees uniqueness and simplifies maintenance
    193  1.1  christos procedures, since all files can be quickly removed
    194  1.1  christos by a
    195  1.1  christos .Ic rm ntpkey\&*
    196  1.1  christos command or all files generated
    197  1.1  christos at a specific time can be removed by a
    198  1.1  christos .Ic rm
    199  1.1  christos .Ar \&*filestamp
    200  1.1  christos command.
    201  1.1  christos To further reduce the risk of misconfiguration,
    202  1.1  christos the first two lines of a file contain the file name
    203  1.1  christos and generation date and time as comments.
    204  1.1  christos .Pp
    205  1.1  christos All files are installed by default in the keys directory
    206  1.1  christos .Pa /usr/local/etc ,
    207  1.1  christos which is normally in a shared filesystem
    208  1.1  christos in NFS\-mounted networks.
    209  1.1  christos The actual location of the keys directory
    210  1.1  christos and each file can be overridden by configuration commands,
    211  1.1  christos but this is not recommended.
    212  1.1  christos Normally, the files for each host are generated by that host
    213  1.1  christos and used only by that host, although exceptions exist
    214  1.1  christos as noted later on this page.
    215  1.1  christos .Pp
    216  1.1  christos Normally, files containing private values,
    217  1.1  christos including the host key, sign key and identification parameters,
    218  1.1  christos are permitted root read/write\-only;
    219  1.1  christos while others containing public values are permitted world readable.
    220  1.1  christos Alternatively, files containing private values can be encrypted
    221  1.1  christos and these files permitted world readable,
    222  1.1  christos which simplifies maintenance in shared file systems.
    223  1.1  christos Since uniqueness is insured by the hostname and
    224  1.1  christos file name extensions, the files for a NFS server and
    225  1.1  christos dependent clients can all be installed in the same shared directory.
    226  1.1  christos .Pp
    227  1.1  christos The recommended practice is to keep the file name extensions
    228  1.1  christos when installing a file and to install a soft link
    229  1.1  christos from the generic names specified elsewhere on this page
    230  1.1  christos to the generated files.
    231  1.1  christos This allows new file generations to be activated simply
    232  1.1  christos by changing the link.
    233  1.1  christos If a link is present, ntpd follows it to the file name
    234  1.1  christos to extract the filestamp.
    235  1.1  christos If a link is not present,
    236  1.1  christos .Xr ntpd 1ntpdmdoc
    237  1.1  christos extracts the filestamp from the file itself.
    238  1.1  christos This allows clients to verify that the file and generation times
    239  1.1  christos are always current.
    240  1.1  christos The
    241  1.1  christos .Nm
    242  1.1  christos program uses the same timestamp extension for all files generated
    243  1.1  christos at one time, so each generation is distinct and can be readily
    244  1.1  christos recognized in monitoring data.
    245  1.1  christos .Ss Running the program
    246  1.1  christos The safest way to run the
    247  1.1  christos .Nm
    248  1.1  christos program is logged in directly as root.
    249  1.1  christos The recommended procedure is change to the keys directory,
    250  1.1  christos usually
    251  1.1  christos .Pa /usr/local/etc ,
    252  1.1  christos then run the program.
    253  1.1  christos When run for the first time,
    254  1.1  christos or if all
    255  1.1  christos .Cm ntpkey
    256  1.1  christos files have been removed,
    257  1.1  christos the program generates a RSA host key file and matching RSA\-MD5 certificate file,
    258  1.1  christos which is all that is necessary in many cases.
    259  1.1  christos The program also generates soft links from the generic names
    260  1.1  christos to the respective files.
    261  1.1  christos If run again, the program uses the same host key file,
    262  1.1  christos but generates a new certificate file and link.
    263  1.1  christos .Pp
    264  1.1  christos The host key is used to encrypt the cookie when required and so must be RSA type.
    265  1.1  christos By default, the host key is also the sign key used to encrypt signatures.
    266  1.1  christos When necessary, a different sign key can be specified and this can be
    267  1.1  christos either RSA or DSA type.
    268  1.1  christos By default, the message digest type is MD5, but any combination
    269  1.1  christos of sign key type and message digest type supported by the OpenSSL library
    270  1.1  christos can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
    271  1.1  christos and RIPE160 message digest algorithms.
    272  1.1  christos However, the scheme specified in the certificate must be compatible
    273  1.1  christos with the sign key.
    274  1.1  christos Certificates using any digest algorithm are compatible with RSA sign keys;
    275  1.1  christos however, only SHA and SHA1 certificates are compatible with DSA sign keys.
    276  1.1  christos .Pp
    277  1.1  christos Private/public key files and certificates are compatible with
    278  1.1  christos other OpenSSL applications and very likely other libraries as well.
    279  1.1  christos Certificates or certificate requests derived from them should be compatible
    280  1.1  christos with extant industry practice, although some users might find
    281  1.1  christos the interpretation of X509v3 extension fields somewhat liberal.
    282  1.1  christos However, the identification parameter files, although encoded
    283  1.1  christos as the other files, are probably not compatible with anything other than Autokey.
    284  1.1  christos .Pp
    285  1.1  christos Running the program as other than root and using the Unix
    286  1.1  christos .Ic su
    287  1.1  christos command
    288  1.1  christos to assume root may not work properly, since by default the OpenSSL library
    289  1.1  christos looks for the random seed file
    290  1.1  christos .Cm .rnd
    291  1.1  christos in the user home directory.
    292  1.1  christos However, there should be only one
    293  1.1  christos .Cm .rnd ,
    294  1.1  christos most conveniently
    295  1.1  christos in the root directory, so it is convenient to define the
    296  1.1  christos .Cm $RANDFILE
    297  1.1  christos environment variable used by the OpenSSL library as the path to
    298  1.1  christos .Cm /.rnd .
    299  1.1  christos .Pp
    300  1.1  christos Installing the keys as root might not work in NFS\-mounted
    301  1.1  christos shared file systems, as NFS clients may not be able to write
    302  1.1  christos to the shared keys directory, even as root.
    303  1.1  christos In this case, NFS clients can specify the files in another
    304  1.1  christos directory such as
    305  1.1  christos .Pa /etc
    306  1.1  christos using the
    307  1.1  christos .Ic keysdir
    308  1.1  christos command.
    309  1.1  christos There is no need for one client to read the keys and certificates
    310  1.1  christos of other clients or servers, as these data are obtained automatically
    311  1.1  christos by the Autokey protocol.
    312  1.1  christos .Pp
    313  1.1  christos Ordinarily, cryptographic files are generated by the host that uses them,
    314  1.1  christos but it is possible for a trusted agent (TA) to generate these files
    315  1.1  christos for other hosts; however, in such cases files should always be encrypted.
    316  1.1  christos The subject name and trusted name default to the hostname
    317  1.1  christos of the host generating the files, but can be changed by command line options.
    318  1.1  christos It is convenient to designate the owner name and trusted name
    319  1.1  christos as the subject and issuer fields, respectively, of the certificate.
    320  1.1  christos The owner name is also used for the host and sign key files,
    321  1.1  christos while the trusted name is used for the identity files.
    322  1.1  christos .Pp
    323  1.1  christos All files are installed by default in the keys directory
    324  1.1  christos .Pa /usr/local/etc ,
    325  1.1  christos which is normally in a shared filesystem
    326  1.1  christos in NFS\-mounted networks.
    327  1.1  christos The actual location of the keys directory
    328  1.1  christos and each file can be overridden by configuration commands,
    329  1.1  christos but this is not recommended.
    330  1.1  christos Normally, the files for each host are generated by that host
    331  1.1  christos and used only by that host, although exceptions exist
    332  1.1  christos as noted later on this page.
    333  1.1  christos .Pp
    334  1.1  christos Normally, files containing private values,
    335  1.1  christos including the host key, sign key and identification parameters,
    336  1.1  christos are permitted root read/write\-only;
    337  1.1  christos while others containing public values are permitted world readable.
    338  1.1  christos Alternatively, files containing private values can be encrypted
    339  1.1  christos and these files permitted world readable,
    340  1.1  christos which simplifies maintenance in shared file systems.
    341  1.1  christos Since uniqueness is insured by the hostname and
    342  1.1  christos file name extensions, the files for a NFS server and
    343  1.1  christos dependent clients can all be installed in the same shared directory.
    344  1.1  christos .Pp
    345  1.1  christos The recommended practice is to keep the file name extensions
    346  1.1  christos when installing a file and to install a soft link
    347  1.1  christos from the generic names specified elsewhere on this page
    348  1.1  christos to the generated files.
    349  1.1  christos This allows new file generations to be activated simply
    350  1.1  christos by changing the link.
    351  1.1  christos If a link is present, ntpd follows it to the file name
    352  1.1  christos to extract the filestamp.
    353  1.1  christos If a link is not present,
    354  1.1  christos .Xr ntpd 1ntpdmdoc
    355  1.1  christos extracts the filestamp from the file itself.
    356  1.1  christos This allows clients to verify that the file and generation times
    357  1.1  christos are always current.
    358  1.1  christos The
    359  1.1  christos .Nm
    360  1.1  christos program uses the same timestamp extension for all files generated
    361  1.1  christos at one time, so each generation is distinct and can be readily
    362  1.1  christos recognized in monitoring data.
    363  1.1  christos .Ss Running the program
    364  1.1  christos The safest way to run the
    365  1.1  christos .Nm
    366  1.1  christos program is logged in directly as root.
    367  1.1  christos The recommended procedure is change to the keys directory,
    368  1.1  christos usually
    369  1.1  christos .Pa /usr/local/etc ,
    370  1.1  christos then run the program.
    371  1.1  christos When run for the first time,
    372  1.1  christos or if all
    373  1.1  christos .Cm ntpkey
    374  1.1  christos files have been removed,
    375  1.1  christos the program generates a RSA host key file and matching RSA\-MD5 certificate file,
    376  1.1  christos which is all that is necessary in many cases.
    377  1.1  christos The program also generates soft links from the generic names
    378  1.1  christos to the respective files.
    379  1.1  christos If run again, the program uses the same host key file,
    380  1.1  christos but generates a new certificate file and link.
    381  1.1  christos .Pp
    382  1.1  christos The host key is used to encrypt the cookie when required and so must be RSA type.
    383  1.1  christos By default, the host key is also the sign key used to encrypt signatures.
    384  1.1  christos When necessary, a different sign key can be specified and this can be
    385  1.1  christos either RSA or DSA type.
    386  1.1  christos By default, the message digest type is MD5, but any combination
    387  1.1  christos of sign key type and message digest type supported by the OpenSSL library
    388  1.1  christos can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2
    389  1.1  christos and RIPE160 message digest algorithms.
    390  1.1  christos However, the scheme specified in the certificate must be compatible
    391  1.1  christos with the sign key.
    392  1.1  christos Certificates using any digest algorithm are compatible with RSA sign keys;
    393  1.1  christos however, only SHA and SHA1 certificates are compatible with DSA sign keys.
    394  1.1  christos .Pp
    395  1.1  christos Private/public key files and certificates are compatible with
    396  1.1  christos other OpenSSL applications and very likely other libraries as well.
    397  1.1  christos Certificates or certificate requests derived from them should be compatible
    398  1.1  christos with extant industry practice, although some users might find
    399  1.1  christos the interpretation of X509v3 extension fields somewhat liberal.
    400  1.1  christos However, the identification parameter files, although encoded
    401  1.1  christos as the other files, are probably not compatible with anything other than Autokey.
    402  1.1  christos .Pp
    403  1.1  christos Running the program as other than root and using the Unix
    404  1.1  christos .Ic su
    405  1.1  christos command
    406  1.1  christos to assume root may not work properly, since by default the OpenSSL library
    407  1.1  christos looks for the random seed file
    408  1.1  christos .Cm .rnd
    409  1.1  christos in the user home directory.
    410  1.1  christos However, there should be only one
    411  1.1  christos .Cm .rnd ,
    412  1.1  christos most conveniently
    413  1.1  christos in the root directory, so it is convenient to define the
    414  1.1  christos .Cm $RANDFILE
    415  1.1  christos environment variable used by the OpenSSL library as the path to
    416  1.1  christos .Cm /.rnd .
    417  1.1  christos .Pp
    418  1.1  christos Installing the keys as root might not work in NFS\-mounted
    419  1.1  christos shared file systems, as NFS clients may not be able to write
    420  1.1  christos to the shared keys directory, even as root.
    421  1.1  christos In this case, NFS clients can specify the files in another
    422  1.1  christos directory such as
    423  1.1  christos .Pa /etc
    424  1.1  christos using the
    425  1.1  christos .Ic keysdir
    426  1.1  christos command.
    427  1.1  christos There is no need for one client to read the keys and certificates
    428  1.1  christos of other clients or servers, as these data are obtained automatically
    429  1.1  christos by the Autokey protocol.
    430  1.1  christos .Pp
    431  1.1  christos Ordinarily, cryptographic files are generated by the host that uses them,
    432  1.1  christos but it is possible for a trusted agent (TA) to generate these files
    433  1.1  christos for other hosts; however, in such cases files should always be encrypted.
    434  1.1  christos The subject name and trusted name default to the hostname
    435  1.1  christos of the host generating the files, but can be changed by command line options.
    436  1.1  christos It is convenient to designate the owner name and trusted name
    437  1.1  christos as the subject and issuer fields, respectively, of the certificate.
    438  1.1  christos The owner name is also used for the host and sign key files,
    439  1.1  christos while the trusted name is used for the identity files.
    440  1.1  christos seconds.
    441  1.1  christos seconds.
    442  1.1  christos s Trusted Hosts and Groups
    443  1.1  christos Each cryptographic configuration involves selection of a signature scheme
    444  1.1  christos and identification scheme, called a cryptotype,
    445  1.1  christos as explained in the
    446  1.1  christos .Sx Authentication Options
    447  1.1  christos section of
    448  1.1  christos .Xr ntp.conf 5 .
    449  1.1  christos The default cryptotype uses RSA encryption, MD5 message digest
    450  1.1  christos and TC identification.
    451  1.1  christos First, configure a NTP subnet including one or more low\-stratum
    452  1.1  christos trusted hosts from which all other hosts derive synchronization
    453  1.1  christos directly or indirectly.
    454  1.1  christos Trusted hosts have trusted certificates;
    455  1.1  christos all other hosts have nontrusted certificates.
    456  1.1  christos These hosts will automatically and dynamically build authoritative
    457  1.1  christos certificate trails to one or more trusted hosts.
    458  1.1  christos A trusted group is the set of all hosts that have, directly or indirectly,
    459  1.1  christos a certificate trail ending at a trusted host.
    460  1.1  christos The trail is defined by static configuration file entries
    461  1.1  christos or dynamic means described on the
    462  1.1  christos .Sx Automatic NTP Configuration Options
    463  1.1  christos section of
    464  1.1  christos .Xr ntp.conf 5 .
    465  1.1  christos .Pp
    466  1.1  christos On each trusted host as root, change to the keys directory.
    467  1.1  christos To insure a fresh fileset, remove all
    468  1.1  christos .Cm ntpkey
    469  1.1  christos files.
    470  1.1  christos Then run
    471  1.1  christos .Nm
    472  1.1  christos .Fl T
    473  1.1  christos to generate keys and a trusted certificate.
    474  1.1  christos On all other hosts do the same, but leave off the
    475  1.1  christos .Fl T
    476  1.1  christos flag to generate keys and nontrusted certificates.
    477  1.1  christos When complete, start the NTP daemons beginning at the lowest stratum
    478  1.1  christos and working up the tree.
    479  1.1  christos It may take some time for Autokey to instantiate the certificate trails
    480  1.1  christos throughout the subnet, but setting up the environment is completely automatic.
    481  1.1  christos .Pp
    482  1.1  christos If it is necessary to use a different sign key or different digest/signature
    483  1.1  christos scheme than the default, run
    484  1.1  christos .Nm
    485  1.1  christos with the
    486  1.1  christos .Fl S Ar type
    487  1.1  christos option, where
    488  1.1  christos .Ar type
    489  1.1  christos is either
    490  1.1  christos .Cm RSA
    491  1.1  christos or
    492  1.1  christos .Cm DSA .
    493  1.1  christos The most often need to do this is when a DSA\-signed certificate is used.
    494  1.1  christos If it is necessary to use a different certificate scheme than the default,
    495  1.1  christos run
    496  1.1  christos .Nm
    497  1.1  christos with the
    498  1.1  christos .Fl c Ar scheme
    499  1.1  christos option and selected
    500  1.1  christos .Ar scheme
    501  1.1  christos as needed.
    502  1.1  christos f
    503  1.1  christos .Nm
    504  1.1  christos is run again without these options, it generates a new certificate
    505  1.1  christos using the same scheme and sign key.
    506  1.1  christos .Pp
    507  1.1  christos After setting up the environment it is advisable to update certificates
    508  1.1  christos from time to time, if only to extend the validity interval.
    509  1.1  christos Simply run
    510  1.1  christos .Nm
    511  1.1  christos with the same flags as before to generate new certificates
    512  1.1  christos using existing keys.
    513  1.1  christos However, if the host or sign key is changed,
    514  1.1  christos .Xr ntpd 1ntpdmdoc
    515  1.1  christos should be restarted.
    516  1.1  christos When
    517  1.1  christos .Xr ntpd 1ntpdmdoc
    518  1.1  christos is restarted, it loads any new files and restarts the protocol.
    519  1.1  christos Other dependent hosts will continue as usual until signatures are refreshed,
    520  1.1  christos at which time the protocol is restarted.
    521  1.1  christos .Ss Identity Schemes
    522  1.1  christos As mentioned on the Autonomous Authentication page,
    523  1.1  christos the default TC identity scheme is vulnerable to a middleman attack.
    524  1.1  christos However, there are more secure identity schemes available,
    525  1.1  christos including PC, IFF, GQ and MV described on the
    526  1.1  christos .Qq Identification Schemes
    527  1.1  christos page
    528  1.1  christos (maybe available at
    529  1.1  christos .Li http://www.eecis.udel.edu/%7emills/keygen.html ) .
    530  1.1  christos These schemes are based on a TA, one or more trusted hosts
    531  1.1  christos and some number of nontrusted hosts.
    532  1.1  christos Trusted hosts prove identity using values provided by the TA,
    533  1.1  christos while the remaining hosts prove identity using values provided
    534  1.1  christos by a trusted host and certificate trails that end on that host.
    535  1.1  christos The name of a trusted host is also the name of its sugroup
    536  1.1  christos and also the subject and issuer name on its trusted certificate.
    537  1.1  christos The TA is not necessarily a trusted host in this sense, but often is.
    538  1.1  christos .Pp
    539  1.1  christos In some schemes there are separate keys for servers and clients.
    540  1.1  christos A server can also be a client of another server,
    541  1.1  christos but a client can never be a server for another client.
    542  1.1  christos In general, trusted hosts and nontrusted hosts that operate
    543  1.1  christos as both server and client have parameter files that contain
    544  1.1  christos both server and client keys.
    545  1.1  christos Hosts that operate
    546  1.1  christos only as clients have key files that contain only client keys.
    547  1.1  christos .Pp
    548  1.1  christos The PC scheme supports only one trusted host in the group.
    549  1.1  christos On trusted host alice run
    550  1.1  christos .Nm
    551  1.1  christos .Fl P
    552  1.1  christos .Fl p Ar password
    553  1.1  christos to generate the host key file
    554  1.1  christos .Pa ntpkey_RSAkey_ Ns Ar alice.filestamp
    555  1.1  christos and trusted private certificate file
    556  1.1  christos .Pa ntpkey_RSA\-MD5_cert_ Ns Ar alice.filestamp .
    557  1.1  christos Copy both files to all group hosts;
    558  1.1  christos they replace the files which would be generated in other schemes.
    559  1.1  christos On each host bob install a soft link from the generic name
    560  1.1  christos .Pa ntpkey_host_ Ns Ar bob
    561  1.1  christos to the host key file and soft link
    562  1.1  christos .Pa ntpkey_cert_ Ns Ar bob
    563  1.1  christos to the private certificate file.
    564  1.1  christos Note the generic links are on bob, but point to files generated
    565  1.1  christos by trusted host alice.
    566  1.1  christos In this scheme it is not possible to refresh
    567  1.1  christos either the keys or certificates without copying them
    568  1.1  christos to all other hosts in the group.
    569  1.1  christos .Pp
    570  1.1  christos For the IFF scheme proceed as in the TC scheme to generate keys
    571  1.1  christos and certificates for all group hosts, then for every trusted host in the group,
    572  1.1  christos generate the IFF parameter file.
    573  1.1  christos On trusted host alice run
    574  1.1  christos .Nm
    575  1.1  christos .Fl T
    576  1.1  christos .Fl I
    577  1.1  christos .Fl p Ar password
    578  1.1  christos to produce her parameter file
    579  1.1  christos .Pa ntpkey_IFFpar_ Ns Ar alice.filestamp ,
    580  1.1  christos which includes both server and client keys.
    581  1.1  christos Copy this file to all group hosts that operate as both servers
    582  1.1  christos and clients and install a soft link from the generic
    583  1.1  christos .Pa ntpkey_iff_ Ns Ar alice
    584  1.1  christos to this file.
    585  1.1  christos If there are no hosts restricted to operate only as clients,
    586  1.1  christos there is nothing further to do.
    587  1.1  christos As the IFF scheme is independent
    588  1.1  christos of keys and certificates, these files can be refreshed as needed.
    589  1.1  christos .Pp
    590  1.1  christos If a rogue client has the parameter file, it could masquerade
    591  1.1  christos as a legitimate server and present a middleman threat.
    592  1.1  christos To eliminate this threat, the client keys can be extracted
    593  1.1  christos from the parameter file and distributed to all restricted clients.
    594  1.1  christos After generating the parameter file, on alice run
    595  1.1  christos .Nm
    596  1.1  christos .Fl e
    597  1.1  christos and pipe the output to a file or mail program.
    598  1.1  christos Copy or mail this file to all restricted clients.
    599  1.1  christos On these clients install a soft link from the generic
    600  1.1  christos .Pa ntpkey_iff_ Ns Ar alice
    601  1.1  christos to this file.
    602  1.1  christos To further protect the integrity of the keys,
    603  1.1  christos each file can be encrypted with a secret password.
    604  1.1  christos .Pp
    605  1.1  christos For the GQ scheme proceed as in the TC scheme to generate keys
    606  1.1  christos and certificates for all group hosts, then for every trusted host
    607  1.1  christos in the group, generate the IFF parameter file.
    608  1.1  christos On trusted host alice run
    609  1.1  christos .Nm
    610  1.1  christos .Fl T
    611  1.1  christos .Fl G
    612  1.1  christos .Fl p Ar password
    613  1.1  christos to produce her parameter file
    614  1.1  christos .Pa ntpkey_GQpar_ Ns Ar alice.filestamp ,
    615  1.1  christos which includes both server and client keys.
    616  1.1  christos Copy this file to all group hosts and install a soft link
    617  1.1  christos from the generic
    618  1.1  christos .Pa ntpkey_gq_ Ns Ar alice
    619  1.1  christos to this file.
    620  1.1  christos In addition, on each host bob install a soft link
    621  1.1  christos from generic
    622  1.1  christos .Pa ntpkey_gq_ Ns Ar bob
    623  1.1  christos to this file.
    624  1.1  christos As the GQ scheme updates the GQ parameters file and certificate
    625  1.1  christos at the same time, keys and certificates can be regenerated as needed.
    626  1.1  christos .Pp
    627  1.1  christos For the MV scheme, proceed as in the TC scheme to generate keys
    628  1.1  christos and certificates for all group hosts.
    629  1.1  christos For illustration assume trish is the TA, alice one of several trusted hosts
    630  1.1  christos and bob one of her clients.
    631  1.1  christos On TA trish run
    632  1.1  christos .Nm
    633  1.1  christos .Fl V Ar n
    634  1.1  christos .Fl p Ar password ,
    635  1.1  christos where
    636  1.1  christos .Ar n
    637  1.1  christos is the number of revokable keys (typically 5) to produce
    638  1.1  christos the parameter file
    639  1.1  christos .Pa ntpkeys_MVpar_ Ns Ar trish.filestamp
    640  1.1  christos and client key files
    641  1.1  christos .Pa ntpkeys_MVkeyd_ Ns Ar trish.filestamp
    642  1.1  christos where
    643  1.1  christos .Ar d
    644  1.1  christos is the key number (0 \&<
    645  1.1  christos .Ar d
    646  1.1  christos \&<
    647  1.1  christos .Ar n ) .
    648  1.1  christos Copy the parameter file to alice and install a soft link
    649  1.1  christos from the generic
    650  1.1  christos .Pa ntpkey_mv_ Ns Ar alice
    651  1.1  christos to this file.
    652  1.1  christos Copy one of the client key files to alice for later distribution
    653  1.1  christos to her clients.
    654  1.1  christos It doesn't matter which client key file goes to alice,
    655  1.1  christos since they all work the same way.
    656  1.1  christos Alice copies the client key file to all of her cliens.
    657  1.1  christos On client bob install a soft link from generic
    658  1.1  christos .Pa ntpkey_mvkey_ Ns Ar bob
    659  1.1  christos to the client key file.
    660  1.1  christos As the MV scheme is independent of keys and certificates,
    661  1.1  christos these files can be refreshed as needed.
    662  1.1  christos .Ss Command Line Options
    663  1.1  christos .Bl -tag -width indent
    664  1.1  christos .It Fl c Ar scheme
    665  1.1  christos Select certificate message digest/signature encryption scheme.
    666  1.1  christos The
    667  1.1  christos .Ar scheme
    668  1.1  christos can be one of the following:
    669  1.1  christos . Cm RSA\-MD2 , RSA\-MD5 , RSA\-SHA , RSA\-SHA1 , RSA\-MDC2 , RSA\-RIPEMD160 , DSA\-SHA ,
    670  1.1  christos or
    671  1.1  christos .Cm DSA\-SHA1 .
    672  1.1  christos Note that RSA schemes must be used with a RSA sign key and DSA
    673  1.1  christos schemes must be used with a DSA sign key.
    674  1.1  christos The default without this option is
    675  1.1  christos .Cm RSA\-MD5 .
    676  1.1  christos .It Fl d
    677  1.1  christos Enable debugging.
    678  1.1  christos This option displays the cryptographic data produced in eye\-friendly billboards.
    679  1.1  christos .It Fl e
    680  1.1  christos Write the IFF client keys to the standard output.
    681  1.1  christos This is intended for automatic key distribution by mail.
    682  1.1  christos .It Fl G
    683  1.1  christos Generate parameters and keys for the GQ identification scheme,
    684  1.1  christos obsoleting any that may exist.
    685  1.1  christos .It Fl g
    686  1.1  christos Generate keys for the GQ identification scheme
    687  1.1  christos using the existing GQ parameters.
    688  1.1  christos If the GQ parameters do not yet exist, create them first.
    689  1.1  christos .It Fl H
    690  1.1  christos Generate new host keys, obsoleting any that may exist.
    691  1.1  christos .It Fl I
    692  1.1  christos Generate parameters for the IFF identification scheme,
    693  1.1  christos obsoleting any that may exist.
    694  1.1  christos .It Fl i Ar name
    695  1.1  christos Set the suject name to
    696  1.1  christos .Ar name .
    697  1.1  christos This is used as the subject field in certificates
    698  1.1  christos and in the file name for host and sign keys.
    699  1.1  christos .It Fl M
    700  1.1  christos Generate MD5 keys, obsoleting any that may exist.
    701  1.1  christos .It Fl P
    702  1.1  christos Generate a private certificate.
    703  1.1  christos By default, the program generates public certificates.
    704  1.1  christos .It Fl p Ar password
    705  1.1  christos Encrypt generated files containing private data with
    706  1.1  christos .Ar password
    707  1.1  christos and the DES\-CBC algorithm.
    708  1.1  christos .It Fl q
    709  1.1  christos Set the password for reading files to password.
    710  1.1  christos .It Fl S Oo Cm RSA | DSA Oc
    711  1.1  christos Generate a new sign key of the designated type,
    712  1.1  christos obsoleting any that may exist.
    713  1.1  christos By default, the program uses the host key as the sign key.
    714  1.1  christos .It Fl s Ar name
    715  1.1  christos Set the issuer name to
    716  1.1  christos .Ar name .
    717  1.1  christos This is used for the issuer field in certificates
    718  1.1  christos and in the file name for identity files.
    719  1.1  christos .It Fl T
    720  1.1  christos Generate a trusted certificate.
    721  1.1  christos By default, the program generates a non\-trusted certificate.
    722  1.1  christos .It Fl V Ar nkeys
    723  1.1  christos Generate parameters and keys for the Mu\-Varadharajan (MV) identification scheme.
    724  1.1  christos .El
    725  1.1  christos .Ss Random Seed File
    726  1.1  christos All cryptographically sound key generation schemes must have means
    727  1.1  christos to randomize the entropy seed used to initialize
    728  1.1  christos the internal pseudo\-random number generator used
    729  1.1  christos by the library routines.
    730  1.1  christos The OpenSSL library uses a designated random seed file for this purpose.
    731  1.1  christos The file must be available when starting the NTP daemon and
    732  1.1  christos .Nm
    733  1.1  christos program.
    734  1.1  christos If a site supports OpenSSL or its companion OpenSSH,
    735  1.1  christos it is very likely that means to do this are already available.
    736  1.1  christos .Pp
    737  1.1  christos It is important to understand that entropy must be evolved
    738  1.1  christos for each generation, for otherwise the random number sequence
    739  1.1  christos would be predictable.
    740  1.1  christos Various means dependent on external events, such as keystroke intervals,
    741  1.1  christos can be used to do this and some systems have built\-in entropy sources.
    742  1.1  christos Suitable means are described in the OpenSSL software documentation,
    743  1.1  christos but are outside the scope of this page.
    744  1.1  christos .Pp
    745  1.1  christos The entropy seed used by the OpenSSL library is contained in a file,
    746  1.1  christos usually called
    747  1.1  christos .Cm .rnd ,
    748  1.1  christos which must be available when starting the NTP daemon
    749  1.1  christos or the
    750  1.1  christos .Nm
    751  1.1  christos program.
    752  1.1  christos The NTP daemon will first look for the file
    753  1.1  christos using the path specified by the
    754  1.1  christos .Ic randfile
    755  1.1  christos subcommand of the
    756  1.1  christos .Ic crypto
    757  1.1  christos configuration command.
    758  1.1  christos If not specified in this way, or when starting the
    759  1.1  christos .Nm
    760  1.1  christos program,
    761  1.1  christos the OpenSSL library will look for the file using the path specified
    762  1.1  christos by the
    763  1.1  christos .Ev RANDFILE
    764  1.1  christos environment variable in the user home directory,
    765  1.1  christos whether root or some other user.
    766  1.1  christos If the
    767  1.1  christos .Ev RANDFILE
    768  1.1  christos environment variable is not present,
    769  1.1  christos the library will look for the
    770  1.1  christos .Cm .rnd
    771  1.1  christos file in the user home directory.
    772  1.1  christos If the file is not available or cannot be written,
    773  1.1  christos the daemon exits with a message to the system log and the program
    774  1.1  christos exits with a suitable error message.
    775  1.1  christos .Ss Cryptographic Data Files
    776  1.1  christos All other file formats begin with two lines.
    777  1.1  christos The first contains the file name, including the generated host name
    778  1.1  christos and filestamp.
    779  1.1  christos The second contains the datestamp in conventional Unix date format.
    780  1.1  christos Lines beginning with # are considered comments and ignored by the
    781  1.1  christos .Nm
    782  1.1  christos program and
    783  1.1  christos .Xr ntpd 1ntpdmdoc
    784  1.1  christos daemon.
    785  1.1  christos Cryptographic values are encoded first using ASN.1 rules,
    786  1.1  christos then encrypted if necessary, and finally written PEM\-encoded
    787  1.1  christos printable ASCII format preceded and followed by MIME content identifier lines.
    788  1.1  christos .Pp
    789  1.1  christos The format of the symmetric keys file is somewhat different
    790  1.1  christos than the other files in the interest of backward compatibility.
    791  1.1  christos Since DES\-CBC is deprecated in NTPv4, the only key format of interest
    792  1.1  christos is MD5 alphanumeric strings.
    793  1.1  christos Following hte heard the keys are
    794  1.1  christos entered one per line in the format
    795  1.1  christos .D1 Ar keyno type key
    796  1.1  christos where
    797  1.1  christos .Ar keyno
    798  1.1  christos is a positive integer in the range 1\-65,535,
    799  1.1  christos .Ar type
    800  1.1  christos is the string MD5 defining the key format and
    801  1.1  christos .Ar key
    802  1.1  christos is the key itself,
    803  1.1  christos which is a printable ASCII string 16 characters or less in length.
    804  1.1  christos Each character is chosen from the 93 printable characters
    805  1.1  christos in the range 0x21 through 0x7f excluding space and the
    806  1.1  christos .Ql #
    807  1.1  christos character.
    808  1.1  christos .Pp
    809  1.1  christos Note that the keys used by the
    810  1.1  christos .Xr ntpq 1ntpqmdoc
    811  1.1  christos and
    812  1.1  christos .Xr ntpdc 1ntpdcmdoc
    813  1.1  christos programs
    814  1.1  christos are checked against passwords requested by the programs
    815  1.1  christos and entered by hand, so it is generally appropriate to specify these keys
    816  1.1  christos in human readable ASCII format.
    817  1.1  christos .Pp
    818  1.1  christos The
    819  1.1  christos .Nm
    820  1.1  christos program generates a MD5 symmetric keys file
    821  1.1  christos .Pa ntpkey_MD5key_ Ns Ar hostname.filestamp .
    822  1.1  christos Since the file contains private shared keys,
    823  1.1  christos it should be visible only to root and distributed by secure means
    824  1.1  christos to other subnet hosts.
    825  1.1  christos The NTP daemon loads the file
    826  1.1  christos .Pa ntp.keys ,
    827  1.1  christos so
    828  1.1  christos .Nm
    829  1.1  christos installs a soft link from this name to the generated file.
    830  1.1  christos Subsequently, similar soft links must be installed by manual
    831  1.1  christos or automated means on the other subnet hosts.
    832  1.1  christos While this file is not used with the Autokey Version 2 protocol,
    833  1.1  christos it is needed to authenticate some remote configuration commands
    834  1.1  christos used by the
    835  1.1  christos .Xr ntpq 1ntpqmdoc
    836  1.1  christos and
    837  1.1  christos .Xr ntpdc 1ntpdcmdoc
    838  1.1  christos utilities.
    839  1.1  christos .Sh "OPTIONS"
    840  1.1  christos .Bl -tag
    841  1.1  christos .It  Fl b Ar imbits , Fl \-imbits Ns = Ns Ar imbits 
    842  1.1  christos identity modulus bits.
    843  1.1  christos This option takes an integer number as its argument.
    844  1.1  christos The value of
    845  1.1  christos .Ar imbits
    846  1.1  christos is constrained to being:
    847  1.1  christos .in +4
    848  1.1  christos .nf
    849  1.1  christos .na
    850  1.1  christos in the range  256 through 2048
    851  1.1  christos .fi
    852  1.1  christos .in -4
    853  1.1  christos .sp
    854  1.1  christos The number of bits in the identity modulus.  The default is 256.
    855  1.1  christos .It  Fl c Ar scheme , Fl \-certificate Ns = Ns Ar scheme 
    856  1.1  christos certificate scheme.
    857  1.1  christos .sp
    858  1.1  christos scheme is one of
    859  1.1  christos RSA\-MD2, RSA\-MD5, RSA\-SHA, RSA\-SHA1, RSA\-MDC2, RSA\-RIPEMD160,
    860  1.1  christos DSA\-SHA, or DSA\-SHA1.
    861  1.1  christos .sp
    862  1.1  christos Select the certificate message digest/signature encryption scheme.
    863  1.1  christos Note that RSA schemes must be used with a RSA sign key and DSA
    864  1.1  christos schemes must be used with a DSA sign key.  The default without
    865  1.1  christos this option is RSA\-MD5.
    866  1.1  christos .It  Fl C Ar cipher , Fl \-cipher Ns = Ns Ar cipher 
    867  1.1  christos privatekey cipher.
    868  1.1  christos .sp
    869  1.1  christos Select the cipher which is used to encrypt the files containing
    870  1.1  christos private keys.  The default is three\-key triple DES in CBC mode,
    871  1.1  christos equivalent to "@code{\-C des\-ede3\-cbc".  The openssl tool lists ciphers
    872  1.1  christos available in "\fBopenssl \-h\fP" output.
    873  1.1  christos .It  Fl d , Fl \-debug\-level 
    874  1.1  christos Increase debug verbosity level.
    875  1.1  christos This option may appear an unlimited number of times.
    876  1.1  christos .sp
    877  1.1  christos .It  Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 
    878  1.1  christos Set the debug verbosity level.
    879  1.1  christos This option may appear an unlimited number of times.
    880  1.1  christos This option takes an integer number as its argument.
    881  1.1  christos .sp
    882  1.1  christos .It  Fl e , Fl \-id\-key 
    883  1.1  christos Write IFF or GQ identity keys.
    884  1.1  christos .sp
    885  1.1  christos Write the IFF or GQ client keys to the standard output.  This is
    886  1.1  christos intended for automatic key distribution by mail.
    887  1.1  christos .It  Fl G , Fl \-gq\-params 
    888  1.1  christos Generate GQ parameters and keys.
    889  1.1  christos .sp
    890  1.1  christos Generate parameters and keys for the GQ identification scheme,
    891  1.1  christos obsoleting any that may exist.
    892  1.1  christos .It  Fl H , Fl \-host\-key 
    893  1.1  christos generate RSA host key.
    894  1.1  christos .sp
    895  1.1  christos Generate new host keys, obsoleting any that may exist.
    896  1.1  christos .It  Fl I , Fl \-iffkey 
    897  1.1  christos generate IFF parameters.
    898  1.1  christos .sp
    899  1.1  christos Generate parameters for the IFF identification scheme, obsoleting
    900  1.1  christos any that may exist.
    901  1.1  christos .It  Fl i Ar group , Fl \-ident Ns = Ns Ar group 
    902  1.1  christos set Autokey group name.
    903  1.1  christos .sp
    904  1.1  christos Set the optional Autokey group name to name.  This is used in
    905  1.1  christos the file name of IFF, GQ, and MV client parameters files.  In
    906  1.1  christos that role, the default is the host name if this option is not
    907  1.1  christos provided.  The group name, if specified using \fB\-i/\-\-ident\fP or
    908  1.1  christos using \fB\-s/\-\-subject\-name\fP following an '\fB@\fP' character,
    909  1.1  christos is also a part of the self\-signed host certificate's subject and
    910  1.1  christos issuer names in the form \fBhost@group\fP and should match the
    911  1.1  christos \'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in
    912  1.1  christos \fBntpd\fP's configuration file. 
    913  1.1  christos .It  Fl l Ar lifetime , Fl \-lifetime Ns = Ns Ar lifetime 
    914  1.1  christos set certificate lifetime.
    915  1.1  christos This option takes an integer number as its argument.
    916  1.1  christos .sp
    917  1.1  christos Set the certificate expiration to lifetime days from now.
    918  1.1  christos .It  Fl M , Fl \-md5key 
    919  1.1  christos generate MD5 keys.
    920  1.1  christos .sp
    921  1.1  christos Generate MD5 keys, obsoleting any that may exist.
    922  1.1  christos .It  Fl m Ar modulus , Fl \-modulus Ns = Ns Ar modulus 
    923  1.1  christos modulus.
    924  1.1  christos This option takes an integer number as its argument.
    925  1.1  christos The value of
    926  1.1  christos .Ar modulus
    927  1.1  christos is constrained to being:
    928  1.1  christos .in +4
    929  1.1  christos .nf
    930  1.1  christos .na
    931  1.1  christos in the range  256 through 2048
    932  1.1  christos .fi
    933  1.1  christos .in -4
    934  1.1  christos .sp
    935  1.1  christos The number of bits in the prime modulus.  The default is 512.
    936  1.1  christos .It  Fl P , Fl \-pvt\-cert 
    937  1.1  christos generate PC private certificate.
    938  1.1  christos .sp
    939  1.1  christos Generate a private certificate.  By default, the program generates
    940  1.1  christos public certificates.
    941  1.1  christos .It  Fl p Ar passwd , Fl \-pvt\-passwd Ns = Ns Ar passwd 
    942  1.1  christos output private password.
    943  1.1  christos .sp
    944  1.1  christos Encrypt generated files containing private data with the specified
    945  1.1  christos password and the cipher selected with \fB\-C/\-\-cipher\fP.
    946  1.1  christos .It  Fl q Ar passwd , Fl \-get\-pvt\-passwd Ns = Ns Ar passwd 
    947  1.1  christos input private password.
    948  1.1  christos .sp
    949  1.1  christos Set the password for reading files to the specified password.
    950  1.1  christos .It  Fl S Ar sign , Fl \-sign\-key Ns = Ns Ar sign 
    951  1.1  christos generate sign key (RSA or DSA).
    952  1.1  christos .sp
    953  1.1  christos Generate a new sign key of the designated type, obsoleting any
    954  1.1  christos that may exist.  By default, the program uses the host key as the
    955  1.1  christos sign key.
    956  1.1  christos .It  Fl s Ar host@group , Fl \-subject\-name Ns = Ns Ar host@group 
    957  1.1  christos set host and optionally group name.
    958  1.1  christos .sp
    959  1.1  christos Set the Autokey host name, and optionally, group name specified
    960  1.1  christos following an '\fB@\fP' character.  The host name is used in the file
    961  1.1  christos name of generated host and signing certificates, without the
    962  1.1  christos group name.  The host name, and if provided, group name are used
    963  1.1  christos in \fBhost@group\fP form for the host certificate's subject and issuer
    964  1.1  christos fields.  Specifying '\fB\-s @group\fP' is allowed, and results in
    965  1.1  christos leaving the host name unchanged while appending \fB@group\fP to the
    966  1.1  christos subject and issuer fields, as with \fB\-i group\fP.  The group name, or
    967  1.1  christos if not provided, the host name are also used in the file names
    968  1.1  christos of IFF, GQ, and MV client parameter files.
    969  1.1  christos .It  Fl T , Fl \-trusted\-cert 
    970  1.1  christos trusted certificate (TC scheme).
    971  1.1  christos .sp
    972  1.1  christos Generate a trusted certificate.  By default, the program generates
    973  1.1  christos a non\-trusted certificate.
    974  1.1  christos .It  Fl V Ar num , Fl \-mv\-params Ns = Ns Ar num 
    975  1.1  christos generate <num> MV parameters.
    976  1.1  christos This option takes an integer number as its argument.
    977  1.1  christos .sp
    978  1.1  christos Generate parameters and keys for the Mu\-Varadharajan (MV)
    979  1.1  christos identification scheme.
    980  1.1  christos .It  Fl v Ar num , Fl \-mv\-keys Ns = Ns Ar num 
    981  1.1  christos update <num> MV keys.
    982  1.1  christos This option takes an integer number as its argument.
    983  1.1  christos .sp
    984  1.1  christos This option has not been fully documented.
    985  1.1  christos .It Fl \&? , Fl \-help
    986  1.1  christos Display usage information and exit.
    987  1.1  christos .It Fl \&! , Fl \-more\-help
    988  1.1  christos Pass the extended usage information through a pager.
    989  1.1  christos .It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
    990  1.1  christos Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
    991  1.1  christos configuration file listed in the \fBOPTION PRESETS\fP section, below.
    992  1.1  christos The command will exit after updating the config file.
    993  1.1  christos .It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
    994  1.1  christos Load options from \fIcfgfile\fP.
    995  1.1  christos The \fIno\-load\-opts\fP form will disable the loading
    996  1.1  christos of earlier config/rc/ini files.  \fI\-\-no\-load\-opts\fP is handled early,
    997  1.1  christos out of order.
    998  1.1  christos .It Fl \-version Op Brq Ar v|c|n
    999  1.1  christos Output version of program and exit.  The default mode is `v', a simple
   1000  1.1  christos version.  The `c' mode will print copyright information and `n' will
   1001  1.1  christos print the full copyright notice.
   1002  1.1  christos .El
   1003  1.1  christos .Sh "OPTION PRESETS"
   1004  1.1  christos Any option that is not marked as \fInot presettable\fP may be preset
   1005  1.1  christos by loading values from configuration ("RC" or ".INI") file(s) and values from
   1006  1.1  christos environment variables named:
   1007  1.1  christos .nf
   1008  1.1  christos   \fBNTP_KEYGEN_<option\-name>\fP or \fBNTP_KEYGEN\fP
   1009  1.1  christos .fi
   1010  1.1  christos .ad
   1011  1.1  christos The environmental presets take precedence (are processed later than)
   1012  1.1  christos the configuration files.
   1013  1.1  christos The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
   1014  1.1  christos If any of these are directories, then the file \fI.ntprc\fP
   1015  1.1  christos is searched for within those directories.
   1016  1.1  christos cvt_prog='/usr/local/gnu/share/autogen/texi2mdoc'
   1017  1.1  christos cvt_prog=`cd \`dirname "$cvt_prog"\` >/dev/null && pwd
   1018  1.1  christos          `/`basename "$cvt_prog"`
   1019  1.1  christos cd $tmp_dir
   1020  1.1  christos test \-x "$cvt_prog" || die "'$cvt_prog' is not executable"
   1021  1.1  christos {
   1022  1.1  christos     list='synopsis description options option\-presets'
   1023  1.1  christos     for f in $list ; do cat $f ; echo ; done
   1024  1.1  christos     rm \-f $list name
   1025  1.1  christos     list='implementation\-notes environment files examples exit\-status errors
   1026  1.1  christos         compatibility see\-also conforming\-to history authors copyright bugs
   1027  1.1  christos         notes'
   1028  1.1  christos     for f in $list ; do cat $f ; echo ; done > .end\-doc
   1029  1.1  christos     rm \-f $list
   1030  1.1  christos     list=`ls \-1 *`' .end\-doc'
   1031  1.1  christos     for f in $list ; do cat $f ; echo ; done
   1032  1.1  christos     rm \-f $list
   1033  1.1  christos } 1>.doc 2>/dev/null
   1034  1.1  christos sed \-f .cmds .doc | /usr/local/gnu/bin/grep \-E \-v '^[ 	]*$' | $cvt_prog
   1035  1.1  christos .Sh USAGE
   1036  1.1  christos The
   1037  1.1  christos .Fl p Ar password
   1038  1.1  christos option specifies the write password and
   1039  1.1  christos .Fl q Ar password
   1040  1.1  christos option the read password for previously encrypted files.
   1041  1.1  christos The
   1042  1.1  christos .Nm
   1043  1.1  christos program prompts for the password if it reads an encrypted file
   1044  1.1  christos and the password is missing or incorrect.
   1045  1.1  christos If an encrypted file is read successfully and
   1046  1.1  christos no write password is specified, the read password is used
   1047  1.1  christos as the write password by default.
   1048  1.1  christos .Sh "ENVIRONMENT"
   1049  1.1  christos See \fBOPTION PRESETS\fP for configuration environment variables.
   1050  1.1  christos .Sh "FILES"
   1051  1.1  christos See \fBOPTION PRESETS\fP for configuration files.
   1052  1.1  christos .Sh "EXIT STATUS"
   1053  1.1  christos One of the following exit values will be returned:
   1054  1.1  christos .Bl -tag
   1055  1.1  christos .It 0 " (EXIT_SUCCESS)"
   1056  1.1  christos Successful program execution.
   1057  1.1  christos .It 1 " (EXIT_FAILURE)"
   1058  1.1  christos The operation failed or the command syntax was not valid.
   1059  1.1  christos .It 66 " (EX_NOINPUT)"
   1060  1.1  christos A specified configuration file could not be loaded.
   1061  1.1  christos .It 70 " (EX_SOFTWARE)"
   1062  1.1  christos libopts had an internal operational error.  Please report
   1063  1.1  christos it to autogen\-users (a] lists.sourceforge.net.  Thank you.
   1064  1.1  christos .El
   1065  1.1  christos .Sh "AUTHORS"
   1066  1.1  christos The University of Delaware
   1067  1.1  christos .Sh "COPYRIGHT"
   1068  1.1  christos Copyright (C) 1970\-2013 The University of Delaware all rights reserved.
   1069  1.1  christos This program is released under the terms of the NTP license, <http://ntp.org/license>.
   1070  1.1  christos .Sh BUGS
   1071  1.1  christos It can take quite a while to generate some cryptographic values,
   1072  1.1  christos from one to several minutes with modern architectures
   1073  1.1  christos such as UltraSPARC and up to tens of minutes to an hour
   1074  1.1  christos with older architectures such as SPARC IPC.
   1075  1.1  christos .Pp
   1076  1.1  christos Please report bugs to http://bugs.ntp.org .
   1077  1.1  christos .Pp
   1078  1.1  christos Please send bug reports to: http://bugs.ntp.org, bugs (a] ntp.org
   1079  1.1  christos .Sh NOTES
   1080  1.1  christos This document corresponds to version 4.2.7p404 of NTP.
   1081  1.1  christos Portions of this document came from FreeBSD.
   1082  1.1  christos .Pp
   1083  1.1  christos This manual page was \fIAutoGen\fP\-erated from the \fBntp\-keygen\fP
   1084  1.1  christos option definitions.
   1085