ntp-keygen.man.in revision 285169
1275970Scy.de1 NOP 2275970Scy. it 1 an-trap 3275970Scy. if \\n[.$] \,\\$*\/ 4275970Scy.. 5275970Scy.ie t \ 6275970Scy.ds B-Font [CB] 7275970Scy.ds I-Font [CI] 8275970Scy.ds R-Font [CR] 9275970Scy.el \ 10275970Scy.ds B-Font B 11275970Scy.ds I-Font I 12275970Scy.ds R-Font R 13285169Scy.TH ntp-keygen @NTP_KEYGEN_MS@ "29 Jun 2015" "ntp (4.2.8p3)" "User Commands" 14275970Scy.\" 15285169Scy.\" EDIT THIS FILE WITH CAUTION (/tmp/.ag-M4aiZI/ag-Y4aaYI) 16275970Scy.\" 17285169Scy.\" It has been AutoGen-ed June 29, 2015 at 04:32:11 PM by AutoGen 5.18.5 18275970Scy.\" From the definitions ntp-keygen-opts.def 19275970Scy.\" and the template file agman-cmd.tpl 20275970Scy.SH NAME 21275970Scy\f\*[B-Font]ntp-keygen\fP 22275970Scy\- Create a NTP host key 23275970Scy.SH SYNOPSIS 24275970Scy\f\*[B-Font]ntp-keygen\fP 25275970Scy.\" Mixture of short (flag) options and long options 26275970Scy[\f\*[B-Font]\-flags\f[]] 27275970Scy[\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]] 28275970Scy[\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]] 29275970Scy.sp \n(Ppu 30275970Scy.ne 2 31275970Scy 32275970ScyAll arguments must be options. 33275970Scy.sp \n(Ppu 34275970Scy.ne 2 35275970Scy 36275970Scy.SH DESCRIPTION 37275970ScyThis program generates cryptographic data files used by the NTPv4 38275970Scyauthentication and identification schemes. 39275970ScyIt generates MD5 key files used in symmetric key cryptography. 40275970ScyIn addition, if the OpenSSL software library has been installed, 41275970Scyit generates keys, certificate and identity files used in public key 42275970Scycryptography. 43275970ScyThese files are used for cookie encryption, 44275970Scydigital signature and challenge/response identification algorithms 45275970Scycompatible with the Internet standard security infrastructure. 46275970Scy.sp \n(Ppu 47275970Scy.ne 2 48275970Scy 49275970ScyAll files are in PEM-encoded printable ASCII format, 50275970Scyso they can be embedded as MIME attachments in mail to other sites 51275970Scyand certificate authorities. 52275970ScyBy default, files are not encrypted. 53275970Scy.sp \n(Ppu 54275970Scy.ne 2 55275970Scy 56275970ScyWhen used to generate message digest keys, the program produces a file 57275970Scycontaining ten pseudo-random printable ASCII strings suitable for the 58275970ScyMD5 message digest algorithm included in the distribution. 59275970ScyIf the OpenSSL library is installed, it produces an additional ten 60275970Scyhex-encoded random bit strings suitable for the SHA1 and other message 61275970Scydigest algorithms. 62275970ScyThe message digest keys file must be distributed and stored 63275970Scyusing secure means beyond the scope of NTP itself. 64275970ScyBesides the keys used for ordinary NTP associations, additional keys 65275970Scycan be defined as passwords for the 66285169Scy\fCntpq\f[]\fR(@NTPQ_MS@)\f[] 67275970Scyand 68285169Scy\fCntpdc\f[]\fR(@NTPDC_MS@)\f[] 69275970Scyutility programs. 70275970Scy.sp \n(Ppu 71275970Scy.ne 2 72275970Scy 73275970ScyThe remaining generated files are compatible with other OpenSSL 74275970Scyapplications and other Public Key Infrastructure (PKI) resources. 75275970ScyCertificates generated by this program are compatible with extant 76275970Scyindustry practice, although some users might find the interpretation of 77275970ScyX509v3 extension fields somewhat liberal. 78275970ScyHowever, the identity keys are probably not compatible with anything 79275970Scyother than Autokey. 80275970Scy.sp \n(Ppu 81275970Scy.ne 2 82275970Scy 83275970ScySome files used by this program are encrypted using a private password. 84275970ScyThe 85275970Scy\f\*[B-Font]\-p\f[] 86275970Scyoption specifies the password for local encrypted files and the 87275970Scy\f\*[B-Font]\-q\f[] 88275970Scyoption the password for encrypted files sent to remote sites. 89275970ScyIf no password is specified, the host name returned by the Unix 90285169Scy\fBgethostname\f[]\fR()\f[] 91275970Scyfunction, normally the DNS name of the host is used. 92275970Scy.sp \n(Ppu 93275970Scy.ne 2 94275970Scy 95275970ScyThe 96275970Scy\f\*[I-Font]pw\f[] 97275970Scyoption of the 98275970Scy\f\*[I-Font]crypto\f[] 99275970Scyconfiguration command specifies the read 100275970Scypassword for previously encrypted local files. 101275970ScyThis must match the local password used by this program. 102275970ScyIf not specified, the host name is used. 103275970ScyThus, if files are generated by this program without password, 104275970Scythey can be read back by 105275970Scy\f\*[I-Font]ntpd\f[] 106275970Scywithout password but only on the same host. 107275970Scy.sp \n(Ppu 108275970Scy.ne 2 109275970Scy 110275970ScyNormally, encrypted files for each host are generated by that host and 111275970Scyused only by that host, although exceptions exist as noted later on 112275970Scythis page. 113275970ScyThe symmetric keys file, normally called 114275970Scy\f\*[I-Font]ntp.keys\f[], 115275970Scyis usually installed in 116275970Scy\fI/etc\f[]. 117275970ScyOther files and links are usually installed in 118275970Scy\fI/usr/local/etc\f[], 119275970Scywhich is normally in a shared filesystem in 120275970ScyNFS-mounted networks and cannot be changed by shared clients. 121275970ScyThe location of the keys directory can be changed by the 122275970Scy\f\*[I-Font]keysdir\f[] 123275970Scyconfiguration command in such cases. 124275970ScyNormally, this is in 125275970Scy\fI/etc\f[]. 126275970Scy.sp \n(Ppu 127275970Scy.ne 2 128275970Scy 129275970ScyThis program directs commentary and error messages to the standard 130275970Scyerror stream 131275970Scy\f\*[I-Font]stderr\f[] 132275970Scyand remote files to the standard output stream 133275970Scy\f\*[I-Font]stdout\f[] 134275970Scywhere they can be piped to other applications or redirected to files. 135275970ScyThe names used for generated files and links all begin with the 136275970Scystring 137275970Scy\f\*[I-Font]ntpkey\f[] 138275970Scyand include the file type, generating host and filestamp, 139275970Scyas described in the 140275970Scy\*[Lq]Cryptographic Data Files\*[Rq] 141275970Scysection below. 142275970Scy.SS Running the Program 143275970ScyTo test and gain experience with Autokey concepts, log in as root and 144275970Scychange to the keys directory, usually 145275970Scy\fI/usr/local/etc\f[] 146275970ScyWhen run for the first time, or if all files with names beginning with 147275970Scy\f\*[I-Font]ntpkey\f[] 148275970Scyhave been removed, use the 149275970Scy\f\*[B-Font]ntp-keygen\fP 150275970Scycommand without arguments to generate a 151275970Scydefault RSA host key and matching RSA-MD5 certificate with expiration 152275970Scydate one year hence. 153275970ScyIf run again without options, the program uses the 154275970Scyexisting keys and parameters and generates only a new certificate with 155275970Scynew expiration date one year hence. 156275970Scy.sp \n(Ppu 157275970Scy.ne 2 158275970Scy 159275970ScyRun the command on as many hosts as necessary. 160275970ScyDesignate one of them as the trusted host (TH) using 161275970Scy\f\*[B-Font]ntp-keygen\fP 162275970Scywith the 163275970Scy\f\*[B-Font]\-T\f[] 164275970Scyoption and configure it to synchronize from reliable Internet servers. 165275970ScyThen configure the other hosts to synchronize to the TH directly or 166275970Scyindirectly. 167275970ScyA certificate trail is created when Autokey asks the immediately 168275970Scyascendant host towards the TH to sign its certificate, which is then 169275970Scyprovided to the immediately descendant host on request. 170275970ScyAll group hosts should have acyclic certificate trails ending on the TH. 171275970Scy.sp \n(Ppu 172275970Scy.ne 2 173275970Scy 174275970ScyThe host key is used to encrypt the cookie when required and so must be 175275970ScyRSA type. 176275970ScyBy default, the host key is also the sign key used to encrypt 177275970Scysignatures. 178275970ScyA different sign key can be assigned using the 179275970Scy\f\*[B-Font]\-S\f[] 180275970Scyoption and this can be either RSA or DSA type. 181275970ScyBy default, the signature 182275970Scymessage digest type is MD5, but any combination of sign key type and 183275970Scymessage digest type supported by the OpenSSL library can be specified 184275970Scyusing the 185275970Scy\f\*[B-Font]\-c\f[] 186275970Scyoption. 187275970ScyThe rules say cryptographic media should be generated with proventic 188275970Scyfilestamps, which means the host should already be synchronized before 189275970Scythis program is run. 190275970ScyThis of course creates a chicken-and-egg problem 191275970Scywhen the host is started for the first time. 192275970ScyAccordingly, the host time 193275970Scyshould be set by some other means, such as eyeball-and-wristwatch, at 194275970Scyleast so that the certificate lifetime is within the current year. 195275970ScyAfter that and when the host is synchronized to a proventic source, the 196275970Scycertificate should be re-generated. 197275970Scy.sp \n(Ppu 198275970Scy.ne 2 199275970Scy 200275970ScyAdditional information on trusted groups and identity schemes is on the 201275970Scy\*[Lq]Autokey Public-Key Authentication\*[Rq] 202275970Scypage. 203275970Scy.sp \n(Ppu 204275970Scy.ne 2 205275970Scy 206275970ScyThe 207285169Scy\fCntpd\f[]\fR(@NTPD_MS@)\f[] 208275970Scyconfiguration command 209275970Scy\f\*[B-Font]crypto\f[] \f\*[B-Font]pw\f[] \f\*[I-Font]password\f[] 210275970Scyspecifies the read password for previously encrypted files. 211275970ScyThe daemon expires on the spot if the password is missing 212275970Scyor incorrect. 213275970ScyFor convenience, if a file has been previously encrypted, 214275970Scythe default read password is the name of the host running 215275970Scythe program. 216275970ScyIf the previous write password is specified as the host name, 217275970Scythese files can be read by that host with no explicit password. 218275970Scy.sp \n(Ppu 219275970Scy.ne 2 220275970Scy 221275970ScyFile names begin with the prefix 222275970Scy\f\*[B-Font]ntpkey_\f[] 223275970Scyand end with the postfix 224275970Scy\f\*[I-Font]_hostname.filestamp\f[], 225275970Scywhere 226275970Scy\f\*[I-Font]hostname\f[] 227275970Scyis the owner name, usually the string returned 228275970Scyby the Unix gethostname() routine, and 229275970Scy\f\*[I-Font]filestamp\f[] 230275970Scyis the NTP seconds when the file was generated, in decimal digits. 231275970ScyThis both guarantees uniqueness and simplifies maintenance 232275970Scyprocedures, since all files can be quickly removed 233275970Scyby a 234275970Scy\f\*[B-Font]rm\f[] \f\*[B-Font]ntpkey\&*\f[] 235275970Scycommand or all files generated 236275970Scyat a specific time can be removed by a 237275970Scy\f\*[B-Font]rm\f[] 238275970Scy\f\*[I-Font]\&*filestamp\f[] 239275970Scycommand. 240275970ScyTo further reduce the risk of misconfiguration, 241275970Scythe first two lines of a file contain the file name 242275970Scyand generation date and time as comments. 243275970Scy.sp \n(Ppu 244275970Scy.ne 2 245275970Scy 246275970ScyAll files are installed by default in the keys directory 247275970Scy\fI/usr/local/etc\f[], 248275970Scywhich is normally in a shared filesystem 249275970Scyin NFS-mounted networks. 250275970ScyThe actual location of the keys directory 251275970Scyand each file can be overridden by configuration commands, 252275970Scybut this is not recommended. 253275970ScyNormally, the files for each host are generated by that host 254275970Scyand used only by that host, although exceptions exist 255275970Scyas noted later on this page. 256275970Scy.sp \n(Ppu 257275970Scy.ne 2 258275970Scy 259275970ScyNormally, files containing private values, 260275970Scyincluding the host key, sign key and identification parameters, 261275970Scyare permitted root read/write-only; 262275970Scywhile others containing public values are permitted world readable. 263275970ScyAlternatively, files containing private values can be encrypted 264275970Scyand these files permitted world readable, 265275970Scywhich simplifies maintenance in shared file systems. 266275970ScySince uniqueness is insured by the hostname and 267275970Scyfile name extensions, the files for a NFS server and 268275970Scydependent clients can all be installed in the same shared directory. 269275970Scy.sp \n(Ppu 270275970Scy.ne 2 271275970Scy 272275970ScyThe recommended practice is to keep the file name extensions 273275970Scywhen installing a file and to install a soft link 274275970Scyfrom the generic names specified elsewhere on this page 275275970Scyto the generated files. 276275970ScyThis allows new file generations to be activated simply 277275970Scyby changing the link. 278275970ScyIf a link is present, ntpd follows it to the file name 279275970Scyto extract the filestamp. 280275970ScyIf a link is not present, 281285169Scy\fCntpd\f[]\fR(@NTPD_MS@)\f[] 282275970Scyextracts the filestamp from the file itself. 283275970ScyThis allows clients to verify that the file and generation times 284275970Scyare always current. 285275970ScyThe 286275970Scy\f\*[B-Font]ntp-keygen\fP 287275970Scyprogram uses the same timestamp extension for all files generated 288275970Scyat one time, so each generation is distinct and can be readily 289275970Scyrecognized in monitoring data. 290275970Scy.SS Running the program 291275970ScyThe safest way to run the 292275970Scy\f\*[B-Font]ntp-keygen\fP 293275970Scyprogram is logged in directly as root. 294275970ScyThe recommended procedure is change to the keys directory, 295275970Scyusually 296275970Scy\fI/usr/local/etc\f[], 297275970Scythen run the program. 298275970ScyWhen run for the first time, 299275970Scyor if all 300275970Scy\f\*[B-Font]ntpkey\f[] 301275970Scyfiles have been removed, 302275970Scythe program generates a RSA host key file and matching RSA-MD5 certificate file, 303275970Scywhich is all that is necessary in many cases. 304275970ScyThe program also generates soft links from the generic names 305275970Scyto the respective files. 306275970ScyIf run again, the program uses the same host key file, 307275970Scybut generates a new certificate file and link. 308275970Scy.sp \n(Ppu 309275970Scy.ne 2 310275970Scy 311275970ScyThe host key is used to encrypt the cookie when required and so must be RSA type. 312275970ScyBy default, the host key is also the sign key used to encrypt signatures. 313275970ScyWhen necessary, a different sign key can be specified and this can be 314275970Scyeither RSA or DSA type. 315275970ScyBy default, the message digest type is MD5, but any combination 316275970Scyof sign key type and message digest type supported by the OpenSSL library 317275970Scycan be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 318275970Scyand RIPE160 message digest algorithms. 319275970ScyHowever, the scheme specified in the certificate must be compatible 320275970Scywith the sign key. 321275970ScyCertificates using any digest algorithm are compatible with RSA sign keys; 322275970Scyhowever, only SHA and SHA1 certificates are compatible with DSA sign keys. 323275970Scy.sp \n(Ppu 324275970Scy.ne 2 325275970Scy 326275970ScyPrivate/public key files and certificates are compatible with 327275970Scyother OpenSSL applications and very likely other libraries as well. 328275970ScyCertificates or certificate requests derived from them should be compatible 329275970Scywith extant industry practice, although some users might find 330275970Scythe interpretation of X509v3 extension fields somewhat liberal. 331275970ScyHowever, the identification parameter files, although encoded 332275970Scyas the other files, are probably not compatible with anything other than Autokey. 333275970Scy.sp \n(Ppu 334275970Scy.ne 2 335275970Scy 336275970ScyRunning the program as other than root and using the Unix 337275970Scy\f\*[B-Font]su\f[] 338275970Scycommand 339275970Scyto assume root may not work properly, since by default the OpenSSL library 340275970Scylooks for the random seed file 341275970Scy\f\*[B-Font].rnd\f[] 342275970Scyin the user home directory. 343275970ScyHowever, there should be only one 344275970Scy\f\*[B-Font].rnd\f[], 345275970Scymost conveniently 346275970Scyin the root directory, so it is convenient to define the 347275970Scy\f\*[B-Font]$RANDFILE\f[] 348275970Scyenvironment variable used by the OpenSSL library as the path to 349275970Scy\f\*[B-Font]/.rnd\f[]. 350275970Scy.sp \n(Ppu 351275970Scy.ne 2 352275970Scy 353275970ScyInstalling the keys as root might not work in NFS-mounted 354275970Scyshared file systems, as NFS clients may not be able to write 355275970Scyto the shared keys directory, even as root. 356275970ScyIn this case, NFS clients can specify the files in another 357275970Scydirectory such as 358275970Scy\fI/etc\f[] 359275970Scyusing the 360275970Scy\f\*[B-Font]keysdir\f[] 361275970Scycommand. 362275970ScyThere is no need for one client to read the keys and certificates 363275970Scyof other clients or servers, as these data are obtained automatically 364275970Scyby the Autokey protocol. 365275970Scy.sp \n(Ppu 366275970Scy.ne 2 367275970Scy 368275970ScyOrdinarily, cryptographic files are generated by the host that uses them, 369275970Scybut it is possible for a trusted agent (TA) to generate these files 370275970Scyfor other hosts; however, in such cases files should always be encrypted. 371275970ScyThe subject name and trusted name default to the hostname 372275970Scyof the host generating the files, but can be changed by command line options. 373275970ScyIt is convenient to designate the owner name and trusted name 374275970Scyas the subject and issuer fields, respectively, of the certificate. 375275970ScyThe owner name is also used for the host and sign key files, 376275970Scywhile the trusted name is used for the identity files. 377275970Scy.sp \n(Ppu 378275970Scy.ne 2 379275970Scy 380275970ScyAll files are installed by default in the keys directory 381275970Scy\fI/usr/local/etc\f[], 382275970Scywhich is normally in a shared filesystem 383275970Scyin NFS-mounted networks. 384275970ScyThe actual location of the keys directory 385275970Scyand each file can be overridden by configuration commands, 386275970Scybut this is not recommended. 387275970ScyNormally, the files for each host are generated by that host 388275970Scyand used only by that host, although exceptions exist 389275970Scyas noted later on this page. 390275970Scy.sp \n(Ppu 391275970Scy.ne 2 392275970Scy 393275970ScyNormally, files containing private values, 394275970Scyincluding the host key, sign key and identification parameters, 395275970Scyare permitted root read/write-only; 396275970Scywhile others containing public values are permitted world readable. 397275970ScyAlternatively, files containing private values can be encrypted 398275970Scyand these files permitted world readable, 399275970Scywhich simplifies maintenance in shared file systems. 400275970ScySince uniqueness is insured by the hostname and 401275970Scyfile name extensions, the files for a NFS server and 402275970Scydependent clients can all be installed in the same shared directory. 403275970Scy.sp \n(Ppu 404275970Scy.ne 2 405275970Scy 406275970ScyThe recommended practice is to keep the file name extensions 407275970Scywhen installing a file and to install a soft link 408275970Scyfrom the generic names specified elsewhere on this page 409275970Scyto the generated files. 410275970ScyThis allows new file generations to be activated simply 411275970Scyby changing the link. 412275970ScyIf a link is present, ntpd follows it to the file name 413275970Scyto extract the filestamp. 414275970ScyIf a link is not present, 415285169Scy\fCntpd\f[]\fR(@NTPD_MS@)\f[] 416275970Scyextracts the filestamp from the file itself. 417275970ScyThis allows clients to verify that the file and generation times 418275970Scyare always current. 419275970ScyThe 420275970Scy\f\*[B-Font]ntp-keygen\fP 421275970Scyprogram uses the same timestamp extension for all files generated 422275970Scyat one time, so each generation is distinct and can be readily 423275970Scyrecognized in monitoring data. 424275970Scy.SS Running the program 425275970ScyThe safest way to run the 426275970Scy\f\*[B-Font]ntp-keygen\fP 427275970Scyprogram is logged in directly as root. 428275970ScyThe recommended procedure is change to the keys directory, 429275970Scyusually 430275970Scy\fI/usr/local/etc\f[], 431275970Scythen run the program. 432275970ScyWhen run for the first time, 433275970Scyor if all 434275970Scy\f\*[B-Font]ntpkey\f[] 435275970Scyfiles have been removed, 436275970Scythe program generates a RSA host key file and matching RSA-MD5 certificate file, 437275970Scywhich is all that is necessary in many cases. 438275970ScyThe program also generates soft links from the generic names 439275970Scyto the respective files. 440275970ScyIf run again, the program uses the same host key file, 441275970Scybut generates a new certificate file and link. 442275970Scy.sp \n(Ppu 443275970Scy.ne 2 444275970Scy 445275970ScyThe host key is used to encrypt the cookie when required and so must be RSA type. 446275970ScyBy default, the host key is also the sign key used to encrypt signatures. 447275970ScyWhen necessary, a different sign key can be specified and this can be 448275970Scyeither RSA or DSA type. 449275970ScyBy default, the message digest type is MD5, but any combination 450275970Scyof sign key type and message digest type supported by the OpenSSL library 451275970Scycan be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 452275970Scyand RIPE160 message digest algorithms. 453275970ScyHowever, the scheme specified in the certificate must be compatible 454275970Scywith the sign key. 455275970ScyCertificates using any digest algorithm are compatible with RSA sign keys; 456275970Scyhowever, only SHA and SHA1 certificates are compatible with DSA sign keys. 457275970Scy.sp \n(Ppu 458275970Scy.ne 2 459275970Scy 460275970ScyPrivate/public key files and certificates are compatible with 461275970Scyother OpenSSL applications and very likely other libraries as well. 462275970ScyCertificates or certificate requests derived from them should be compatible 463275970Scywith extant industry practice, although some users might find 464275970Scythe interpretation of X509v3 extension fields somewhat liberal. 465275970ScyHowever, the identification parameter files, although encoded 466275970Scyas the other files, are probably not compatible with anything other than Autokey. 467275970Scy.sp \n(Ppu 468275970Scy.ne 2 469275970Scy 470275970ScyRunning the program as other than root and using the Unix 471275970Scy\f\*[B-Font]su\f[] 472275970Scycommand 473275970Scyto assume root may not work properly, since by default the OpenSSL library 474275970Scylooks for the random seed file 475275970Scy\f\*[B-Font].rnd\f[] 476275970Scyin the user home directory. 477275970ScyHowever, there should be only one 478275970Scy\f\*[B-Font].rnd\f[], 479275970Scymost conveniently 480275970Scyin the root directory, so it is convenient to define the 481275970Scy\f\*[B-Font]$RANDFILE\f[] 482275970Scyenvironment variable used by the OpenSSL library as the path to 483275970Scy\f\*[B-Font]/.rnd\f[]. 484275970Scy.sp \n(Ppu 485275970Scy.ne 2 486275970Scy 487275970ScyInstalling the keys as root might not work in NFS-mounted 488275970Scyshared file systems, as NFS clients may not be able to write 489275970Scyto the shared keys directory, even as root. 490275970ScyIn this case, NFS clients can specify the files in another 491275970Scydirectory such as 492275970Scy\fI/etc\f[] 493275970Scyusing the 494275970Scy\f\*[B-Font]keysdir\f[] 495275970Scycommand. 496275970ScyThere is no need for one client to read the keys and certificates 497275970Scyof other clients or servers, as these data are obtained automatically 498275970Scyby the Autokey protocol. 499275970Scy.sp \n(Ppu 500275970Scy.ne 2 501275970Scy 502275970ScyOrdinarily, cryptographic files are generated by the host that uses them, 503275970Scybut it is possible for a trusted agent (TA) to generate these files 504275970Scyfor other hosts; however, in such cases files should always be encrypted. 505275970ScyThe subject name and trusted name default to the hostname 506275970Scyof the host generating the files, but can be changed by command line options. 507275970ScyIt is convenient to designate the owner name and trusted name 508275970Scyas the subject and issuer fields, respectively, of the certificate. 509275970ScyThe owner name is also used for the host and sign key files, 510275970Scywhile the trusted name is used for the identity files. 511275970Scyseconds. 512275970Scyseconds. 513275970Scys Trusted Hosts and Groups 514275970ScyEach cryptographic configuration involves selection of a signature scheme 515275970Scyand identification scheme, called a cryptotype, 516275970Scyas explained in the 517275970Scy\fIAuthentication\f[] \fIOptions\f[] 518275970Scysection of 519285169Scy\fCntp.conf\f[]\fR(5)\f[]. 520275970ScyThe default cryptotype uses RSA encryption, MD5 message digest 521275970Scyand TC identification. 522275970ScyFirst, configure a NTP subnet including one or more low-stratum 523275970Scytrusted hosts from which all other hosts derive synchronization 524275970Scydirectly or indirectly. 525275970ScyTrusted hosts have trusted certificates; 526275970Scyall other hosts have nontrusted certificates. 527275970ScyThese hosts will automatically and dynamically build authoritative 528275970Scycertificate trails to one or more trusted hosts. 529275970ScyA trusted group is the set of all hosts that have, directly or indirectly, 530275970Scya certificate trail ending at a trusted host. 531275970ScyThe trail is defined by static configuration file entries 532275970Scyor dynamic means described on the 533275970Scy\fIAutomatic\f[] \fINTP\f[] \fIConfiguration\f[] \fIOptions\f[] 534275970Scysection of 535285169Scy\fCntp.conf\f[]\fR(5)\f[]. 536275970Scy.sp \n(Ppu 537275970Scy.ne 2 538275970Scy 539275970ScyOn each trusted host as root, change to the keys directory. 540275970ScyTo insure a fresh fileset, remove all 541275970Scy\f\*[B-Font]ntpkey\f[] 542275970Scyfiles. 543275970ScyThen run 544275970Scy\f\*[B-Font]ntp-keygen\fP 545275970Scy\f\*[B-Font]\-T\f[] 546275970Scyto generate keys and a trusted certificate. 547275970ScyOn all other hosts do the same, but leave off the 548275970Scy\f\*[B-Font]\-T\f[] 549275970Scyflag to generate keys and nontrusted certificates. 550275970ScyWhen complete, start the NTP daemons beginning at the lowest stratum 551275970Scyand working up the tree. 552275970ScyIt may take some time for Autokey to instantiate the certificate trails 553275970Scythroughout the subnet, but setting up the environment is completely automatic. 554275970Scy.sp \n(Ppu 555275970Scy.ne 2 556275970Scy 557275970ScyIf it is necessary to use a different sign key or different digest/signature 558275970Scyscheme than the default, run 559275970Scy\f\*[B-Font]ntp-keygen\fP 560275970Scywith the 561275970Scy\f\*[B-Font]\-S\f[] \f\*[I-Font]type\f[] 562275970Scyoption, where 563275970Scy\f\*[I-Font]type\f[] 564275970Scyis either 565275970Scy\f\*[B-Font]RSA\f[] 566275970Scyor 567275970Scy\f\*[B-Font]DSA\f[]. 568275970ScyThe most often need to do this is when a DSA-signed certificate is used. 569275970ScyIf it is necessary to use a different certificate scheme than the default, 570275970Scyrun 571275970Scy\f\*[B-Font]ntp-keygen\fP 572275970Scywith the 573275970Scy\f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[] 574275970Scyoption and selected 575275970Scy\f\*[I-Font]scheme\f[] 576275970Scyas needed. 577275970Scyf 578275970Scy\f\*[B-Font]ntp-keygen\fP 579275970Scyis run again without these options, it generates a new certificate 580275970Scyusing the same scheme and sign key. 581275970Scy.sp \n(Ppu 582275970Scy.ne 2 583275970Scy 584275970ScyAfter setting up the environment it is advisable to update certificates 585275970Scyfrom time to time, if only to extend the validity interval. 586275970ScySimply run 587275970Scy\f\*[B-Font]ntp-keygen\fP 588275970Scywith the same flags as before to generate new certificates 589275970Scyusing existing keys. 590275970ScyHowever, if the host or sign key is changed, 591285169Scy\fCntpd\f[]\fR(@NTPD_MS@)\f[] 592275970Scyshould be restarted. 593275970ScyWhen 594285169Scy\fCntpd\f[]\fR(@NTPD_MS@)\f[] 595275970Scyis restarted, it loads any new files and restarts the protocol. 596275970ScyOther dependent hosts will continue as usual until signatures are refreshed, 597275970Scyat which time the protocol is restarted. 598275970Scy.SS Identity Schemes 599275970ScyAs mentioned on the Autonomous Authentication page, 600275970Scythe default TC identity scheme is vulnerable to a middleman attack. 601275970ScyHowever, there are more secure identity schemes available, 602275970Scyincluding PC, IFF, GQ and MV described on the 603275970Scy"Identification Schemes" 604275970Scypage 605275970Scy(maybe available at 606275970Scy\f[C]http://www.eecis.udel.edu/%7emills/keygen.html\f[]). 607275970ScyThese schemes are based on a TA, one or more trusted hosts 608275970Scyand some number of nontrusted hosts. 609275970ScyTrusted hosts prove identity using values provided by the TA, 610275970Scywhile the remaining hosts prove identity using values provided 611275970Scyby a trusted host and certificate trails that end on that host. 612275970ScyThe name of a trusted host is also the name of its sugroup 613275970Scyand also the subject and issuer name on its trusted certificate. 614275970ScyThe TA is not necessarily a trusted host in this sense, but often is. 615275970Scy.sp \n(Ppu 616275970Scy.ne 2 617275970Scy 618275970ScyIn some schemes there are separate keys for servers and clients. 619275970ScyA server can also be a client of another server, 620275970Scybut a client can never be a server for another client. 621275970ScyIn general, trusted hosts and nontrusted hosts that operate 622275970Scyas both server and client have parameter files that contain 623275970Scyboth server and client keys. 624275970ScyHosts that operate 625275970Scyonly as clients have key files that contain only client keys. 626275970Scy.sp \n(Ppu 627275970Scy.ne 2 628275970Scy 629275970ScyThe PC scheme supports only one trusted host in the group. 630275970ScyOn trusted host alice run 631275970Scy\f\*[B-Font]ntp-keygen\fP 632275970Scy\f\*[B-Font]\-P\f[] 633275970Scy\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[] 634275970Scyto generate the host key file 635275970Scy\fIntpkey_RSAkey_\f[]\f\*[I-Font]alice.filestamp\f[] 636275970Scyand trusted private certificate file 637275970Scy\fIntpkey_RSA-MD5_cert_\f[]\f\*[I-Font]alice.filestamp\f[]. 638275970ScyCopy both files to all group hosts; 639275970Scythey replace the files which would be generated in other schemes. 640275970ScyOn each host bob install a soft link from the generic name 641275970Scy\fIntpkey_host_\f[]\f\*[I-Font]bob\f[] 642275970Scyto the host key file and soft link 643275970Scy\fIntpkey_cert_\f[]\f\*[I-Font]bob\f[] 644275970Scyto the private certificate file. 645275970ScyNote the generic links are on bob, but point to files generated 646275970Scyby trusted host alice. 647275970ScyIn this scheme it is not possible to refresh 648275970Scyeither the keys or certificates without copying them 649275970Scyto all other hosts in the group. 650275970Scy.sp \n(Ppu 651275970Scy.ne 2 652275970Scy 653275970ScyFor the IFF scheme proceed as in the TC scheme to generate keys 654275970Scyand certificates for all group hosts, then for every trusted host in the group, 655275970Scygenerate the IFF parameter file. 656275970ScyOn trusted host alice run 657275970Scy\f\*[B-Font]ntp-keygen\fP 658275970Scy\f\*[B-Font]\-T\f[] 659275970Scy\f\*[B-Font]\-I\f[] 660275970Scy\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[] 661275970Scyto produce her parameter file 662275970Scy\fIntpkey_IFFpar_\f[]\f\*[I-Font]alice.filestamp\f[], 663275970Scywhich includes both server and client keys. 664275970ScyCopy this file to all group hosts that operate as both servers 665275970Scyand clients and install a soft link from the generic 666275970Scy\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[] 667275970Scyto this file. 668275970ScyIf there are no hosts restricted to operate only as clients, 669275970Scythere is nothing further to do. 670275970ScyAs the IFF scheme is independent 671275970Scyof keys and certificates, these files can be refreshed as needed. 672275970Scy.sp \n(Ppu 673275970Scy.ne 2 674275970Scy 675275970ScyIf a rogue client has the parameter file, it could masquerade 676275970Scyas a legitimate server and present a middleman threat. 677275970ScyTo eliminate this threat, the client keys can be extracted 678275970Scyfrom the parameter file and distributed to all restricted clients. 679275970ScyAfter generating the parameter file, on alice run 680275970Scy\f\*[B-Font]ntp-keygen\fP 681275970Scy\f\*[B-Font]\-e\f[] 682275970Scyand pipe the output to a file or mail program. 683275970ScyCopy or mail this file to all restricted clients. 684275970ScyOn these clients install a soft link from the generic 685275970Scy\fIntpkey_iff_\f[]\f\*[I-Font]alice\f[] 686275970Scyto this file. 687275970ScyTo further protect the integrity of the keys, 688275970Scyeach file can be encrypted with a secret password. 689275970Scy.sp \n(Ppu 690275970Scy.ne 2 691275970Scy 692275970ScyFor the GQ scheme proceed as in the TC scheme to generate keys 693275970Scyand certificates for all group hosts, then for every trusted host 694275970Scyin the group, generate the IFF parameter file. 695275970ScyOn trusted host alice run 696275970Scy\f\*[B-Font]ntp-keygen\fP 697275970Scy\f\*[B-Font]\-T\f[] 698275970Scy\f\*[B-Font]\-G\f[] 699275970Scy\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[] 700275970Scyto produce her parameter file 701275970Scy\fIntpkey_GQpar_\f[]\f\*[I-Font]alice.filestamp\f[], 702275970Scywhich includes both server and client keys. 703275970ScyCopy this file to all group hosts and install a soft link 704275970Scyfrom the generic 705275970Scy\fIntpkey_gq_\f[]\f\*[I-Font]alice\f[] 706275970Scyto this file. 707275970ScyIn addition, on each host bob install a soft link 708275970Scyfrom generic 709275970Scy\fIntpkey_gq_\f[]\f\*[I-Font]bob\f[] 710275970Scyto this file. 711275970ScyAs the GQ scheme updates the GQ parameters file and certificate 712275970Scyat the same time, keys and certificates can be regenerated as needed. 713275970Scy.sp \n(Ppu 714275970Scy.ne 2 715275970Scy 716275970ScyFor the MV scheme, proceed as in the TC scheme to generate keys 717275970Scyand certificates for all group hosts. 718275970ScyFor illustration assume trish is the TA, alice one of several trusted hosts 719275970Scyand bob one of her clients. 720275970ScyOn TA trish run 721275970Scy\f\*[B-Font]ntp-keygen\fP 722275970Scy\f\*[B-Font]\-V\f[] \f\*[I-Font]n\f[] 723275970Scy\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[], 724275970Scywhere 725275970Scy\f\*[I-Font]n\f[] 726275970Scyis the number of revokable keys (typically 5) to produce 727275970Scythe parameter file 728275970Scy\fIntpkeys_MVpar_\f[]\f\*[I-Font]trish.filestamp\f[] 729275970Scyand client key files 730275970Scy\fIntpkeys_MVkeyd_\f[]\f\*[I-Font]trish.filestamp\f[] 731275970Scywhere 732275970Scy\f\*[I-Font]d\f[] 733275970Scyis the key number (0 \&< 734275970Scy\f\*[I-Font]d\f[] 735275970Scy\&< 736275970Scy\f\*[I-Font]n\f[]). 737275970ScyCopy the parameter file to alice and install a soft link 738275970Scyfrom the generic 739275970Scy\fIntpkey_mv_\f[]\f\*[I-Font]alice\f[] 740275970Scyto this file. 741275970ScyCopy one of the client key files to alice for later distribution 742275970Scyto her clients. 743275970ScyIt doesn't matter which client key file goes to alice, 744275970Scysince they all work the same way. 745275970ScyAlice copies the client key file to all of her cliens. 746275970ScyOn client bob install a soft link from generic 747275970Scy\fIntpkey_mvkey_\f[]\f\*[I-Font]bob\f[] 748275970Scyto the client key file. 749275970ScyAs the MV scheme is independent of keys and certificates, 750275970Scythese files can be refreshed as needed. 751275970Scy.SS Command Line Options 752275970Scy.TP 7 753275970Scy.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[] 754275970ScySelect certificate message digest/signature encryption scheme. 755275970ScyThe 756275970Scy\f\*[I-Font]scheme\f[] 757275970Scycan be one of the following: 758275970Scy. Cm RSA-MD2 , RSA-MD5 , RSA-SHA , RSA-SHA1 , RSA-MDC2 , RSA-RIPEMD160 , DSA-SHA , 759275970Scyor 760275970Scy\f\*[B-Font]DSA-SHA1\f[]. 761275970ScyNote that RSA schemes must be used with a RSA sign key and DSA 762275970Scyschemes must be used with a DSA sign key. 763275970ScyThe default without this option is 764275970Scy\f\*[B-Font]RSA-MD5\f[]. 765275970Scy.TP 7 766275970Scy.NOP \f\*[B-Font]\-d\f[] 767275970ScyEnable debugging. 768275970ScyThis option displays the cryptographic data produced in eye-friendly billboards. 769275970Scy.TP 7 770275970Scy.NOP \f\*[B-Font]\-e\f[] 771275970ScyWrite the IFF client keys to the standard output. 772275970ScyThis is intended for automatic key distribution by mail. 773275970Scy.TP 7 774275970Scy.NOP \f\*[B-Font]\-G\f[] 775275970ScyGenerate parameters and keys for the GQ identification scheme, 776275970Scyobsoleting any that may exist. 777275970Scy.TP 7 778275970Scy.NOP \f\*[B-Font]\-g\f[] 779275970ScyGenerate keys for the GQ identification scheme 780275970Scyusing the existing GQ parameters. 781275970ScyIf the GQ parameters do not yet exist, create them first. 782275970Scy.TP 7 783275970Scy.NOP \f\*[B-Font]\-H\f[] 784275970ScyGenerate new host keys, obsoleting any that may exist. 785275970Scy.TP 7 786275970Scy.NOP \f\*[B-Font]\-I\f[] 787275970ScyGenerate parameters for the IFF identification scheme, 788275970Scyobsoleting any that may exist. 789275970Scy.TP 7 790275970Scy.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]name\f[] 791275970ScySet the suject name to 792275970Scy\f\*[I-Font]name\f[]. 793275970ScyThis is used as the subject field in certificates 794275970Scyand in the file name for host and sign keys. 795275970Scy.TP 7 796275970Scy.NOP \f\*[B-Font]\-M\f[] 797275970ScyGenerate MD5 keys, obsoleting any that may exist. 798275970Scy.TP 7 799275970Scy.NOP \f\*[B-Font]\-P\f[] 800275970ScyGenerate a private certificate. 801275970ScyBy default, the program generates public certificates. 802275970Scy.TP 7 803275970Scy.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[] 804275970ScyEncrypt generated files containing private data with 805275970Scy\f\*[I-Font]password\f[] 806275970Scyand the DES-CBC algorithm. 807275970Scy.TP 7 808275970Scy.NOP \f\*[B-Font]\-q\f[] 809275970ScySet the password for reading files to password. 810275970Scy.TP 7 811275970Scy.NOP \f\*[B-Font]\-S\f[] [\f\*[B-Font]RSA\f[] | \f\*[B-Font]DSA\f[]] 812275970ScyGenerate a new sign key of the designated type, 813275970Scyobsoleting any that may exist. 814275970ScyBy default, the program uses the host key as the sign key. 815275970Scy.TP 7 816275970Scy.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]name\f[] 817275970ScySet the issuer name to 818275970Scy\f\*[I-Font]name\f[]. 819275970ScyThis is used for the issuer field in certificates 820275970Scyand in the file name for identity files. 821275970Scy.TP 7 822275970Scy.NOP \f\*[B-Font]\-T\f[] 823275970ScyGenerate a trusted certificate. 824275970ScyBy default, the program generates a non-trusted certificate. 825275970Scy.TP 7 826275970Scy.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]nkeys\f[] 827275970ScyGenerate parameters and keys for the Mu-Varadharajan (MV) identification scheme. 828275970Scy.PP 829275970Scy.SS Random Seed File 830275970ScyAll cryptographically sound key generation schemes must have means 831275970Scyto randomize the entropy seed used to initialize 832275970Scythe internal pseudo-random number generator used 833275970Scyby the library routines. 834275970ScyThe OpenSSL library uses a designated random seed file for this purpose. 835275970ScyThe file must be available when starting the NTP daemon and 836275970Scy\f\*[B-Font]ntp-keygen\fP 837275970Scyprogram. 838275970ScyIf a site supports OpenSSL or its companion OpenSSH, 839275970Scyit is very likely that means to do this are already available. 840275970Scy.sp \n(Ppu 841275970Scy.ne 2 842275970Scy 843275970ScyIt is important to understand that entropy must be evolved 844275970Scyfor each generation, for otherwise the random number sequence 845275970Scywould be predictable. 846275970ScyVarious means dependent on external events, such as keystroke intervals, 847275970Scycan be used to do this and some systems have built-in entropy sources. 848275970ScySuitable means are described in the OpenSSL software documentation, 849275970Scybut are outside the scope of this page. 850275970Scy.sp \n(Ppu 851275970Scy.ne 2 852275970Scy 853275970ScyThe entropy seed used by the OpenSSL library is contained in a file, 854275970Scyusually called 855275970Scy\f\*[B-Font].rnd\f[], 856275970Scywhich must be available when starting the NTP daemon 857275970Scyor the 858275970Scy\f\*[B-Font]ntp-keygen\fP 859275970Scyprogram. 860275970ScyThe NTP daemon will first look for the file 861275970Scyusing the path specified by the 862275970Scy\f\*[B-Font]randfile\f[] 863275970Scysubcommand of the 864275970Scy\f\*[B-Font]crypto\f[] 865275970Scyconfiguration command. 866275970ScyIf not specified in this way, or when starting the 867275970Scy\f\*[B-Font]ntp-keygen\fP 868275970Scyprogram, 869275970Scythe OpenSSL library will look for the file using the path specified 870275970Scyby the 871275970ScyRANDFILE 872275970Scyenvironment variable in the user home directory, 873275970Scywhether root or some other user. 874275970ScyIf the 875275970ScyRANDFILE 876275970Scyenvironment variable is not present, 877275970Scythe library will look for the 878275970Scy\f\*[B-Font].rnd\f[] 879275970Scyfile in the user home directory. 880275970ScyIf the file is not available or cannot be written, 881275970Scythe daemon exits with a message to the system log and the program 882275970Scyexits with a suitable error message. 883275970Scy.SS Cryptographic Data Files 884275970ScyAll other file formats begin with two lines. 885275970ScyThe first contains the file name, including the generated host name 886275970Scyand filestamp. 887275970ScyThe second contains the datestamp in conventional Unix date format. 888275970ScyLines beginning with # are considered comments and ignored by the 889275970Scy\f\*[B-Font]ntp-keygen\fP 890275970Scyprogram and 891285169Scy\fCntpd\f[]\fR(@NTPD_MS@)\f[] 892275970Scydaemon. 893275970ScyCryptographic values are encoded first using ASN.1 rules, 894275970Scythen encrypted if necessary, and finally written PEM-encoded 895275970Scyprintable ASCII format preceded and followed by MIME content identifier lines. 896275970Scy.sp \n(Ppu 897275970Scy.ne 2 898275970Scy 899275970ScyThe format of the symmetric keys file is somewhat different 900275970Scythan the other files in the interest of backward compatibility. 901275970ScySince DES-CBC is deprecated in NTPv4, the only key format of interest 902275970Scyis MD5 alphanumeric strings. 903275970ScyFollowing hte heard the keys are 904275970Scyentered one per line in the format 905275970Scy.in +4 906275970Scy\f\*[I-Font]keyno\f[] \f\*[I-Font]type\f[] \f\*[I-Font]key\f[] 907275970Scy.in -4 908275970Scywhere 909275970Scy\f\*[I-Font]keyno\f[] 910275970Scyis a positive integer in the range 1-65,535, 911275970Scy\f\*[I-Font]type\f[] 912275970Scyis the string MD5 defining the key format and 913275970Scy\f\*[I-Font]key\f[] 914275970Scyis the key itself, 915275970Scywhich is a printable ASCII string 16 characters or less in length. 916275970ScyEach character is chosen from the 93 printable characters 917275970Scyin the range 0x21 through 0x7f excluding space and the 918275970Scy\[oq]#\[cq] 919275970Scycharacter. 920275970Scy.sp \n(Ppu 921275970Scy.ne 2 922275970Scy 923275970ScyNote that the keys used by the 924285169Scy\fCntpq\f[]\fR(@NTPQ_MS@)\f[] 925275970Scyand 926285169Scy\fCntpdc\f[]\fR(@NTPDC_MS@)\f[] 927275970Scyprograms 928275970Scyare checked against passwords requested by the programs 929275970Scyand entered by hand, so it is generally appropriate to specify these keys 930275970Scyin human readable ASCII format. 931275970Scy.sp \n(Ppu 932275970Scy.ne 2 933275970Scy 934275970ScyThe 935275970Scy\f\*[B-Font]ntp-keygen\fP 936275970Scyprogram generates a MD5 symmetric keys file 937275970Scy\fIntpkey_MD5key_\f[]\f\*[I-Font]hostname.filestamp\f[]. 938275970ScySince the file contains private shared keys, 939275970Scyit should be visible only to root and distributed by secure means 940275970Scyto other subnet hosts. 941275970ScyThe NTP daemon loads the file 942275970Scy\fIntp.keys\f[], 943275970Scyso 944275970Scy\f\*[B-Font]ntp-keygen\fP 945275970Scyinstalls a soft link from this name to the generated file. 946275970ScySubsequently, similar soft links must be installed by manual 947275970Scyor automated means on the other subnet hosts. 948275970ScyWhile this file is not used with the Autokey Version 2 protocol, 949275970Scyit is needed to authenticate some remote configuration commands 950275970Scyused by the 951285169Scy\fCntpq\f[]\fR(@NTPQ_MS@)\f[] 952275970Scyand 953285169Scy\fCntpdc\f[]\fR(@NTPDC_MS@)\f[] 954275970Scyutilities. 955275970Scy.SH "OPTIONS" 956275970Scy.TP 957275970Scy.NOP \f\*[B-Font]\-b\f[] \f\*[I-Font]imbits\f[], \f\*[B-Font]\-\-imbits\f[]=\f\*[I-Font]imbits\f[] 958275970Scyidentity modulus bits. 959275970ScyThis option takes an integer number as its argument. 960275970ScyThe value of 961275970Scy\f\*[I-Font]imbits\f[] 962275970Scyis constrained to being: 963275970Scy.in +4 964275970Scy.nf 965275970Scy.na 966275970Scyin the range 256 through 2048 967275970Scy.fi 968275970Scy.in -4 969275970Scy.sp 970275970ScyThe number of bits in the identity modulus. The default is 256. 971275970Scy.TP 972275970Scy.NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]scheme\f[], \f\*[B-Font]\-\-certificate\f[]=\f\*[I-Font]scheme\f[] 973275970Scycertificate scheme. 974275970Scy.sp 975275970Scyscheme is one of 976275970ScyRSA-MD2, RSA-MD5, RSA-SHA, RSA-SHA1, RSA-MDC2, RSA-RIPEMD160, 977275970ScyDSA-SHA, or DSA-SHA1. 978275970Scy.sp 979275970ScySelect the certificate message digest/signature encryption scheme. 980275970ScyNote that RSA schemes must be used with a RSA sign key and DSA 981275970Scyschemes must be used with a DSA sign key. The default without 982275970Scythis option is RSA-MD5. 983275970Scy.TP 984275970Scy.NOP \f\*[B-Font]\-C\f[] \f\*[I-Font]cipher\f[], \f\*[B-Font]\-\-cipher\f[]=\f\*[I-Font]cipher\f[] 985275970Scyprivatekey cipher. 986275970Scy.sp 987275970ScySelect the cipher which is used to encrypt the files containing 988275970Scyprivate keys. The default is three-key triple DES in CBC mode, 989275970Scyequivalent to "@code{-C des-ede3-cbc". The openssl tool lists ciphers 990275970Scyavailable in "\fBopenssl \-h\fP" output. 991275970Scy.TP 992275970Scy.NOP \f\*[B-Font]\-d\f[], \f\*[B-Font]\-\-debug\-level\f[] 993275970ScyIncrease debug verbosity level. 994275970ScyThis option may appear an unlimited number of times. 995275970Scy.sp 996275970Scy.TP 997275970Scy.NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-set\-debug\-level\f[]=\f\*[I-Font]number\f[] 998275970ScySet the debug verbosity level. 999275970ScyThis option may appear an unlimited number of times. 1000275970ScyThis option takes an integer number as its argument. 1001275970Scy.sp 1002275970Scy.TP 1003275970Scy.NOP \f\*[B-Font]\-e\f[], \f\*[B-Font]\-\-id\-key\f[] 1004275970ScyWrite IFF or GQ identity keys. 1005275970Scy.sp 1006275970ScyWrite the IFF or GQ client keys to the standard output. This is 1007275970Scyintended for automatic key distribution by mail. 1008275970Scy.TP 1009275970Scy.NOP \f\*[B-Font]\-G\f[], \f\*[B-Font]\-\-gq\-params\f[] 1010275970ScyGenerate GQ parameters and keys. 1011275970Scy.sp 1012275970ScyGenerate parameters and keys for the GQ identification scheme, 1013275970Scyobsoleting any that may exist. 1014275970Scy.TP 1015275970Scy.NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-host\-key\f[] 1016275970Scygenerate RSA host key. 1017275970Scy.sp 1018275970ScyGenerate new host keys, obsoleting any that may exist. 1019275970Scy.TP 1020275970Scy.NOP \f\*[B-Font]\-I\f[], \f\*[B-Font]\-\-iffkey\f[] 1021275970Scygenerate IFF parameters. 1022275970Scy.sp 1023275970ScyGenerate parameters for the IFF identification scheme, obsoleting 1024275970Scyany that may exist. 1025275970Scy.TP 1026275970Scy.NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]group\f[], \f\*[B-Font]\-\-ident\f[]=\f\*[I-Font]group\f[] 1027275970Scyset Autokey group name. 1028275970Scy.sp 1029275970ScySet the optional Autokey group name to name. This is used in 1030275970Scythe file name of IFF, GQ, and MV client parameters files. In 1031275970Scythat role, the default is the host name if this option is not 1032275970Scyprovided. The group name, if specified using \fB-i/--ident\fP or 1033275970Scyusing \fB-s/--subject-name\fP following an '\fB@\fP' character, 1034275970Scyis also a part of the self-signed host certificate's subject and 1035275970Scyissuer names in the form \fBhost@group\fP and should match the 1036275970Scy'\fBcrypto ident\fP' or '\fBserver ident\fP' configuration in 1037275970Scy\fBntpd\fP's configuration file. 1038275970Scy.TP 1039275970Scy.NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]lifetime\f[], \f\*[B-Font]\-\-lifetime\f[]=\f\*[I-Font]lifetime\f[] 1040275970Scyset certificate lifetime. 1041275970ScyThis option takes an integer number as its argument. 1042275970Scy.sp 1043275970ScySet the certificate expiration to lifetime days from now. 1044275970Scy.TP 1045275970Scy.NOP \f\*[B-Font]\-M\f[], \f\*[B-Font]\-\-md5key\f[] 1046275970Scygenerate MD5 keys. 1047275970Scy.sp 1048275970ScyGenerate MD5 keys, obsoleting any that may exist. 1049275970Scy.TP 1050275970Scy.NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]modulus\f[], \f\*[B-Font]\-\-modulus\f[]=\f\*[I-Font]modulus\f[] 1051275970Scymodulus. 1052275970ScyThis option takes an integer number as its argument. 1053275970ScyThe value of 1054275970Scy\f\*[I-Font]modulus\f[] 1055275970Scyis constrained to being: 1056275970Scy.in +4 1057275970Scy.nf 1058275970Scy.na 1059275970Scyin the range 256 through 2048 1060275970Scy.fi 1061275970Scy.in -4 1062275970Scy.sp 1063275970ScyThe number of bits in the prime modulus. The default is 512. 1064275970Scy.TP 1065275970Scy.NOP \f\*[B-Font]\-P\f[], \f\*[B-Font]\-\-pvt\-cert\f[] 1066275970Scygenerate PC private certificate. 1067275970Scy.sp 1068275970ScyGenerate a private certificate. By default, the program generates 1069275970Scypublic certificates. 1070275970Scy.TP 1071275970Scy.NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]passwd\f[], \f\*[B-Font]\-\-password\f[]=\f\*[I-Font]passwd\f[] 1072275970Scylocal private password. 1073275970Scy.sp 1074275970ScyLocal files containing private data are encrypted with the 1075275970ScyDES-CBC algorithm and the specified password. The same password 1076275970Scymust be specified to the local ntpd via the "crypto pw password" 1077275970Scyconfiguration command. The default password is the local 1078275970Scyhostname. 1079275970Scy.TP 1080275970Scy.NOP \f\*[B-Font]\-q\f[] \f\*[I-Font]passwd\f[], \f\*[B-Font]\-\-export\-passwd\f[]=\f\*[I-Font]passwd\f[] 1081275970Scyexport IFF or GQ group keys with password. 1082275970Scy.sp 1083275970ScyExport IFF or GQ identity group keys to the standard output, 1084275970Scyencrypted with the DES-CBC algorithm and the specified password. 1085275970ScyThe same password must be specified to the remote ntpd via the 1086275970Scy"crypto pw password" configuration command. See also the option 1087275970Scy--id-key (-e) for unencrypted exports. 1088275970Scy.TP 1089275970Scy.NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]sign\f[], \f\*[B-Font]\-\-sign\-key\f[]=\f\*[I-Font]sign\f[] 1090275970Scygenerate sign key (RSA or DSA). 1091275970Scy.sp 1092275970ScyGenerate a new sign key of the designated type, obsoleting any 1093275970Scythat may exist. By default, the program uses the host key as the 1094275970Scysign key. 1095275970Scy.TP 1096275970Scy.NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]host@group\f[], \f\*[B-Font]\-\-subject\-name\f[]=\f\*[I-Font]host@group\f[] 1097275970Scyset host and optionally group name. 1098275970Scy.sp 1099275970ScySet the Autokey host name, and optionally, group name specified 1100275970Scyfollowing an '\fB@\fP' character. The host name is used in the file 1101275970Scyname of generated host and signing certificates, without the 1102275970Scygroup name. The host name, and if provided, group name are used 1103275970Scyin \fBhost@group\fP form for the host certificate's subject and issuer 1104275970Scyfields. Specifying '\fB-s @group\fP' is allowed, and results in 1105275970Scyleaving the host name unchanged while appending \fB@group\fP to the 1106275970Scysubject and issuer fields, as with \fB-i group\fP. The group name, or 1107275970Scyif not provided, the host name are also used in the file names 1108275970Scyof IFF, GQ, and MV client parameter files. 1109275970Scy.TP 1110275970Scy.NOP \f\*[B-Font]\-T\f[], \f\*[B-Font]\-\-trusted\-cert\f[] 1111275970Scytrusted certificate (TC scheme). 1112275970Scy.sp 1113275970ScyGenerate a trusted certificate. By default, the program generates 1114275970Scya non-trusted certificate. 1115275970Scy.TP 1116275970Scy.NOP \f\*[B-Font]\-V\f[] \f\*[I-Font]num\f[], \f\*[B-Font]\-\-mv\-params\f[]=\f\*[I-Font]num\f[] 1117275970Scygenerate <num> MV parameters. 1118275970ScyThis option takes an integer number as its argument. 1119275970Scy.sp 1120275970ScyGenerate parameters and keys for the Mu-Varadharajan (MV) 1121275970Scyidentification scheme. 1122275970Scy.TP 1123275970Scy.NOP \f\*[B-Font]\-v\f[] \f\*[I-Font]num\f[], \f\*[B-Font]\-\-mv\-keys\f[]=\f\*[I-Font]num\f[] 1124275970Scyupdate <num> MV keys. 1125275970ScyThis option takes an integer number as its argument. 1126275970Scy.sp 1127275970ScyThis option has not been fully documented. 1128275970Scy.TP 1129275970Scy.NOP \f\*[B-Font]\-\&?\f[], \f\*[B-Font]\-\-help\f[] 1130275970ScyDisplay usage information and exit. 1131275970Scy.TP 1132275970Scy.NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[] 1133275970ScyPass the extended usage information through a pager. 1134275970Scy.TP 1135275970Scy.NOP \f\*[B-Font]\->\f[] [\f\*[I-Font]cfgfile\f[]], \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]] 1136275970ScySave the option state to \fIcfgfile\fP. The default is the \fIlast\fP 1137275970Scyconfiguration file listed in the \fBOPTION PRESETS\fP section, below. 1138275970ScyThe command will exit after updating the config file. 1139275970Scy.TP 1140275970Scy.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[] 1141275970ScyLoad options from \fIcfgfile\fP. 1142275970ScyThe \fIno-load-opts\fP form will disable the loading 1143275970Scyof earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early, 1144275970Scyout of order. 1145275970Scy.TP 1146275970Scy.NOP \f\*[B-Font]\-\-version\f[] [{\f\*[I-Font]v|c|n\f[]}] 1147275970ScyOutput version of program and exit. The default mode is `v', a simple 1148275970Scyversion. The `c' mode will print copyright information and `n' will 1149275970Scyprint the full copyright notice. 1150275970Scy.PP 1151275970Scy.SH "OPTION PRESETS" 1152275970ScyAny option that is not marked as \fInot presettable\fP may be preset 1153275970Scyby loading values from configuration ("RC" or ".INI") file(s) and values from 1154275970Scyenvironment variables named: 1155275970Scy.nf 1156275970Scy \fBNTP_KEYGEN_<option-name>\fP or \fBNTP_KEYGEN\fP 1157275970Scy.fi 1158275970Scy.ad 1159275970ScyThe environmental presets take precedence (are processed later than) 1160275970Scythe configuration files. 1161275970ScyThe \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP". 1162275970ScyIf any of these are directories, then the file \fI.ntprc\fP 1163275970Scyis searched for within those directories. 1164275970Scy.SH USAGE 1165275970ScyThe 1166275970Scy\f\*[B-Font]\-p\f[] \f\*[I-Font]password\f[] 1167275970Scyoption specifies the write password and 1168275970Scy\f\*[B-Font]\-q\f[] \f\*[I-Font]password\f[] 1169275970Scyoption the read password for previously encrypted files. 1170275970ScyThe 1171275970Scy\f\*[B-Font]ntp-keygen\fP 1172275970Scyprogram prompts for the password if it reads an encrypted file 1173275970Scyand the password is missing or incorrect. 1174275970ScyIf an encrypted file is read successfully and 1175275970Scyno write password is specified, the read password is used 1176275970Scyas the write password by default. 1177275970Scy.SH "ENVIRONMENT" 1178275970ScySee \fBOPTION PRESETS\fP for configuration environment variables. 1179275970Scy.SH "FILES" 1180275970ScySee \fBOPTION PRESETS\fP for configuration files. 1181275970Scy.SH "EXIT STATUS" 1182275970ScyOne of the following exit values will be returned: 1183275970Scy.TP 1184275970Scy.NOP 0 " (EXIT_SUCCESS)" 1185275970ScySuccessful program execution. 1186275970Scy.TP 1187275970Scy.NOP 1 " (EXIT_FAILURE)" 1188275970ScyThe operation failed or the command syntax was not valid. 1189275970Scy.TP 1190275970Scy.NOP 66 " (EX_NOINPUT)" 1191275970ScyA specified configuration file could not be loaded. 1192275970Scy.TP 1193275970Scy.NOP 70 " (EX_SOFTWARE)" 1194275970Scylibopts had an internal operational error. Please report 1195275970Scyit to autogen-users@lists.sourceforge.net. Thank you. 1196275970Scy.PP 1197275970Scy.SH "AUTHORS" 1198280849ScyThe University of Delaware and Network Time Foundation 1199275970Scy.SH "COPYRIGHT" 1200280849ScyCopyright (C) 1992-2015 The University of Delaware and Network Time Foundation all rights reserved. 1201275970ScyThis program is released under the terms of the NTP license, <http://ntp.org/license>. 1202275970Scy.SH BUGS 1203275970ScyIt can take quite a while to generate some cryptographic values, 1204275970Scyfrom one to several minutes with modern architectures 1205275970Scysuch as UltraSPARC and up to tens of minutes to an hour 1206275970Scywith older architectures such as SPARC IPC. 1207275970Scy.sp \n(Ppu 1208275970Scy.ne 2 1209275970Scy 1210275970ScyPlease report bugs to http://bugs.ntp.org . 1211275970Scy.sp \n(Ppu 1212275970Scy.ne 2 1213275970Scy 1214275970ScyPlease send bug reports to: http://bugs.ntp.org, bugs@ntp.org 1215275970Scy.SH NOTES 1216275970ScyPortions of this document came from FreeBSD. 1217275970Scy.sp \n(Ppu 1218275970Scy.ne 2 1219275970Scy 1220275970ScyThis manual page was \fIAutoGen\fP-erated from the \fBntp-keygen\fP 1221275970Scyoption definitions. 1222