[BACK]Return to ssh-keygen.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/ssh-keygen.1, Revision 1.208

1.208   ! jmc         1: .\"    $OpenBSD: ssh-keygen.1,v 1.207 2020/08/27 01:08:45 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.207     djm        38: .Dd $Mdocdate: August 27 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.197     djm       523: May be used at key generation time to record the attestation certificate
                    524: returned from FIDO tokens during key generation.
                    525: By default this information is discarded.
1.190     jmc       526: .El
1.185     djm       527: .Pp
                    528: The
                    529: .Fl O
                    530: option may be specified multiple times.
1.66      jmc       531: .It Fl P Ar passphrase
                    532: Provides the (old) passphrase.
1.2       deraadt   533: .It Fl p
1.1       deraadt   534: Requests changing the passphrase of a private key file instead of
1.12      aaron     535: creating a new private key.
                    536: The program will prompt for the file
1.1       deraadt   537: containing the private key, for the old passphrase, and twice for the
                    538: new passphrase.
1.113     jmc       539: .It Fl Q
                    540: Test whether keys have been revoked in a KRL.
1.203     djm       541: If the
                    542: .Fl l
                    543: option is also specified then the contents of the KRL will be printed.
1.5       aaron     544: .It Fl q
                    545: Silence
                    546: .Nm ssh-keygen .
1.152     djm       547: .It Fl R Ar hostname | [hostname]:port
1.151     djm       548: Removes all keys belonging to the specified
1.64      djm       549: .Ar hostname
1.151     djm       550: (with optional port number)
1.65      jmc       551: from a
1.64      djm       552: .Pa known_hosts
                    553: file.
1.65      jmc       554: This option is useful to delete hashed hosts (see the
1.64      djm       555: .Fl H
                    556: option above).
1.66      jmc       557: .It Fl r Ar hostname
                    558: Print the SSHFP fingerprint resource record named
                    559: .Ar hostname
                    560: for the specified public key file.
1.84      djm       561: .It Fl s Ar ca_key
                    562: Certify (sign) a public key using the specified CA key.
                    563: Please see the
                    564: .Sx CERTIFICATES
                    565: section for details.
1.111     djm       566: .Pp
                    567: When generating a KRL,
                    568: .Fl s
1.112     jmc       569: specifies a path to a CA public key file used to revoke certificates directly
1.111     djm       570: by key ID or serial number.
                    571: See the
                    572: .Sx KEY REVOCATION LISTS
                    573: section for details.
1.175     djm       574: .It Fl t Cm dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
1.66      jmc       575: Specifies the type of key to create.
                    576: The possible values are
1.100     naddy     577: .Dq dsa ,
1.118     naddy     578: .Dq ecdsa ,
1.173     naddy     579: .Dq ecdsa-sk ,
1.118     naddy     580: .Dq ed25519 ,
1.175     djm       581: .Dq ed25519-sk ,
1.100     naddy     582: or
1.139     jmc       583: .Dq rsa .
1.159     djm       584: .Pp
                    585: This flag may also be used to specify the desired signature type when
1.160     jmc       586: signing certificates using an RSA CA key.
1.159     djm       587: The available RSA signature variants are
                    588: .Dq ssh-rsa
                    589: (SHA1 signatures, not recommended),
1.160     jmc       590: .Dq rsa-sha2-256 ,
                    591: and
1.159     djm       592: .Dq rsa-sha2-512
                    593: (the default).
1.142     djm       594: .It Fl U
                    595: When used in combination with
                    596: .Fl s ,
                    597: this option indicates that a CA key resides in a
                    598: .Xr ssh-agent 1 .
                    599: See the
                    600: .Sx CERTIFICATES
                    601: section for more information.
1.112     jmc       602: .It Fl u
                    603: Update a KRL.
                    604: When specified with
                    605: .Fl k ,
