[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.211

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