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