1.114     jmc       606: keys listed via the command line are added to the existing KRL rather than
1.112     jmc       607: a new KRL being created.
1.84      djm       608: .It Fl V Ar validity_interval
                    609: Specify a validity interval when signing a certificate.
                    610: A validity interval may consist of a single time, indicating that the
                    611: certificate is valid beginning now and expiring at that time, or may consist
                    612: of two times separated by a colon to indicate an explicit time interval.
1.145     djm       613: .Pp
                    614: The start time may be specified as the string
                    615: .Dq always
                    616: to indicate the certificate has no specified start time,
1.147     djm       617: a date in YYYYMMDD format, a time in YYYYMMDDHHMM[SS] format,
1.145     djm       618: a relative time (to the current time) consisting of a minus sign followed by
                    619: an interval in the format described in the
1.116     jmc       620: TIME FORMATS section of
1.90      jmc       621: .Xr sshd_config 5 .
1.145     djm       622: .Pp
1.147     djm       623: The end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMM[SS] time,
1.145     djm       624: a relative time starting with a plus character or the string
                    625: .Dq forever
1.202     dtucker   626: to indicate that the certificate has no expiry date.
1.84      djm       627: .Pp
                    628: For example:
                    629: .Dq +52w1d
                    630: (valid from now to 52 weeks and one day from now),
                    631: .Dq -4w:+4w
                    632: (valid from four weeks ago to four weeks from now),
                    633: .Dq 20100101123000:20110101123000
                    634: (valid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011),
                    635: .Dq -1d:20110101
                    636: (valid from yesterday to midnight, January 1st, 2011).
1.145     djm       637: .Dq -1m:forever
                    638: (valid from one minute ago and never expiring).
1.61      djm       639: .It Fl v
                    640: Verbose mode.
                    641: Causes
                    642: .Nm
                    643: to print debugging messages about its progress.
                    644: This is helpful for debugging moduli generation.
                    645: Multiple
                    646: .Fl v
                    647: options increase the verbosity.
                    648: The maximum is 3.
1.173     naddy     649: .It Fl w Ar provider
1.180     naddy     650: Specifies a path to a library that will be used when creating
                    651: FIDO authenticator-hosted keys, overriding the default of using
                    652: the internal USB HID support.
1.196     djm       653: .It Fl Y Cm find-principals
                    654: Find the principal(s) associated with the public key of a signature,
1.194     djm       655: provided using the
                    656: .Fl s
                    657: flag in an authorized signers file provided using the
                    658: .Fl f
                    659: flag.
                    660: The format of the allowed signers file is documented in the
                    661: .Sx ALLOWED SIGNERS
1.195     jmc       662: section below.
1.196     djm       663: If one or more matching principals are found, they are returned on
                    664: standard output.
1.182     jmc       665: .It Fl Y Cm check-novalidate
                    666: Checks that a signature generated using
                    667: .Nm
                    668: .Fl Y Cm sign
                    669: has a valid structure.
                    670: This does not validate if a signature comes from an authorized signer.
                    671: When testing a signature,
                    672: .Nm
                    673: accepts a message on standard input and a signature namespace using
                    674: .Fl n .
                    675: A file containing the corresponding signature must also be supplied using the
                    676: .Fl s
                    677: flag.
                    678: Successful testing of the signature is signalled by
                    679: .Nm
                    680: returning a zero exit status.
1.166     jmc       681: .It Fl Y Cm sign
1.163     djm       682: Cryptographically sign a file or some data using a SSH key.
                    683: When signing,
                    684: .Nm
                    685: accepts zero or more files to sign on the command-line - if no files
                    686: are specified then
                    687: .Nm
                    688: will sign data presented on standard input.
                    689: Signatures are written to the path of the input file with
                    690: .Dq .sig
                    691: appended, or to standard output if the message to be signed was read from
                    692: standard input.
                    693: .Pp
                    694: The key used for signing is specified using the
                    695: .Fl f
                    696: option and may refer to either a private key, or a public key with the private
                    697: half available via
                    698: .Xr ssh-agent 1 .
                    699: An additional signature namespace, used to prevent signature confusion across
                    700: different domains of use (e.g. file signing vs email signing) must be provided
                    701: via the
                    702: .Fl n
                    703: flag.
                    704: Namespaces are arbitrary strings, and may include:
                    705: .Dq file
                    706: for file signing,
                    707: .Dq email
                    708: for email signing.
                    709: For custom uses, it is recommended to use names following a
                    710: NAMESPACE@YOUR.DOMAIN pattern to generate unambiguous namespaces.
