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

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