Annotation of src/usr.bin/ssh/ssh-keygen.1, Revision 1.210
1.210 ! dtucker 1: .\" $OpenBSD: ssh-keygen.1,v 1.209 2020/09/09 03:08:01 djm Exp $
1.1 deraadt 2: .\"
3: .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4: .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5: .\" All rights reserved
6: .\"
1.22 deraadt 7: .\" As far as I am concerned, the code I have written for this software
8: .\" can be used freely for any purpose. Any derived versions of this
9: .\" software must be clearly marked as such, and if the derived work is
10: .\" incompatible with the protocol description in the RFC file, it must be
11: .\" called by a name other than "ssh" or "Secure Shell".
12: .\"
13: .\"
1.33 deraadt 14: .\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
15: .\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
16: .\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
1.22 deraadt 17: .\"
18: .\" Redistribution and use in source and binary forms, with or without
19: .\" modification, are permitted provided that the following conditions
20: .\" are met:
21: .\" 1. Redistributions of source code must retain the above copyright
22: .\" notice, this list of conditions and the following disclaimer.
23: .\" 2. Redistributions in binary form must reproduce the above copyright
24: .\" notice, this list of conditions and the following disclaimer in the
25: .\" documentation and/or other materials provided with the distribution.
1.1 deraadt 26: .\"
1.22 deraadt 27: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
28: .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29: .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30: .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
31: .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32: .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33: .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34: .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36: .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.1 deraadt 37: .\"
1.210 ! dtucker 38: .Dd $Mdocdate: September 9 2020 $
1.2 deraadt 39: .Dt SSH-KEYGEN 1
40: .Os
41: .Sh NAME
42: .Nm ssh-keygen
1.179 jmc 43: .Nd OpenSSH authentication key utility
1.2 deraadt 44: .Sh SYNOPSIS
45: .Nm ssh-keygen
1.25 markus 46: .Op Fl q
1.205 solene 47: .Op Fl a Ar rounds
1.2 deraadt 48: .Op Fl b Ar bits
49: .Op Fl C Ar comment
1.20 markus 50: .Op Fl f Ar output_keyfile
1.155 djm 51: .Op Fl m Ar format
1.171 jmc 52: .Op Fl N Ar new_passphrase
1.191 naddy 53: .Op Fl O Ar option
1.205 solene 54: .Op Fl t Cm dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
1.173 naddy 55: .Op Fl w Ar provider
1.2 deraadt 56: .Nm ssh-keygen
57: .Fl p
1.205 solene 58: .Op Fl a Ar rounds
1.9 markus 59: .Op Fl f Ar keyfile
1.155 djm 60: .Op Fl m Ar format
1.171 jmc 61: .Op Fl N Ar new_passphrase
62: .Op Fl P Ar old_passphrase
1.2 deraadt 63: .Nm ssh-keygen
1.37 markus 64: .Fl i
1.171 jmc 65: .Op Fl f Ar input_keyfile
1.95 djm 66: .Op Fl m Ar key_format
1.16 deraadt 67: .Nm ssh-keygen
1.37 markus 68: .Fl e
1.171 jmc 69: .Op Fl f Ar input_keyfile
1.95 djm 70: .Op Fl m Ar key_format
1.16 deraadt 71: .Nm ssh-keygen
1.17 markus 72: .Fl y
1.20 markus 73: .Op Fl f Ar input_keyfile
1.17 markus 74: .Nm ssh-keygen
1.2 deraadt 75: .Fl c
1.205 solene 76: .Op Fl a Ar rounds
1.2 deraadt 77: .Op Fl C Ar comment
1.9 markus 78: .Op Fl f Ar keyfile
1.171 jmc 79: .Op Fl P Ar passphrase
1.9 markus 80: .Nm ssh-keygen
81: .Fl l
1.125 naddy 82: .Op Fl v
1.124 djm 83: .Op Fl E Ar fingerprint_hash
1.35 markus 84: .Op Fl f Ar input_keyfile
85: .Nm ssh-keygen
86: .Fl B
1.20 markus 87: .Op Fl f Ar input_keyfile
1.48 jakob 88: .Nm ssh-keygen
1.82 jmc 89: .Fl D Ar pkcs11
1.48 jakob 90: .Nm ssh-keygen
1.64 djm 91: .Fl F Ar hostname
1.170 jmc 92: .Op Fl lv
1.64 djm 93: .Op Fl f Ar known_hosts_file
94: .Nm ssh-keygen
95: .Fl H
96: .Op Fl f Ar known_hosts_file
97: .Nm ssh-keygen
1.187 djm 98: .Fl K
1.205 solene 99: .Op Fl a Ar rounds
1.187 djm 100: .Op Fl w Ar provider
101: .Nm ssh-keygen
1.64 djm 102: .Fl R Ar hostname
103: .Op Fl f Ar known_hosts_file
1.57 jakob 104: .Nm ssh-keygen
105: .Fl r Ar hostname
1.170 jmc 106: .Op Fl g
1.57 jakob 107: .Op Fl f Ar input_keyfile
1.60 djm 108: .Nm ssh-keygen
1.184 djm 109: .Fl M Cm generate
110: .Op Fl O Ar option
1.191 naddy 111: .Ar output_file
1.60 djm 112: .Nm ssh-keygen
1.184 djm 113: .Fl M Cm screen
1.191 naddy 114: .Op Fl f Ar input_file
1.184 djm 115: .Op Fl O Ar option
1.191 naddy 116: .Ar output_file
1.84 djm 117: .Nm ssh-keygen
1.171 jmc 118: .Fl I Ar certificate_identity
1.84 djm 119: .Fl s Ar ca_key
1.170 jmc 120: .Op Fl hU
1.142 djm 121: .Op Fl D Ar pkcs11_provider
1.84 djm 122: .Op Fl n Ar principals
1.93 djm 123: .Op Fl O Ar option
1.84 djm 124: .Op Fl V Ar validity_interval
1.93 djm 125: .Op Fl z Ar serial_number
1.84 djm 126: .Ar
1.86 djm 127: .Nm ssh-keygen
128: .Fl L
129: .Op Fl f Ar input_keyfile
1.102 stevesk 130: .Nm ssh-keygen
131: .Fl A
1.205 solene 132: .Op Fl a Ar rounds
1.143 djm 133: .Op Fl f Ar prefix_path
1.111 djm 134: .Nm ssh-keygen
135: .Fl k
136: .Fl f Ar krl_file
137: .Op Fl u
1.112 jmc 138: .Op Fl s Ar ca_public
139: .Op Fl z Ar version_number
1.111 djm 140: .Ar
141: .Nm ssh-keygen
142: .Fl Q
1.203 djm 143: .Op Fl l
1.111 djm 144: .Fl f Ar krl_file
145: .Ar
1.163 djm 146: .Nm ssh-keygen
1.196 djm 147: .Fl Y Cm find-principals
1.194 djm 148: .Fl s Ar signature_file
149: .Fl f Ar allowed_signers_file
150: .Nm ssh-keygen
1.171 jmc 151: .Fl Y Cm check-novalidate
152: .Fl n Ar namespace
153: .Fl s Ar signature_file
154: .Nm ssh-keygen
1.163 djm 155: .Fl Y Cm sign
156: .Fl f Ar key_file
157: .Fl n Ar namespace
158: .Ar
159: .Nm ssh-keygen
160: .Fl Y Cm verify
1.171 jmc 161: .Fl f Ar allowed_signers_file
1.163 djm 162: .Fl I Ar signer_identity
163: .Fl n Ar namespace
164: .Fl s Ar signature_file
165: .Op Fl r Ar revocation_file
1.13 aaron 166: .Sh DESCRIPTION
1.2 deraadt 167: .Nm
1.37 markus 168: generates, manages and converts authentication keys for
1.2 deraadt 169: .Xr ssh 1 .
1.15 deraadt 170: .Nm
1.140 jmc 171: can create keys for use by SSH protocol version 2.
1.130 jmc 172: .Pp
1.58 jmc 173: The type of key to be generated is specified with the
1.25 markus 174: .Fl t
1.52 djm 175: option.
1.70 djm 176: If invoked without any arguments,
177: .Nm
1.141 naddy 178: will generate an RSA key.
1.15 deraadt 179: .Pp
1.60 djm 180: .Nm
181: is also used to generate groups for use in Diffie-Hellman group
182: exchange (DH-GEX).
183: See the
184: .Sx MODULI GENERATION
185: section for details.
186: .Pp
1.111 djm 187: Finally,
188: .Nm
189: can be used to generate and update Key Revocation Lists, and to test whether
1.112 jmc 190: given keys have been revoked by one.
191: See the
1.111 djm 192: .Sx KEY REVOCATION LISTS
193: section for details.
194: .Pp
1.2 deraadt 195: Normally each user wishing to use SSH
1.99 djm 196: with public key authentication runs this once to create the authentication
1.1 deraadt 197: key in
1.118 naddy 198: .Pa ~/.ssh/id_dsa ,
1.99 djm 199: .Pa ~/.ssh/id_ecdsa ,
1.173 naddy 200: .Pa ~/.ssh/id_ecdsa_sk ,
1.176 naddy 201: .Pa ~/.ssh/id_ed25519 ,
202: .Pa ~/.ssh/id_ed25519_sk
1.15 deraadt 203: or
1.68 djm 204: .Pa ~/.ssh/id_rsa .
1.15 deraadt 205: Additionally, the system administrator may use this to generate host keys,
206: as seen in
207: .Pa /etc/rc .
1.2 deraadt 208: .Pp
1.1 deraadt 209: Normally this program generates the key and asks for a file in which
1.12 aaron 210: to store the private key.
211: The public key is stored in a file with the same name but
1.2 deraadt 212: .Dq .pub
1.12 aaron 213: appended.
214: The program also asks for a passphrase.
215: The passphrase may be empty to indicate no passphrase
1.26 markus 216: (host keys must have an empty passphrase), or it may be a string of
1.12 aaron 217: arbitrary length.
1.51 stevesk 218: A passphrase is similar to a password, except it can be a phrase with a
219: series of words, punctuation, numbers, whitespace, or any string of
220: characters you want.
221: Good passphrases are 10-30 characters long, are
1.1 deraadt 222: not simple sentences or otherwise easily guessable (English
1.42 markus 223: prose has only 1-2 bits of entropy per character, and provides very bad
1.51 stevesk 224: passphrases), and contain a mix of upper and lowercase letters,
225: numbers, and non-alphanumeric characters.
1.12 aaron 226: The passphrase can be changed later by using the
1.2 deraadt 227: .Fl p
1.1 deraadt 228: option.
1.2 deraadt 229: .Pp
1.12 aaron 230: There is no way to recover a lost passphrase.
1.105 djm 231: If the passphrase is lost or forgotten, a new key must be generated
232: and the corresponding public key copied to other machines.
1.2 deraadt 233: .Pp
1.153 djm 234: .Nm
235: will by default write keys in an OpenSSH-specific format.
236: This format is preferred as it offers better protection for
237: keys at rest as well as allowing storage of key comments within
238: the private key file itself.
239: The key comment may be useful to help identify the key.
1.12 aaron 240: The comment is initialized to
1.2 deraadt 241: .Dq user@host
242: when the key is created, but can be changed using the
243: .Fl c
1.1 deraadt 244: option.
1.153 djm 245: .Pp
246: It is still possible for
247: .Nm
248: to write the previously-used PEM format private keys using the
249: .Fl m
250: flag.
251: This may be used when generating new keys, and existing new-format
252: keys may be converted using this option in conjunction with the
253: .Fl p
254: (change passphrase) flag.
1.2 deraadt 255: .Pp
1.205 solene 256: After a key is generated,
257: .Nm
258: will ask where the keys
1.15 deraadt 259: should be placed to be activated.
260: .Pp
1.2 deraadt 261: The options are as follows:
262: .Bl -tag -width Ds
1.102 stevesk 263: .It Fl A
1.175 djm 264: For each of the key types (rsa, dsa, ecdsa and ed25519)
1.118 naddy 265: for which host keys
1.102 stevesk 266: do not exist, generate the host keys with the default key file path,
267: an empty passphrase, default bits for the key type, and default comment.
1.144 jmc 268: If
1.143 djm 269: .Fl f
1.144 jmc 270: has also been specified, its argument is used as a prefix to the
1.143 djm 271: default path for the resulting host key files.
1.104 jmc 272: This is used by
1.102 stevesk 273: .Pa /etc/rc
274: to generate new host keys.
1.117 djm 275: .It Fl a Ar rounds
1.169 jmc 276: When saving a private key, this option specifies the number of KDF
1.148 djm 277: (key derivation function) rounds used.
1.117 djm 278: Higher numbers result in slower passphrase verification and increased
279: resistance to brute-force password cracking (should the keys be stolen).
1.204 dtucker 280: The default is 16 rounds.
1.66 jmc 281: .It Fl B
282: Show the bubblebabble digest of specified private or public key file.
1.2 deraadt 283: .It Fl b Ar bits
1.12 aaron 284: Specifies the number of bits in the key to create.
1.158 dtucker 285: For RSA keys, the minimum size is 1024 bits and the default is 3072 bits.
286: Generally, 3072 bits is considered sufficient.
1.72 dtucker 287: DSA keys must be exactly 1024 bits as specified by FIPS 186-2.
1.106 djm 288: For ECDSA keys, the
289: .Fl b
1.107 deraadt 290: flag determines the key length by selecting from one of three elliptic
1.106 djm 291: curve sizes: 256, 384 or 521 bits.
292: Attempting to use bit lengths other than these three values for ECDSA keys
293: will fail.
1.176 naddy 294: ECDSA-SK, Ed25519 and Ed25519-SK keys have a fixed length and the
1.118 naddy 295: .Fl b
296: flag will be ignored.
1.66 jmc 297: .It Fl C Ar comment
298: Provides a new comment.
1.2 deraadt 299: .It Fl c
1.1 deraadt 300: Requests changing the comment in the private and public key files.
301: The program will prompt for the file containing the private keys, for
1.41 stevesk 302: the passphrase if the key has one, and for the new comment.
1.81 markus 303: .It Fl D Ar pkcs11
1.157 naddy 304: Download the public keys provided by the PKCS#11 shared library
1.83 markus 305: .Ar pkcs11 .
1.98 djm 306: When used in combination with
307: .Fl s ,
308: this option indicates that a CA key resides in a PKCS#11 token (see the
309: .Sx CERTIFICATES
310: section for details).
1.124 djm 311: .It Fl E Ar fingerprint_hash
312: Specifies the hash algorithm used when displaying key fingerprints.
313: Valid options are:
314: .Dq md5
315: and
316: .Dq sha256 .
317: The default is
318: .Dq sha256 .
1.37 markus 319: .It Fl e
1.40 markus 320: This option will read a private or public OpenSSH key file and
1.154 djm 321: print to stdout a public key in one of the formats specified by the
1.95 djm 322: .Fl m
323: option.
324: The default export format is
325: .Dq RFC4716 .
1.96 jmc 326: This option allows exporting OpenSSH keys for use by other programs, including
1.95 djm 327: several commercial SSH implementations.
1.151 djm 328: .It Fl F Ar hostname | [hostname]:port
1.66 jmc 329: Search for the specified
330: .Ar hostname
1.151 djm 331: (with optional port number)
1.66 jmc 332: in a
333: .Pa known_hosts
334: file, listing any occurrences found.
335: This option is useful to find hashed host names or addresses and may also be
336: used in conjunction with the
337: .Fl H
338: option to print found keys in a hashed format.
339: .It Fl f Ar filename
340: Specifies the filename of the key file.
1.57 jakob 341: .It Fl g
1.62 jakob 342: Use generic DNS format when printing fingerprint resource records using the
1.63 jmc 343: .Fl r
1.62 jakob 344: command.
1.66 jmc 345: .It Fl H
346: Hash a
347: .Pa known_hosts
1.67 dtucker 348: file.
349: This replaces all hostnames and addresses with hashed representations
350: within the specified file; the original content is moved to a file with
351: a .old suffix.
1.66 jmc 352: These hashes may be used normally by
353: .Nm ssh
354: and
355: .Nm sshd ,
356: but they do not reveal identifying information should the file's contents
357: be disclosed.
358: This option will not modify existing hashed hostnames and is therefore safe
359: to use on files that mix hashed and non-hashed names.
1.84 djm 360: .It Fl h
361: When signing a key, create a host certificate instead of a user
362: certificate.
363: Please see the
364: .Sx CERTIFICATES
365: section for details.
1.85 jmc 366: .It Fl I Ar certificate_identity
1.84 djm 367: Specify the key identity when signing a public key.
368: Please see the
369: .Sx CERTIFICATES
370: section for details.
1.37 markus 371: .It Fl i
372: This option will read an unencrypted private (or public) key file
1.95 djm 373: in the format specified by the
374: .Fl m
375: option and print an OpenSSH compatible private
1.37 markus 376: (or public) key to stdout.
1.122 jmc 377: This option allows importing keys from other software, including several
378: commercial SSH implementations.
379: The default import format is
380: .Dq RFC4716 .
1.188 jmc 381: .It Fl K
1.187 djm 382: Download resident keys from a FIDO authenticator.
383: Public and private key files will be written to the current directory for
384: each downloaded key.
1.207 djm 385: If multiple FIDO authenticators are attached, keys will be downloaded from
386: the first touched authenticator.
1.111 djm 387: .It Fl k
388: Generate a KRL file.
389: In this mode,
390: .Nm
391: will generate a KRL file at the location specified via the
392: .Fl f
1.114 jmc 393: flag that revokes every key or certificate presented on the command line.
1.111 djm 394: Keys/certificates to be revoked may be specified by public key file or
395: using the format described in the
396: .Sx KEY REVOCATION LISTS
397: section.
1.86 djm 398: .It Fl L
1.129 djm 399: Prints the contents of one or more certificates.
1.9 markus 400: .It Fl l
1.77 grunk 401: Show fingerprint of specified public key file.
1.50 markus 402: For RSA and DSA keys
403: .Nm
1.78 jmc 404: tries to find the matching public key file and prints its fingerprint.
405: If combined with
406: .Fl v ,
1.132 jmc 407: a visual ASCII art representation of the key is supplied with the
1.131 djm 408: fingerprint.
1.184 djm 409: .It Fl M Cm generate
410: Generate candidate Diffie-Hellman Group Exchange (DH-GEX) parameters for
411: eventual use by the
412: .Sq diffie-hellman-group-exchange-*
413: key exchange methods.
414: The numbers generated by this operation must be further screened before
415: use.
416: See the
417: .Sx MODULI GENERATION
418: section for more information.
419: .It Fl M Cm screen
420: Screen candidate parameters for Diffie-Hellman Group Exchange.
421: This will accept a list of candidate numbers and test that they are
422: safe (Sophie Germain) primes with acceptable group generators.
423: The results of this operation may be added to the
424: .Pa /etc/moduli
425: file.
426: See the
427: .Sx MODULI GENERATION
428: section for more information.
1.95 djm 429: .It Fl m Ar key_format
1.155 djm 430: Specify a key format for key generation, the
1.95 djm 431: .Fl i
1.155 djm 432: (import),
1.95 djm 433: .Fl e
1.155 djm 434: (export) conversion options, and the
435: .Fl p
436: change passphrase operation.
437: The latter may be used to convert between OpenSSH private key and PEM
438: private key formats.
1.95 djm 439: The supported key formats are:
440: .Dq RFC4716
1.96 jmc 441: (RFC 4716/SSH2 public or private key),
1.95 djm 442: .Dq PKCS8
1.161 djm 443: (PKCS8 public or private key)
1.95 djm 444: or
445: .Dq PEM
446: (PEM public key).
1.161 djm 447: By default OpenSSH will write newly-generated private keys in its own
448: format, but when converting public keys for export the default format is
1.95 djm 449: .Dq RFC4716 .
1.148 djm 450: Setting a format of
451: .Dq PEM
452: when generating or updating a supported private key type will cause the
453: key to be stored in the legacy PEM private key format.
1.66 jmc 454: .It Fl N Ar new_passphrase
455: Provides the new passphrase.
1.84 djm 456: .It Fl n Ar principals
457: Specify one or more principals (user or host names) to be included in
458: a certificate when signing a key.
459: Multiple principals may be specified, separated by commas.
460: Please see the
461: .Sx CERTIFICATES
462: section for details.
1.93 djm 463: .It Fl O Ar option
1.184 djm 464: Specify a key/value option.
465: These are specific to the operation that
466: .Nm
467: has been requested to perform.
468: .Pp
469: When signing certificates, one of the options listed in the
1.183 djm 470: .Sx CERTIFICATES
1.184 djm 471: section may be specified here.
472: .Pp
473: When performing moduli generation or screening, one of the options
474: listed in the
475: .Sx MODULI GENERATION
476: section may be specified.
477: .Pp
1.190 jmc 478: When generating a key that will be hosted on a FIDO authenticator,
479: this flag may be used to specify key-specific options.
480: Those supported at present are:
481: .Bl -tag -width Ds
482: .It Cm application
483: Override the default FIDO application/origin string of
1.189 djm 484: .Dq ssh: .
1.190 jmc 485: This may be useful when generating host or domain-specific resident keys.
1.200 djm 486: The specified application string must begin with
487: .Dq ssh: .
1.199 jmc 488: .It Cm challenge Ns = Ns Ar path
1.198 jmc 489: Specifies a path to a challenge string that will be passed to the
490: FIDO token during key generation.
1.199 jmc 491: The challenge string may be used as part of an out-of-band
492: protocol for key enrollment
493: (a random challenge is used by default).
1.190 jmc 494: .It Cm device
495: Explicitly specify a
1.189 djm 496: .Xr fido 4
497: device to use, rather than letting the token middleware select one.
1.190 jmc 498: .It Cm no-touch-required
499: Indicate that the generated private key should not require touch
1.185 djm 500: events (user presence) when making signatures.
501: Note that
502: .Xr sshd 8
503: will refuse such signatures by default, unless overridden via
504: an authorized_keys option.
1.190 jmc 505: .It Cm resident
506: Indicate that the key should be stored on the FIDO authenticator itself.
1.185 djm 507: Resident keys may be supported on FIDO2 tokens and typically require that
508: a PIN be set on the token prior to generation.
509: Resident keys may be loaded off the token using
510: .Xr ssh-add 1 .
1.190 jmc 511: .It Cm user
512: A username to be associated with a resident key,
1.189 djm 513: overriding the empty default username.
514: Specifying a username may be useful when generating multiple resident keys
515: for the same application name.
1.206 djm 516: .It Cm verify-required
517: Indicate that this private key should require user verification for
518: each signature.
1.208 jmc 519: Not all FIDO tokens support this option.
1.206 djm 520: Currently PIN authentication is the only supported verification method,
521: but other methods may be supported in the future.
1.199 jmc 522: .It Cm write-attestation Ns = Ns Ar path
1.209 djm 523: May be used at key generation time to record the attestation data
1.197 djm 524: returned from FIDO tokens during key generation.
1.209 djm 525: Please note that this information is potentially sensitive.
526: By default, this information is discarded.
1.190 jmc 527: .El
1.185 djm 528: .Pp
529: The
530: .Fl O
531: option may be specified multiple times.
1.66 jmc 532: .It Fl P Ar passphrase
533: Provides the (old) passphrase.
1.2 deraadt 534: .It Fl p
1.1 deraadt 535: Requests changing the passphrase of a private key file instead of
1.12 aaron 536: creating a new private key.
537: The program will prompt for the file
1.1 deraadt 538: containing the private key, for the old passphrase, and twice for the
539: new passphrase.
1.113 jmc 540: .It Fl Q
541: Test whether keys have been revoked in a KRL.
1.203 djm 542: If the
543: .Fl l
544: option is also specified then the contents of the KRL will be printed.
1.5 aaron 545: .It Fl q
546: Silence
547: .Nm ssh-keygen .
1.152 djm 548: .It Fl R Ar hostname | [hostname]:port
1.151 djm 549: Removes all keys belonging to the specified
1.64 djm 550: .Ar hostname
1.151 djm 551: (with optional port number)
1.65 jmc 552: from a
1.64 djm 553: .Pa known_hosts
554: file.
1.65 jmc 555: This option is useful to delete hashed hosts (see the
1.64 djm 556: .Fl H
557: option above).
1.66 jmc 558: .It Fl r Ar hostname
559: Print the SSHFP fingerprint resource record named
560: .Ar hostname
561: for the specified public key file.
1.84 djm 562: .It Fl s Ar ca_key
563: Certify (sign) a public key using the specified CA key.
564: Please see the
565: .Sx CERTIFICATES
566: section for details.
1.111 djm 567: .Pp
568: When generating a KRL,
569: .Fl s
1.112 jmc 570: specifies a path to a CA public key file used to revoke certificates directly
1.111 djm 571: by key ID or serial number.
572: See the
573: .Sx KEY REVOCATION LISTS
574: section for details.
1.175 djm 575: .It Fl t Cm dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
1.66 jmc 576: Specifies the type of key to create.
577: The possible values are
1.100 naddy 578: .Dq dsa ,
1.118 naddy 579: .Dq ecdsa ,
1.173 naddy 580: .Dq ecdsa-sk ,
1.118 naddy 581: .Dq ed25519 ,
1.175 djm 582: .Dq ed25519-sk ,
1.100 naddy 583: or
1.139 jmc 584: .Dq rsa .
1.159 djm 585: .Pp
586: This flag may also be used to specify the desired signature type when
1.160 jmc 587: signing certificates using an RSA CA key.
1.159 djm 588: The available RSA signature variants are
589: .Dq ssh-rsa
590: (SHA1 signatures, not recommended),
1.160 jmc 591: .Dq rsa-sha2-256 ,
592: and
1.159 djm 593: .Dq rsa-sha2-512
594: (the default).
1.142 djm 595: .It Fl U
596: When used in combination with
597: .Fl s ,
598: this option indicates that a CA key resides in a
599: .Xr ssh-agent 1 .
600: See the
601: .Sx CERTIFICATES
602: section for more information.
1.112 jmc 603: .It Fl u
604: Update a KRL.
605: When specified with
606: .Fl k ,
1.114 jmc 607: keys listed via the command line are added to the existing KRL rather than
1.112 jmc 608: a new KRL being created.
1.84 djm 609: .It Fl V Ar validity_interval
610: Specify a validity interval when signing a certificate.
611: A validity interval may consist of a single time, indicating that the
612: certificate is valid beginning now and expiring at that time, or may consist
613: of two times separated by a colon to indicate an explicit time interval.
1.145 djm 614: .Pp
615: The start time may be specified as the string
616: .Dq always
617: to indicate the certificate has no specified start time,
1.147 djm 618: a date in YYYYMMDD format, a time in YYYYMMDDHHMM[SS] format,
1.145 djm 619: a relative time (to the current time) consisting of a minus sign followed by
620: an interval in the format described in the
1.116 jmc 621: TIME FORMATS section of
1.90 jmc 622: .Xr sshd_config 5 .
1.145 djm 623: .Pp
1.147 djm 624: The end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMM[SS] time,
1.145 djm 625: a relative time starting with a plus character or the string
626: .Dq forever
1.202 dtucker 627: to indicate that the certificate has no expiry date.
1.84 djm 628: .Pp
629: For example:
630: .Dq +52w1d
631: (valid from now to 52 weeks and one day from now),
632: .Dq -4w:+4w
633: (valid from four weeks ago to four weeks from now),
634: .Dq 20100101123000:20110101123000
635: (valid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011),
636: .Dq -1d:20110101
1.210 ! dtucker 637: (valid from yesterday to midnight, January 1st, 2011),
1.145 djm 638: .Dq -1m:forever
639: (valid from one minute ago and never expiring).
1.61 djm 640: .It Fl v
641: Verbose mode.
642: Causes
643: .Nm
644: to print debugging messages about its progress.
645: This is helpful for debugging moduli generation.
646: Multiple
647: .Fl v
648: options increase the verbosity.
649: The maximum is 3.
1.173 naddy 650: .It Fl w Ar provider
1.180 naddy 651: Specifies a path to a library that will be used when creating
652: FIDO authenticator-hosted keys, overriding the default of using
653: the internal USB HID support.
1.196 djm 654: .It Fl Y Cm find-principals
655: Find the principal(s) associated with the public key of a signature,
1.194 djm 656: provided using the
657: .Fl s
658: flag in an authorized signers file provided using the
659: .Fl f
660: flag.
661: The format of the allowed signers file is documented in the
662: .Sx ALLOWED SIGNERS
1.195 jmc 663: section below.
1.196 djm 664: If one or more matching principals are found, they are returned on
665: standard output.
1.182 jmc 666: .It Fl Y Cm check-novalidate
667: Checks that a signature generated using
668: .Nm
669: .Fl Y Cm sign
670: has a valid structure.
671: This does not validate if a signature comes from an authorized signer.
672: When testing a signature,
673: .Nm
674: accepts a message on standard input and a signature namespace using
675: .Fl n .
676: A file containing the corresponding signature must also be supplied using the
677: .Fl s
678: flag.
679: Successful testing of the signature is signalled by
680: .Nm
681: returning a zero exit status.
1.166 jmc 682: .It Fl Y Cm sign
1.163 djm 683: Cryptographically sign a file or some data using a SSH key.
684: When signing,
685: .Nm
686: accepts zero or more files to sign on the command-line - if no files
687: are specified then
688: .Nm
689: will sign data presented on standard input.
690: Signatures are written to the path of the input file with
691: .Dq .sig
692: appended, or to standard output if the message to be signed was read from
693: standard input.
694: .Pp
695: The key used for signing is specified using the
696: .Fl f
697: option and may refer to either a private key, or a public key with the private
698: half available via
699: .Xr ssh-agent 1 .
700: An additional signature namespace, used to prevent signature confusion across
701: different domains of use (e.g. file signing vs email signing) must be provided
702: via the
703: .Fl n
704: flag.
705: Namespaces are arbitrary strings, and may include:
706: .Dq file
707: for file signing,
708: .Dq email
709: for email signing.
710: For custom uses, it is recommended to use names following a
711: NAMESPACE@YOUR.DOMAIN pattern to generate unambiguous namespaces.
1.166 jmc 712: .It Fl Y Cm verify
1.163 djm 713: Request to verify a signature generated using
714: .Nm
1.166 jmc 715: .Fl Y Cm sign
1.163 djm 716: as described above.
717: When verifying a signature,
718: .Nm
719: accepts a message on standard input and a signature namespace using
720: .Fl n .
721: A file containing the corresponding signature must also be supplied using the
722: .Fl s
723: flag, along with the identity of the signer using
724: .Fl I
725: and a list of allowed signers via the
726: .Fl f
727: flag.
728: The format of the allowed signers file is documented in the
729: .Sx ALLOWED SIGNERS
730: section below.
731: A file containing revoked keys can be passed using the
732: .Fl r
1.165 jmc 733: flag.
734: The revocation file may be a KRL or a one-per-line list of public keys.
1.163 djm 735: Successful verification by an authorized signer is signalled by
736: .Nm
737: returning a zero exit status.
1.181 jmc 738: .It Fl y
739: This option will read a private
740: OpenSSH format file and print an OpenSSH public key to stdout.
1.93 djm 741: .It Fl z Ar serial_number
742: Specifies a serial number to be embedded in the certificate to distinguish
743: this certificate from others from the same CA.
1.156 djm 744: If the
745: .Ar serial_number
746: is prefixed with a
747: .Sq +
748: character, then the serial number will be incremented for each certificate
749: signed on a single command-line.
1.93 djm 750: The default serial number is zero.
1.111 djm 751: .Pp
752: When generating a KRL, the
753: .Fl z
754: flag is used to specify a KRL version number.
1.2 deraadt 755: .El
1.60 djm 756: .Sh MODULI GENERATION
757: .Nm
758: may be used to generate groups for the Diffie-Hellman Group Exchange
759: (DH-GEX) protocol.
760: Generating these groups is a two-step process: first, candidate
761: primes are generated using a fast, but memory intensive process.
762: These candidate primes are then tested for suitability (a CPU-intensive
763: process).
764: .Pp
765: Generation of primes is performed using the
1.184 djm 766: .Fl M Cm generate
1.60 djm 767: option.
768: The desired length of the primes may be specified by the
1.184 djm 769: .Fl O Cm bits
1.60 djm 770: option.
771: For example:
772: .Pp
1.184 djm 773: .Dl # ssh-keygen -M generate -O bits=2048 moduli-2048.candidates
1.60 djm 774: .Pp
775: By default, the search for primes begins at a random point in the
776: desired length range.
777: This may be overridden using the
1.184 djm 778: .Fl O Cm start
1.60 djm 779: option, which specifies a different start point (in hex).
780: .Pp
1.109 dtucker 781: Once a set of candidates have been generated, they must be screened for
1.60 djm 782: suitability.
783: This may be performed using the
1.184 djm 784: .Fl M Cm screen
1.60 djm 785: option.
786: In this mode
787: .Nm
788: will read candidates from standard input (or a file specified using the
789: .Fl f
790: option).
791: For example:
792: .Pp
1.184 djm 793: .Dl # ssh-keygen -M screen -f moduli-2048.candidates moduli-2048
1.60 djm 794: .Pp
795: By default, each candidate will be subjected to 100 primality tests.
796: This may be overridden using the
1.184 djm 797: .Fl O Cm prime-tests
1.60 djm 798: option.
799: The DH generator value will be chosen automatically for the
800: prime under consideration.
801: If a specific generator is desired, it may be requested using the
1.184 djm 802: .Fl O Cm generator
1.60 djm 803: option.
1.66 jmc 804: Valid generator values are 2, 3, and 5.
1.60 djm 805: .Pp
806: Screened DH groups may be installed in
807: .Pa /etc/moduli .
808: It is important that this file contains moduli of a range of bit lengths and
809: that both ends of a connection share common moduli.
1.184 djm 810: .Pp
811: A number of options are available for moduli generation and screening via the
812: .Fl O
813: flag:
1.186 jmc 814: .Bl -tag -width Ds
1.184 djm 815: .It Ic lines Ns = Ns Ar number
816: Exit after screening the specified number of lines while performing DH
817: candidate screening.
818: .It Ic start-line Ns = Ns Ar line-number
819: Start screening at the specified line number while performing DH candidate
820: screening.
821: .It Ic checkpoint Ns = Ns Ar filename
822: Write the last line processed to the specified file while performing DH
823: candidate screening.
824: This will be used to skip lines in the input file that have already been
825: processed if the job is restarted.
826: .It Ic memory Ns = Ns Ar mbytes
827: Specify the amount of memory to use (in megabytes) when generating
828: candidate moduli for DH-GEX.
829: .It Ic start Ns = Ns Ar hex-value
830: Specify start point (in hex) when generating candidate moduli for DH-GEX.
831: .It Ic generator Ns = Ns Ar value
832: Specify desired generator (in decimal) when testing candidate moduli for DH-GEX.
833: .El
1.84 djm 834: .Sh CERTIFICATES
835: .Nm
836: supports signing of keys to produce certificates that may be used for
837: user or host authentication.
838: Certificates consist of a public key, some identity information, zero or
1.94 jmc 839: more principal (user or host) names and a set of options that
1.84 djm 840: are signed by a Certification Authority (CA) key.
841: Clients or servers may then trust only the CA key and verify its signature
842: on a certificate rather than trusting many user/host keys.
843: Note that OpenSSH certificates are a different, and much simpler, format to
844: the X.509 certificates used in
845: .Xr ssl 8 .
846: .Pp
847: .Nm
848: supports two types of certificates: user and host.
849: User certificates authenticate users to servers, whereas host certificates
1.85 jmc 850: authenticate server hosts to users.
851: To generate a user certificate:
1.84 djm 852: .Pp
853: .Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
854: .Pp
855: The resultant certificate will be placed in
1.91 djm 856: .Pa /path/to/user_key-cert.pub .
1.84 djm 857: A host certificate requires the
858: .Fl h
859: option:
860: .Pp
861: .Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
862: .Pp
863: The host certificate will be output to
1.91 djm 864: .Pa /path/to/host_key-cert.pub .
1.98 djm 865: .Pp
866: It is possible to sign using a CA key stored in a PKCS#11 token by
867: providing the token library using
868: .Fl D
869: and identifying the CA key by providing its public half as an argument
870: to
871: .Fl s :
872: .Pp
1.127 naddy 873: .Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
1.142 djm 874: .Pp
875: Similarly, it is possible for the CA key to be hosted in a
876: .Xr ssh-agent 1 .
877: This is indicated by the
878: .Fl U
879: flag and, again, the CA key must be identified by its public half.
880: .Pp
881: .Dl $ ssh-keygen -Us ca_key.pub -I key_id user_key.pub
1.98 djm 882: .Pp
883: In all cases,
1.84 djm 884: .Ar key_id
885: is a "key identifier" that is logged by the server when the certificate
886: is used for authentication.
887: .Pp
888: Certificates may be limited to be valid for a set of principal (user/host)
889: names.
890: By default, generated certificates are valid for all users or hosts.
891: To generate a certificate for a specified set of principals:
892: .Pp
893: .Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
1.127 naddy 894: .Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain host_key.pub"
1.84 djm 895: .Pp
896: Additional limitations on the validity and use of user certificates may
1.94 jmc 897: be specified through certificate options.
1.93 djm 898: A certificate option may disable features of the SSH session, may be
1.84 djm 899: valid only when presented from particular source addresses or may
900: force the use of a specific command.
1.183 djm 901: .Pp
902: The options that are valid for user certificates are:
903: .Pp
904: .Bl -tag -width Ds -compact
905: .It Ic clear
906: Clear all enabled permissions.
907: This is useful for clearing the default set of permissions so permissions may
908: be added individually.
909: .Pp
910: .It Ic critical : Ns Ar name Ns Op Ns = Ns Ar contents
911: .It Ic extension : Ns Ar name Ns Op Ns = Ns Ar contents
912: Includes an arbitrary certificate critical option or extension.
913: The specified
914: .Ar name
915: should include a domain suffix, e.g.\&
916: .Dq name@example.com .
917: If
918: .Ar contents
919: is specified then it is included as the contents of the extension/option
920: encoded as a string, otherwise the extension/option is created with no
921: contents (usually indicating a flag).
922: Extensions may be ignored by a client or server that does not recognise them,
923: whereas unknown critical options will cause the certificate to be refused.
924: .Pp
925: .It Ic force-command Ns = Ns Ar command
926: Forces the execution of
927: .Ar command
928: instead of any shell or command specified by the user when
929: the certificate is used for authentication.
930: .Pp
931: .It Ic no-agent-forwarding
932: Disable
933: .Xr ssh-agent 1
934: forwarding (permitted by default).
935: .Pp
936: .It Ic no-port-forwarding
937: Disable port forwarding (permitted by default).
938: .Pp
939: .It Ic no-pty
940: Disable PTY allocation (permitted by default).
941: .Pp
942: .It Ic no-user-rc
943: Disable execution of
944: .Pa ~/.ssh/rc
945: by
946: .Xr sshd 8
947: (permitted by default).
948: .Pp
949: .It Ic no-x11-forwarding
950: Disable X11 forwarding (permitted by default).
951: .Pp
952: .It Ic permit-agent-forwarding
953: Allows
954: .Xr ssh-agent 1
955: forwarding.
956: .Pp
957: .It Ic permit-port-forwarding
958: Allows port forwarding.
959: .Pp
960: .It Ic permit-pty
961: Allows PTY allocation.
962: .Pp
963: .It Ic permit-user-rc
964: Allows execution of
965: .Pa ~/.ssh/rc
966: by
967: .Xr sshd 8 .
968: .Pp
969: .It Ic permit-X11-forwarding
970: Allows X11 forwarding.
971: .Pp
972: .It Ic no-touch-required
1.206 djm 973: Do not require signatures made using this key include demonstration
1.193 naddy 974: of user presence (e.g. by having the user touch the authenticator).
1.192 naddy 975: This option only makes sense for the FIDO authenticator algorithms
1.183 djm 976: .Cm ecdsa-sk
977: and
978: .Cm ed25519-sk .
979: .Pp
980: .It Ic source-address Ns = Ns Ar address_list
981: Restrict the source addresses from which the certificate is considered valid.
982: The
983: .Ar address_list
984: is a comma-separated list of one or more address/netmask pairs in CIDR
985: format.
1.206 djm 986: .Pp
987: .It Ic verify-required
988: Require signatures made using this key indicate that the user was first
989: verified.
990: This option only makes sense for the FIDO authenticator algorithms
991: .Cm ecdsa-sk
992: and
993: .Cm ed25519-sk .
994: Currently PIN authentication is the only supported verification method,
995: but other methods may be supported in the future.
1.183 djm 996: .El
997: .Pp
998: At present, no standard options are valid for host keys.
1.84 djm 999: .Pp
1000: Finally, certificates may be defined with a validity lifetime.
1001: The
1002: .Fl V
1003: option allows specification of certificate start and end times.
1004: A certificate that is presented at a time outside this range will not be
1005: considered valid.
1.210 ! dtucker 1006: By default, certificates are valid from the
1.110 jmc 1007: .Ux
1008: Epoch to the distant future.
1.84 djm 1009: .Pp
1010: For certificates to be used for user or host authentication, the CA
1011: public key must be trusted by
1012: .Xr sshd 8
1013: or
1014: .Xr ssh 1 .
1015: Please refer to those manual pages for details.
1.111 djm 1016: .Sh KEY REVOCATION LISTS
1017: .Nm
1018: is able to manage OpenSSH format Key Revocation Lists (KRLs).
1019: These binary files specify keys or certificates to be revoked using a
1.119 tedu 1020: compact format, taking as little as one bit per certificate if they are being
1.111 djm 1021: revoked by serial number.
1022: .Pp
1023: KRLs may be generated using the
1024: .Fl k
1025: flag.
1.114 jmc 1026: This option reads one or more files from the command line and generates a new
1.111 djm 1027: KRL.
1028: The files may either contain a KRL specification (see below) or public keys,
1029: listed one per line.
1030: Plain public keys are revoked by listing their hash or contents in the KRL and
1031: certificates revoked by serial number or key ID (if the serial is zero or
1032: not available).
1033: .Pp
1034: Revoking keys using a KRL specification offers explicit control over the
1035: types of record used to revoke keys and may be used to directly revoke
1036: certificates by serial number or key ID without having the complete original
1037: certificate on hand.
1038: A KRL specification consists of lines containing one of the following directives
1039: followed by a colon and some directive-specific information.
1040: .Bl -tag -width Ds
1.115 jmc 1041: .It Cm serial : Ar serial_number Ns Op - Ns Ar serial_number
1.111 djm 1042: Revokes a certificate with the specified serial number.
1.112 jmc 1043: Serial numbers are 64-bit values, not including zero and may be expressed
1.111 djm 1044: in decimal, hex or octal.
1045: If two serial numbers are specified separated by a hyphen, then the range
1046: of serial numbers including and between each is revoked.
1047: The CA key must have been specified on the
1048: .Nm
1.114 jmc 1049: command line using the
1.111 djm 1050: .Fl s
1051: option.
1052: .It Cm id : Ar key_id
1053: Revokes a certificate with the specified key ID string.
1054: The CA key must have been specified on the
1055: .Nm
1.114 jmc 1056: command line using the
1.111 djm 1057: .Fl s
1058: option.
1059: .It Cm key : Ar public_key
1060: Revokes the specified key.
1.112 jmc 1061: If a certificate is listed, then it is revoked as a plain public key.
1.111 djm 1062: .It Cm sha1 : Ar public_key
1.149 djm 1063: Revokes the specified key by including its SHA1 hash in the KRL.
1064: .It Cm sha256 : Ar public_key
1065: Revokes the specified key by including its SHA256 hash in the KRL.
1066: KRLs that revoke keys by SHA256 hash are not supported by OpenSSH versions
1067: prior to 7.9.
1068: .It Cm hash : Ar fingerprint
1.150 djm 1069: Revokes a key using a fingerprint hash, as obtained from a
1.149 djm 1070: .Xr sshd 8
1071: authentication log message or the
1072: .Nm
1073: .Fl l
1074: flag.
1075: Only SHA256 fingerprints are supported here and resultant KRLs are
1076: not supported by OpenSSH versions prior to 7.9.
1.111 djm 1077: .El
1078: .Pp
1079: KRLs may be updated using the
1080: .Fl u
1081: flag in addition to
1082: .Fl k .
1.114 jmc 1083: When this option is specified, keys listed via the command line are merged into
1.111 djm 1084: the KRL, adding to those already there.
1085: .Pp
1086: It is also possible, given a KRL, to test whether it revokes a particular key
1087: (or keys).
1088: The
1089: .Fl Q
1.128 jmc 1090: flag will query an existing KRL, testing each key specified on the command line.
1.114 jmc 1091: If any key listed on the command line has been revoked (or an error encountered)
1.111 djm 1092: then
1093: .Nm
1094: will exit with a non-zero exit status.
1095: A zero exit status will only be returned if no key was revoked.
1.163 djm 1096: .Sh ALLOWED SIGNERS
1097: When verifying signatures,
1098: .Nm
1099: uses a simple list of identities and keys to determine whether a signature
1100: comes from an authorized source.
1101: This "allowed signers" file uses a format patterned after the
1102: AUTHORIZED_KEYS FILE FORMAT described in
1.165 jmc 1103: .Xr sshd 8 .
1.163 djm 1104: Each line of the file contains the following space-separated fields:
1105: principals, options, keytype, base64-encoded key.
1106: Empty lines and lines starting with a
1107: .Ql #
1108: are ignored as comments.
1109: .Pp
1.210 ! dtucker 1110: The principals field is a pattern-list (see PATTERNS in
1.163 djm 1111: .Xr ssh_config 5 )
1112: consisting of one or more comma-separated USER@DOMAIN identity patterns
1113: that are accepted for signing.
1114: When verifying, the identity presented via the
1.172 jmc 1115: .Fl I
1116: option must match a principals pattern in order for the corresponding key to be
1.163 djm 1117: considered acceptable for verification.
1118: .Pp
1119: The options (if present) consist of comma-separated option specifications.
1120: No spaces are permitted, except within double quotes.
1121: The following option specifications are supported (note that option keywords
1122: are case-insensitive):
1123: .Bl -tag -width Ds
1124: .It Cm cert-authority
1125: Indicates that this key is accepted as a certificate authority (CA) and
1126: that certificates signed by this CA may be accepted for verification.
1127: .It Cm namespaces="namespace-list"
1128: Specifies a pattern-list of namespaces that are accepted for this key.
1.164 djm 1129: If this option is present, the signature namespace embedded in the
1.163 djm 1130: signature object and presented on the verification command-line must
1131: match the specified list before the key will be considered acceptable.
1132: .El
1133: .Pp
1134: When verifying signatures made by certificates, the expected principal
1135: name must match both the principals pattern in the allowed signers file and
1136: the principals embedded in the certificate itself.
1137: .Pp
1138: An example allowed signers file:
1139: .Bd -literal -offset 3n
1140: # Comments allowed at start of line
1141: user1@example.com,user2@example.com ssh-rsa AAAAX1...
1142: # A certificate authority, trusted for all principals in a domain.
1143: *@example.com cert-authority ssh-ed25519 AAAB4...
1144: # A key that is accepted only for file signing.
1145: user2@example.com namespaces="file" ssh-ed25519 AAA41...
1146: .Ed
1.173 naddy 1147: .Sh ENVIRONMENT
1148: .Bl -tag -width Ds
1149: .It Ev SSH_SK_PROVIDER
1.201 djm 1150: Specifies a path to a library that will be used when loading any
1151: FIDO authenticator-hosted keys, overriding the default of using
1152: the built-in USB HID support.
1.173 naddy 1153: .El
1.2 deraadt 1154: .Sh FILES
1.100 naddy 1155: .Bl -tag -width Ds -compact
1.68 djm 1156: .It Pa ~/.ssh/id_dsa
1.100 naddy 1157: .It Pa ~/.ssh/id_ecdsa
1.173 naddy 1158: .It Pa ~/.ssh/id_ecdsa_sk
1.118 naddy 1159: .It Pa ~/.ssh/id_ed25519
1.176 naddy 1160: .It Pa ~/.ssh/id_ed25519_sk
1.100 naddy 1161: .It Pa ~/.ssh/id_rsa
1.180 naddy 1162: Contains the DSA, ECDSA, authenticator-hosted ECDSA, Ed25519,
1163: authenticator-hosted Ed25519 or RSA authentication identity of the user.
1.15 deraadt 1164: This file should not be readable by anyone but the user.
1165: It is possible to
1166: specify a passphrase when generating the key; that passphrase will be
1.80 dtucker 1167: used to encrypt the private part of this file using 128-bit AES.
1.15 deraadt 1168: This file is not automatically accessed by
1169: .Nm
1170: but it is offered as the default file for the private key.
1.46 markus 1171: .Xr ssh 1
1.15 deraadt 1172: will read this file when a login attempt is made.
1.100 naddy 1173: .Pp
1.68 djm 1174: .It Pa ~/.ssh/id_dsa.pub
1.100 naddy 1175: .It Pa ~/.ssh/id_ecdsa.pub
1.173 naddy 1176: .It Pa ~/.ssh/id_ecdsa_sk.pub
1.118 naddy 1177: .It Pa ~/.ssh/id_ed25519.pub
1.176 naddy 1178: .It Pa ~/.ssh/id_ed25519_sk.pub
1.68 djm 1179: .It Pa ~/.ssh/id_rsa.pub
1.180 naddy 1180: Contains the DSA, ECDSA, authenticator-hosted ECDSA, Ed25519,
1181: authenticator-hosted Ed25519 or RSA public key for authentication.
1.15 deraadt 1182: The contents of this file should be added to
1.68 djm 1183: .Pa ~/.ssh/authorized_keys
1.15 deraadt 1184: on all machines
1.49 deraadt 1185: where the user wishes to log in using public key authentication.
1.12 aaron 1186: There is no need to keep the contents of this file secret.
1.100 naddy 1187: .Pp
1.60 djm 1188: .It Pa /etc/moduli
1189: Contains Diffie-Hellman groups used for DH-GEX.
1190: The file format is described in
1191: .Xr moduli 5 .
1.19 aaron 1192: .El
1.2 deraadt 1193: .Sh SEE ALSO
1194: .Xr ssh 1 ,
1195: .Xr ssh-add 1 ,
1.8 ericj 1196: .Xr ssh-agent 1 ,
1.60 djm 1197: .Xr moduli 5 ,
1.30 itojun 1198: .Xr sshd 8
1.37 markus 1199: .Rs
1.73 markus 1200: .%R RFC 4716
1201: .%T "The Secure Shell (SSH) Public Key File Format"
1202: .%D 2006
1.37 markus 1203: .Re
1.59 jmc 1204: .Sh AUTHORS
1205: OpenSSH is a derivative of the original and free
1206: ssh 1.2.12 release by Tatu Ylonen.
1207: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1208: Theo de Raadt and Dug Song
1209: removed many bugs, re-added newer features and
1210: created OpenSSH.
1211: Markus Friedl contributed the support for SSH
1212: protocol versions 1.5 and 2.0.