1.166     jmc       711: .It Fl Y Cm verify
1.163     djm       712: Request to verify a signature generated using
                    713: .Nm
1.166     jmc       714: .Fl Y Cm sign
1.163     djm       715: as described above.
                    716: When verifying a signature,
                    717: .Nm
                    718: accepts a message on standard input and a signature namespace using
                    719: .Fl n .
                    720: A file containing the corresponding signature must also be supplied using the
                    721: .Fl s
                    722: flag, along with the identity of the signer using
                    723: .Fl I
                    724: and a list of allowed signers via the
                    725: .Fl f
                    726: flag.
                    727: The format of the allowed signers file is documented in the
                    728: .Sx ALLOWED SIGNERS
                    729: section below.
                    730: A file containing revoked keys can be passed using the
                    731: .Fl r
1.165     jmc       732: flag.
                    733: The revocation file may be a KRL or a one-per-line list of public keys.
1.163     djm       734: Successful verification by an authorized signer is signalled by
                    735: .Nm
                    736: returning a zero exit status.
1.181     jmc       737: .It Fl y
                    738: This option will read a private
                    739: OpenSSH format file and print an OpenSSH public key to stdout.
1.93      djm       740: .It Fl z Ar serial_number
                    741: Specifies a serial number to be embedded in the certificate to distinguish
                    742: this certificate from others from the same CA.
1.156     djm       743: If the
                    744: .Ar serial_number
                    745: is prefixed with a
                    746: .Sq +
                    747: character, then the serial number will be incremented for each certificate
                    748: signed on a single command-line.
1.93      djm       749: The default serial number is zero.
1.111     djm       750: .Pp
                    751: When generating a KRL, the
                    752: .Fl z
                    753: flag is used to specify a KRL version number.
1.2       deraadt   754: .El
1.60      djm       755: .Sh MODULI GENERATION
                    756: .Nm
                    757: may be used to generate groups for the Diffie-Hellman Group Exchange
                    758: (DH-GEX) protocol.
                    759: Generating these groups is a two-step process: first, candidate
                    760: primes are generated using a fast, but memory intensive process.
                    761: These candidate primes are then tested for suitability (a CPU-intensive
                    762: process).
                    763: .Pp
                    764: Generation of primes is performed using the
1.184     djm       765: .Fl M Cm generate
1.60      djm       766: option.
                    767: The desired length of the primes may be specified by the
1.184     djm       768: .Fl O Cm bits
1.60      djm       769: option.
                    770: For example:
                    771: .Pp
1.184     djm       772: .Dl # ssh-keygen -M generate -O bits=2048 moduli-2048.candidates
1.60      djm       773: .Pp
                    774: By default, the search for primes begins at a random point in the
                    775: desired length range.
                    776: This may be overridden using the
1.184     djm       777: .Fl O Cm start
1.60      djm       778: option, which specifies a different start point (in hex).
                    779: .Pp
1.109     dtucker   780: Once a set of candidates have been generated, they must be screened for
1.60      djm       781: suitability.
                    782: This may be performed using the
1.184     djm       783: .Fl M Cm screen
1.60      djm       784: option.
                    785: In this mode
                    786: .Nm
                    787: will read candidates from standard input (or a file specified using the
                    788: .Fl f
                    789: option).
                    790: For example:
                    791: .Pp
1.184     djm       792: .Dl # ssh-keygen -M screen -f moduli-2048.candidates moduli-2048
1.60      djm       793: .Pp
                    794: By default, each candidate will be subjected to 100 primality tests.
                    795: This may be overridden using the
1.184     djm       796: .Fl O Cm prime-tests
1.60      djm       797: option.
                    798: The DH generator value will be chosen automatically for the
                    799: prime under consideration.
                    800: If a specific generator is desired, it may be requested using the
1.184     djm       801: .Fl O Cm generator
1.60      djm       802: option.
1.66      jmc       803: Valid generator values are 2, 3, and 5.
1.60      djm       804: .Pp
                    805: Screened DH groups may be installed in
                    806: .Pa /etc/moduli .
                    807: It is important that this file contains moduli of a range of bit lengths and
                    808: that both ends of a connection share common moduli.
1.184     djm       809: .Pp
                    810: A number of options are available for moduli generation and screening via the
                    811: .Fl O
                    812: flag:
1.186     jmc       813: .Bl -tag -width Ds
1.184     djm       814: .It Ic lines Ns = Ns Ar number
                    815: Exit after screening the specified number of lines while performing DH
                    816: candidate screening.
                    817: .It Ic start-line Ns = Ns Ar line-number
                    818: Start screening at the specified line number while performing DH candidate
                    819: screening.
                    820: .It Ic checkpoint Ns = Ns Ar filename
                    821: Write the last line processed to the specified file while performing DH
                    822: candidate screening.
                    823: This will be used to skip lines in the input file that have already been
                    824: processed if the job is restarted.
                    825: .It Ic memory Ns = Ns Ar mbytes
                    826: Specify the amount of memory to use (in megabytes) when generating
                    827: candidate moduli for DH-GEX.
                    828: .It Ic start Ns = Ns Ar hex-value
                    829: Specify start point (in hex) when generating candidate moduli for DH-GEX.
                    830: .It Ic generator Ns = Ns Ar value
                    831: Specify desired generator (in decimal) when testing candidate moduli for DH-GEX.
                    832: .El
1.84      djm       833: .Sh CERTIFICATES
                    834: .Nm
                    835: supports signing of keys to produce certificates that may be used for
                    836: user or host authentication.
                    837: Certificates consist of a public key, some identity information, zero or
1.94      jmc       838: more principal (user or host) names and a set of options that
1.84      djm       839: are signed by a Certification Authority (CA) key.
                    840: Clients or servers may then trust only the CA key and verify its signature
                    841: on a certificate rather than trusting many user/host keys.
                    842: Note that OpenSSH certificates are a different, and much simpler, format to
                    843: the X.509 certificates used in
                    844: .Xr ssl 8 .
                    845: .Pp
                    846: .Nm
                    847: supports two types of certificates: user and host.
                    848: User certificates authenticate users to servers, whereas host certificates
1.85      jmc       849: authenticate server hosts to users.
                    850: To generate a user certificate:
1.84      djm       851: .Pp
                    852: .Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
                    853: .Pp
                    854: The resultant certificate will be placed in
1.91      djm       855: .Pa /path/to/user_key-cert.pub .
1.84      djm       856: A host certificate requires the
                    857: .Fl h
                    858: option:
                    859: .Pp
                    860: .Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
                    861: .Pp
                    862: The host certificate will be output to
1.91      djm       863: .Pa /path/to/host_key-cert.pub .
1.98      djm       864: .Pp
                    865: It is possible to sign using a CA key stored in a PKCS#11 token by
                    866: providing the token library using
                    867: .Fl D
                    868: and identifying the CA key by providing its public half as an argument
                    869: to
                    870: .Fl s :
                    871: .Pp
1.127     naddy     872: .Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
1.142     djm       873: .Pp
                    874: Similarly, it is possible for the CA key to be hosted in a
                    875: .Xr ssh-agent 1 .
                    876: This is indicated by the
                    877: .Fl U
                    878: flag and, again, the CA key must be identified by its public half.
                    879: .Pp
                    880: .Dl $ ssh-keygen -Us ca_key.pub -I key_id user_key.pub
1.98      djm       881: .Pp
                    882: In all cases,
1.84      djm       883: .Ar key_id
                    884: is a "key identifier" that is logged by the server when the certificate
                    885: is used for authentication.
                    886: .Pp
                    887: Certificates may be limited to be valid for a set of principal (user/host)
                    888: names.
                    889: By default, generated certificates are valid for all users or hosts.
                    890: To generate a certificate for a specified set of principals:
                    891: .Pp
                    892: .Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
1.127     naddy     893: .Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain host_key.pub"
1.84      djm       894: .Pp
                    895: Additional limitations on the validity and use of user certificates may
1.94      jmc       896: be specified through certificate options.
1.93      djm       897: A certificate option may disable features of the SSH session, may be
1.84      djm       898: valid only when presented from particular source addresses or may
                    899: force the use of a specific command.
1.183     djm       900: .Pp
                    901: The options that are valid for user certificates are:
                    902: .Pp
                    903: .Bl -tag -width Ds -compact
                    904: .It Ic clear
                    905: Clear all enabled permissions.
                    906: This is useful for clearing the default set of permissions so permissions may
                    907: be added individually.
                    908: .Pp
                    909: .It Ic critical : Ns Ar name Ns Op Ns = Ns Ar contents
                    910: .It Ic extension : Ns Ar name Ns Op Ns = Ns Ar contents
                    911: Includes an arbitrary certificate critical option or extension.
                    912: The specified
                    913: .Ar name
                    914: should include a domain suffix, e.g.\&
                    915: .Dq name@example.com .
                    916: If
                    917: .Ar contents
                    918: is specified then it is included as the contents of the extension/option
                    919: encoded as a string, otherwise the extension/option is created with no
                    920: contents (usually indicating a flag).
                    921: Extensions may be ignored by a client or server that does not recognise them,
                    922: whereas unknown critical options will cause the certificate to be refused.
                    923: .Pp
                    924: .It Ic force-command Ns = Ns Ar command
                    925: Forces the execution of
                    926: .Ar command
                    927: instead of any shell or command specified by the user when
                    928: the certificate is used for authentication.
                    929: .Pp
                    930: .It Ic no-agent-forwarding
                    931: Disable
                    932: .Xr ssh-agent 1
                    933: forwarding (permitted by default).
                    934: .Pp
                    935: .It Ic no-port-forwarding
                    936: Disable port forwarding (permitted by default).
                    937: .Pp
                    938: .It Ic no-pty
                    939: Disable PTY allocation (permitted by default).
                    940: .Pp
                    941: .It Ic no-user-rc
                    942: Disable execution of
                    943: .Pa ~/.ssh/rc
                    944: by
                    945: .Xr sshd 8
                    946: (permitted by default).
                    947: .Pp
                    948: .It Ic no-x11-forwarding
                    949: Disable X11 forwarding (permitted by default).
                    950: .Pp
                    951: .It Ic permit-agent-forwarding
                    952: Allows
                    953: .Xr ssh-agent 1
                    954: forwarding.
                    955: .Pp
                    956: .It Ic permit-port-forwarding
                    957: Allows port forwarding.
                    958: .Pp
                    959: .It Ic permit-pty
                    960: Allows PTY allocation.
                    961: .Pp
                    962: .It Ic permit-user-rc
                    963: Allows execution of
                    964: .Pa ~/.ssh/rc
                    965: by
                    966: .Xr sshd 8 .
                    967: .Pp
                    968: .It Ic permit-X11-forwarding
                    969: Allows X11 forwarding.
                    970: .Pp
                    971: .It Ic no-touch-required
1.206     djm       972: Do not require signatures made using this key include demonstration
1.193     naddy     973: of user presence (e.g. by having the user touch the authenticator).
1.192     naddy     974: This option only makes sense for the FIDO authenticator algorithms
1.183     djm       975: .Cm ecdsa-sk
                    976: and
                    977: .Cm ed25519-sk .
                    978: .Pp
                    979: .It Ic source-address Ns = Ns Ar address_list
                    980: Restrict the source addresses from which the certificate is considered valid.
                    981: The
                    982: .Ar address_list
                    983: is a comma-separated list of one or more address/netmask pairs in CIDR
                    984: format.
1.206     djm       985: .Pp
                    986: .It Ic verify-required
                    987: Require signatures made using this key indicate that the user was first
                    988: verified.
                    989: This option only makes sense for the FIDO authenticator algorithms
                    990: .Cm ecdsa-sk
                    991: and
                    992: .Cm ed25519-sk .
                    993: Currently PIN authentication is the only supported verification method,
                    994: but other methods may be supported in the future.
1.183     djm       995: .El
                    996: .Pp
                    997: At present, no standard options are valid for host keys.
1.84      djm       998: .Pp
                    999: Finally, certificates may be defined with a validity lifetime.
                   1000: The
                   1001: .Fl V
                   1002: option allows specification of certificate start and end times.
                   1003: A certificate that is presented at a time outside this range will not be
                   1004: considered valid.
1.110     jmc      1005: By default, certificates are valid from
                   1006: .Ux
                   1007: Epoch to the distant future.
1.84      djm      1008: .Pp
                   1009: For certificates to be used for user or host authentication, the CA
                   1010: public key must be trusted by
                   1011: .Xr sshd 8
                   1012: or
                   1013: .Xr ssh 1 .
                   1014: Please refer to those manual pages for details.
1.111     djm      1015: .Sh KEY REVOCATION LISTS
                   1016: .Nm
                   1017: is able to manage OpenSSH format Key Revocation Lists (KRLs).
                   1018: These binary files specify keys or certificates to be revoked using a
1.119     tedu     1019: compact format, taking as little as one bit per certificate if they are being
1.111     djm      1020: revoked by serial number.
                   1021: .Pp
                   1022: KRLs may be generated using the
                   1023: .Fl k
                   1024: flag.
1.114     jmc      1025: This option reads one or more files from the command line and generates a new
1.111     djm      1026: KRL.
                   1027: The files may either contain a KRL specification (see below) or public keys,
                   1028: listed one per line.
                   1029: Plain public keys are revoked by listing their hash or contents in the KRL and
                   1030: certificates revoked by serial number or key ID (if the serial is zero or
                   1031: not available).
                   1032: .Pp
                   1033: Revoking keys using a KRL specification offers explicit control over the
                   1034: types of record used to revoke keys and may be used to directly revoke
                   1035: certificates by serial number or key ID without having the complete original
                   1036: certificate on hand.
                   1037: A KRL specification consists of lines containing one of the following directives
                   1038: followed by a colon and some directive-specific information.
                   1039: .Bl -tag -width Ds
1.115     jmc      1040: .It Cm serial : Ar serial_number Ns Op - Ns Ar serial_number
1.111     djm      1041: Revokes a certificate with the specified serial number.
1.112     jmc      1042: Serial numbers are 64-bit values, not including zero and may be expressed
1.111     djm      1043: in decimal, hex or octal.
                   1044: If two serial numbers are specified separated by a hyphen, then the range
                   1045: of serial numbers including and between each is revoked.
                   1046: The CA key must have been specified on the
                   1047: .Nm
1.114     jmc      1048: command line using the
1.111     djm      1049: .Fl s
                   1050: option.
                   1051: .It Cm id : Ar key_id
                   1052: Revokes a certificate with the specified key ID string.
                   1053: The CA key must have been specified on the
                   1054: .Nm
1.114     jmc      1055: command line using the
1.111     djm      1056: .Fl s
                   1057: option.
                   1058: .It Cm key : Ar public_key
                   1059: Revokes the specified key.
1.112     jmc      1060: If a certificate is listed, then it is revoked as a plain public key.
1.111     djm      1061: .It Cm sha1 : Ar public_key
1.149     djm      1062: Revokes the specified key by including its SHA1 hash in the KRL.
                   1063: .It Cm sha256 : Ar public_key
                   1064: Revokes the specified key by including its SHA256 hash in the KRL.
                   1065: KRLs that revoke keys by SHA256 hash are not supported by OpenSSH versions
                   1066: prior to 7.9.
                   1067: .It Cm hash : Ar fingerprint
1.150     djm      1068: Revokes a key using a fingerprint hash, as obtained from a
1.149     djm      1069: .Xr sshd 8
                   1070: authentication log message or the
                   1071: .Nm
                   1072: .Fl l
                   1073: flag.
                   1074: Only SHA256 fingerprints are supported here and resultant KRLs are
                   1075: not supported by OpenSSH versions prior to 7.9.
1.111     djm      1076: .El
                   1077: .Pp
                   1078: KRLs may be updated using the
                   1079: .Fl u
                   1080: flag in addition to
                   1081: .Fl k .
1.114     jmc      1082: When this option is specified, keys listed via the command line are merged into
1.111     djm      1083: the KRL, adding to those already there.
                   1084: .Pp
                   1085: It is also possible, given a KRL, to test whether it revokes a particular key
                   1086: (or keys).
                   1087: The
                   1088: .Fl Q
1.128     jmc      1089: flag will query an existing KRL, testing each key specified on the command line.
1.114     jmc      1090: If any key listed on the command line has been revoked (or an error encountered)
1.111     djm      1091: then
                   1092: .Nm
                   1093: will exit with a non-zero exit status.
                   1094: A zero exit status will only be returned if no key was revoked.
1.163     djm      1095: .Sh ALLOWED SIGNERS
                   1096: When verifying signatures,
                   1097: .Nm
                   1098: uses a simple list of identities and keys to determine whether a signature
                   1099: comes from an authorized source.
                   1100: This "allowed signers" file uses a format patterned after the
                   1101: AUTHORIZED_KEYS FILE FORMAT described in
1.165     jmc      1102: .Xr sshd 8 .
1.163     djm      1103: Each line of the file contains the following space-separated fields:
                   1104: principals, options, keytype, base64-encoded key.
                   1105: Empty lines and lines starting with a
                   1106: .Ql #
                   1107: are ignored as comments.
                   1108: .Pp
                   1109: The principals field is a pattern-list (See PATTERNS in
                   1110: .Xr ssh_config 5 )
                   1111: consisting of one or more comma-separated USER@DOMAIN identity patterns
                   1112: that are accepted for signing.
                   1113: When verifying, the identity presented via the
1.172     jmc      1114: .Fl I
                   1115: option must match a principals pattern in order for the corresponding key to be
1.163     djm      1116: considered acceptable for verification.
                   1117: .Pp
                   1118: The options (if present) consist of comma-separated option specifications.
                   1119: No spaces are permitted, except within double quotes.
                   1120: The following option specifications are supported (note that option keywords
                   1121: are case-insensitive):
                   1122: .Bl -tag -width Ds
                   1123: .It Cm cert-authority
                   1124: Indicates that this key is accepted as a certificate authority (CA) and
                   1125: that certificates signed by this CA may be accepted for verification.
                   1126: .It Cm namespaces="namespace-list"
                   1127: Specifies a pattern-list of namespaces that are accepted for this key.
1.164     djm      1128: If this option is present, the signature namespace embedded in the
1.163     djm      1129: signature object and presented on the verification command-line must
                   1130: match the specified list before the key will be considered acceptable.
                   1131: .El
                   1132: .Pp
                   1133: When verifying signatures made by certificates, the expected principal
                   1134: name must match both the principals pattern in the allowed signers file and
                   1135: the principals embedded in the certificate itself.
                   1136: .Pp
                   1137: An example allowed signers file:
                   1138: .Bd -literal -offset 3n
                   1139: # Comments allowed at start of line
                   1140: user1@example.com,user2@example.com ssh-rsa AAAAX1...
                   1141: # A certificate authority, trusted for all principals in a domain.
                   1142: *@example.com cert-authority ssh-ed25519 AAAB4...
                   1143: # A key that is accepted only for file signing.
                   1144: user2@example.com namespaces="file" ssh-ed25519 AAA41...
                   1145: .Ed
1.173     naddy    1146: .Sh ENVIRONMENT
                   1147: .Bl -tag -width Ds
                   1148: .It Ev SSH_SK_PROVIDER
1.201     djm      1149: Specifies a path to a library that will be used when loading any
                   1150: FIDO authenticator-hosted keys, overriding the default of using
                   1151: the built-in USB HID support.
1.173     naddy    1152: .El
1.2       deraadt  1153: .Sh FILES
1.100     naddy    1154: .Bl -tag -width Ds -compact
1.68      djm      1155: .It Pa ~/.ssh/id_dsa
1.100     naddy    1156: .It Pa ~/.ssh/id_ecdsa
1.173     naddy    1157: .It Pa ~/.ssh/id_ecdsa_sk
1.118     naddy    1158: .It Pa ~/.ssh/id_ed25519
1.176     naddy    1159: .It Pa ~/.ssh/id_ed25519_sk
1.100     naddy    1160: .It Pa ~/.ssh/id_rsa
1.180     naddy    1161: Contains the DSA, ECDSA, authenticator-hosted ECDSA, Ed25519,
                   1162: authenticator-hosted Ed25519 or RSA authentication identity of the user.
1.15      deraadt  1163: This file should not be readable by anyone but the user.
                   1164: It is possible to
                   1165: specify a passphrase when generating the key; that passphrase will be
1.80      dtucker  1166: used to encrypt the private part of this file using 128-bit AES.
1.15      deraadt  1167: This file is not automatically accessed by
                   1168: .Nm
                   1169: but it is offered as the default file for the private key.
1.46      markus   1170: .Xr ssh 1
1.15      deraadt  1171: will read this file when a login attempt is made.
1.100     naddy    1172: .Pp
1.68      djm      1173: .It Pa ~/.ssh/id_dsa.pub
1.100     naddy    1174: .It Pa ~/.ssh/id_ecdsa.pub
1.173     naddy    1175: .It Pa ~/.ssh/id_ecdsa_sk.pub
1.118     naddy    1176: .It Pa ~/.ssh/id_ed25519.pub
1.176     naddy    1177: .It Pa ~/.ssh/id_ed25519_sk.pub
1.68      djm      1178: .It Pa ~/.ssh/id_rsa.pub
1.180     naddy    1179: Contains the DSA, ECDSA, authenticator-hosted ECDSA, Ed25519,
                   1180: authenticator-hosted Ed25519 or RSA public key for authentication.
1.15      deraadt  1181: The contents of this file should be added to
1.68      djm      1182: .Pa ~/.ssh/authorized_keys
1.15      deraadt  1183: on all machines
1.49      deraadt  1184: where the user wishes to log in using public key authentication.
1.12      aaron    1185: There is no need to keep the contents of this file secret.
1.100     naddy    1186: .Pp
1.60      djm      1187: .It Pa /etc/moduli
                   1188: Contains Diffie-Hellman groups used for DH-GEX.
                   1189: The file format is described in
                   1190: .Xr moduli 5 .
1.19      aaron    1191: .El
1.2       deraadt  1192: .Sh SEE ALSO
                   1193: .Xr ssh 1 ,
                   1194: .Xr ssh-add 1 ,
1.8       ericj    1195: .Xr ssh-agent 1 ,
1.60      djm      1196: .Xr moduli 5 ,
1.30      itojun   1197: .Xr sshd 8
1.37      markus   1198: .Rs
1.73      markus   1199: .%R RFC 4716
                   1200: .%T "The Secure Shell (SSH) Public Key File Format"
                   1201: .%D 2006
1.37      markus   1202: .Re
1.59      jmc      1203: .Sh AUTHORS
                   1204: OpenSSH is a derivative of the original and free
                   1205: ssh 1.2.12 release by Tatu Ylonen.
                   1206: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
                   1207: Theo de Raadt and Dug Song
                   1208: removed many bugs, re-added newer features and
                   1209: created OpenSSH.
                   1210: Markus Friedl contributed the support for SSH
                   1211: protocol versions 1.5 and 2.0.