xref: /dflybsd-src/crypto/openssh/ssh-keygen.1 (revision ba1276acd1c8c22d225b1bcf370a14c878644f44)
1*ba1276acSMatthew Dillon.\"	$OpenBSD: ssh-keygen.1,v 1.232 2024/06/17 13:50:18 naddy Exp $
218de8d7fSPeter Avalos.\"
318de8d7fSPeter Avalos.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
418de8d7fSPeter Avalos.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
518de8d7fSPeter Avalos.\"                    All rights reserved
618de8d7fSPeter Avalos.\"
718de8d7fSPeter Avalos.\" As far as I am concerned, the code I have written for this software
818de8d7fSPeter Avalos.\" can be used freely for any purpose.  Any derived versions of this
918de8d7fSPeter Avalos.\" software must be clearly marked as such, and if the derived work is
1018de8d7fSPeter Avalos.\" incompatible with the protocol description in the RFC file, it must be
1118de8d7fSPeter Avalos.\" called by a name other than "ssh" or "Secure Shell".
1218de8d7fSPeter Avalos.\"
1318de8d7fSPeter Avalos.\"
1418de8d7fSPeter Avalos.\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
1518de8d7fSPeter Avalos.\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
1618de8d7fSPeter Avalos.\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
1718de8d7fSPeter Avalos.\"
1818de8d7fSPeter Avalos.\" Redistribution and use in source and binary forms, with or without
1918de8d7fSPeter Avalos.\" modification, are permitted provided that the following conditions
2018de8d7fSPeter Avalos.\" are met:
2118de8d7fSPeter Avalos.\" 1. Redistributions of source code must retain the above copyright
2218de8d7fSPeter Avalos.\"    notice, this list of conditions and the following disclaimer.
2318de8d7fSPeter Avalos.\" 2. Redistributions in binary form must reproduce the above copyright
2418de8d7fSPeter Avalos.\"    notice, this list of conditions and the following disclaimer in the
2518de8d7fSPeter Avalos.\"    documentation and/or other materials provided with the distribution.
2618de8d7fSPeter Avalos.\"
2718de8d7fSPeter Avalos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2818de8d7fSPeter Avalos.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2918de8d7fSPeter Avalos.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
3018de8d7fSPeter Avalos.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
3118de8d7fSPeter Avalos.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
3218de8d7fSPeter Avalos.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3318de8d7fSPeter Avalos.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3418de8d7fSPeter Avalos.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3518de8d7fSPeter Avalos.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3618de8d7fSPeter Avalos.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3718de8d7fSPeter Avalos.\"
38*ba1276acSMatthew Dillon.Dd $Mdocdate: June 17 2024 $
3918de8d7fSPeter Avalos.Dt SSH-KEYGEN 1
4018de8d7fSPeter Avalos.Os
4118de8d7fSPeter Avalos.Sh NAME
4218de8d7fSPeter Avalos.Nm ssh-keygen
430cbfa66cSDaniel Fojt.Nd OpenSSH authentication key utility
4418de8d7fSPeter Avalos.Sh SYNOPSIS
45856ea928SPeter Avalos.Nm ssh-keygen
4618de8d7fSPeter Avalos.Op Fl q
4750a69bb5SSascha Wildner.Op Fl a Ar rounds
4818de8d7fSPeter Avalos.Op Fl b Ar bits
4918de8d7fSPeter Avalos.Op Fl C Ar comment
5018de8d7fSPeter Avalos.Op Fl f Ar output_keyfile
51664f4763Szrj.Op Fl m Ar format
520cbfa66cSDaniel Fojt.Op Fl N Ar new_passphrase
530cbfa66cSDaniel Fojt.Op Fl O Ar option
54*ba1276acSMatthew Dillon.Op Fl t Cm ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
550cbfa66cSDaniel Fojt.Op Fl w Ar provider
5650a69bb5SSascha Wildner.Op Fl Z Ar cipher
5718de8d7fSPeter Avalos.Nm ssh-keygen
5818de8d7fSPeter Avalos.Fl p
5950a69bb5SSascha Wildner.Op Fl a Ar rounds
6018de8d7fSPeter Avalos.Op Fl f Ar keyfile
61664f4763Szrj.Op Fl m Ar format
620cbfa66cSDaniel Fojt.Op Fl N Ar new_passphrase
630cbfa66cSDaniel Fojt.Op Fl P Ar old_passphrase
6450a69bb5SSascha Wildner.Op Fl Z Ar cipher
6518de8d7fSPeter Avalos.Nm ssh-keygen
6618de8d7fSPeter Avalos.Fl i
6718de8d7fSPeter Avalos.Op Fl f Ar input_keyfile
680cbfa66cSDaniel Fojt.Op Fl m Ar key_format
6918de8d7fSPeter Avalos.Nm ssh-keygen
7018de8d7fSPeter Avalos.Fl e
7118de8d7fSPeter Avalos.Op Fl f Ar input_keyfile
720cbfa66cSDaniel Fojt.Op Fl m Ar key_format
7318de8d7fSPeter Avalos.Nm ssh-keygen
7418de8d7fSPeter Avalos.Fl y
7518de8d7fSPeter Avalos.Op Fl f Ar input_keyfile
7618de8d7fSPeter Avalos.Nm ssh-keygen
7718de8d7fSPeter Avalos.Fl c
7850a69bb5SSascha Wildner.Op Fl a Ar rounds
7918de8d7fSPeter Avalos.Op Fl C Ar comment
8018de8d7fSPeter Avalos.Op Fl f Ar keyfile
810cbfa66cSDaniel Fojt.Op Fl P Ar passphrase
8218de8d7fSPeter Avalos.Nm ssh-keygen
8318de8d7fSPeter Avalos.Fl l
84e9778795SPeter Avalos.Op Fl v
85e9778795SPeter Avalos.Op Fl E Ar fingerprint_hash
8618de8d7fSPeter Avalos.Op Fl f Ar input_keyfile
8718de8d7fSPeter Avalos.Nm ssh-keygen
8818de8d7fSPeter Avalos.Fl B
8918de8d7fSPeter Avalos.Op Fl f Ar input_keyfile
9018de8d7fSPeter Avalos.Nm ssh-keygen
91856ea928SPeter Avalos.Fl D Ar pkcs11
9218de8d7fSPeter Avalos.Nm ssh-keygen
9318de8d7fSPeter Avalos.Fl F Ar hostname
940cbfa66cSDaniel Fojt.Op Fl lv
9518de8d7fSPeter Avalos.Op Fl f Ar known_hosts_file
9618de8d7fSPeter Avalos.Nm ssh-keygen
9718de8d7fSPeter Avalos.Fl H
9818de8d7fSPeter Avalos.Op Fl f Ar known_hosts_file
9918de8d7fSPeter Avalos.Nm ssh-keygen
1000cbfa66cSDaniel Fojt.Fl K
10150a69bb5SSascha Wildner.Op Fl a Ar rounds
1020cbfa66cSDaniel Fojt.Op Fl w Ar provider
1030cbfa66cSDaniel Fojt.Nm ssh-keygen
10418de8d7fSPeter Avalos.Fl R Ar hostname
10518de8d7fSPeter Avalos.Op Fl f Ar known_hosts_file
10618de8d7fSPeter Avalos.Nm ssh-keygen
10718de8d7fSPeter Avalos.Fl r Ar hostname
10818de8d7fSPeter Avalos.Op Fl g
1090cbfa66cSDaniel Fojt.Op Fl f Ar input_keyfile
11018de8d7fSPeter Avalos.Nm ssh-keygen
1110cbfa66cSDaniel Fojt.Fl M Cm generate
1120cbfa66cSDaniel Fojt.Op Fl O Ar option
1130cbfa66cSDaniel Fojt.Ar output_file
11418de8d7fSPeter Avalos.Nm ssh-keygen
1150cbfa66cSDaniel Fojt.Fl M Cm screen
1160cbfa66cSDaniel Fojt.Op Fl f Ar input_file
1170cbfa66cSDaniel Fojt.Op Fl O Ar option
1180cbfa66cSDaniel Fojt.Ar output_file
119856ea928SPeter Avalos.Nm ssh-keygen
120856ea928SPeter Avalos.Fl I Ar certificate_identity
1210cbfa66cSDaniel Fojt.Fl s Ar ca_key
1220cbfa66cSDaniel Fojt.Op Fl hU
123ce74bacaSMatthew Dillon.Op Fl D Ar pkcs11_provider
124856ea928SPeter Avalos.Op Fl n Ar principals
125856ea928SPeter Avalos.Op Fl O Ar option
126856ea928SPeter Avalos.Op Fl V Ar validity_interval
127856ea928SPeter Avalos.Op Fl z Ar serial_number
128856ea928SPeter Avalos.Ar
129856ea928SPeter Avalos.Nm ssh-keygen
130856ea928SPeter Avalos.Fl L
131856ea928SPeter Avalos.Op Fl f Ar input_keyfile
1321c188a7fSPeter Avalos.Nm ssh-keygen
1331c188a7fSPeter Avalos.Fl A
13450a69bb5SSascha Wildner.Op Fl a Ar rounds
135ce74bacaSMatthew Dillon.Op Fl f Ar prefix_path
13636e94dc5SPeter Avalos.Nm ssh-keygen
13736e94dc5SPeter Avalos.Fl k
13836e94dc5SPeter Avalos.Fl f Ar krl_file
13936e94dc5SPeter Avalos.Op Fl u
14036e94dc5SPeter Avalos.Op Fl s Ar ca_public
14136e94dc5SPeter Avalos.Op Fl z Ar version_number
14236e94dc5SPeter Avalos.Ar
14336e94dc5SPeter Avalos.Nm ssh-keygen
14436e94dc5SPeter Avalos.Fl Q
1450cbfa66cSDaniel Fojt.Op Fl l
14636e94dc5SPeter Avalos.Fl f Ar krl_file
14736e94dc5SPeter Avalos.Ar
1480cbfa66cSDaniel Fojt.Nm ssh-keygen
1490cbfa66cSDaniel Fojt.Fl Y Cm find-principals
15050a69bb5SSascha Wildner.Op Fl O Ar option
1510cbfa66cSDaniel Fojt.Fl s Ar signature_file
1520cbfa66cSDaniel Fojt.Fl f Ar allowed_signers_file
1530cbfa66cSDaniel Fojt.Nm ssh-keygen
154ee116499SAntonio Huete Jimenez.Fl Y Cm match-principals
155ee116499SAntonio Huete Jimenez.Fl I Ar signer_identity
156ee116499SAntonio Huete Jimenez.Fl f Ar allowed_signers_file
157ee116499SAntonio Huete Jimenez.Nm ssh-keygen
1580cbfa66cSDaniel Fojt.Fl Y Cm check-novalidate
15950a69bb5SSascha Wildner.Op Fl O Ar option
1600cbfa66cSDaniel Fojt.Fl n Ar namespace
1610cbfa66cSDaniel Fojt.Fl s Ar signature_file
1620cbfa66cSDaniel Fojt.Nm ssh-keygen
1630cbfa66cSDaniel Fojt.Fl Y Cm sign
164ee116499SAntonio Huete Jimenez.Op Fl O Ar option
1650cbfa66cSDaniel Fojt.Fl f Ar key_file
1660cbfa66cSDaniel Fojt.Fl n Ar namespace
1670cbfa66cSDaniel Fojt.Ar
1680cbfa66cSDaniel Fojt.Nm ssh-keygen
1690cbfa66cSDaniel Fojt.Fl Y Cm verify
17050a69bb5SSascha Wildner.Op Fl O Ar option
1710cbfa66cSDaniel Fojt.Fl f Ar allowed_signers_file
1720cbfa66cSDaniel Fojt.Fl I Ar signer_identity
1730cbfa66cSDaniel Fojt.Fl n Ar namespace
1740cbfa66cSDaniel Fojt.Fl s Ar signature_file
1750cbfa66cSDaniel Fojt.Op Fl r Ar revocation_file
17618de8d7fSPeter Avalos.Sh DESCRIPTION
17718de8d7fSPeter Avalos.Nm
17818de8d7fSPeter Avalosgenerates, manages and converts authentication keys for
17918de8d7fSPeter Avalos.Xr ssh 1 .
18018de8d7fSPeter Avalos.Nm
181ce74bacaSMatthew Dilloncan create keys for use by SSH protocol version 2.
182e9778795SPeter Avalos.Pp
18318de8d7fSPeter AvalosThe type of key to be generated is specified with the
18418de8d7fSPeter Avalos.Fl t
18518de8d7fSPeter Avalosoption.
18618de8d7fSPeter AvalosIf invoked without any arguments,
18718de8d7fSPeter Avalos.Nm
188*ba1276acSMatthew Dillonwill generate an Ed25519 key.
18918de8d7fSPeter Avalos.Pp
19018de8d7fSPeter Avalos.Nm
19118de8d7fSPeter Avalosis also used to generate groups for use in Diffie-Hellman group
19218de8d7fSPeter Avalosexchange (DH-GEX).
19318de8d7fSPeter AvalosSee the
19418de8d7fSPeter Avalos.Sx MODULI GENERATION
19518de8d7fSPeter Avalossection for details.
19618de8d7fSPeter Avalos.Pp
19736e94dc5SPeter AvalosFinally,
19836e94dc5SPeter Avalos.Nm
19936e94dc5SPeter Avaloscan be used to generate and update Key Revocation Lists, and to test whether
20036e94dc5SPeter Avalosgiven keys have been revoked by one.
20136e94dc5SPeter AvalosSee the
20236e94dc5SPeter Avalos.Sx KEY REVOCATION LISTS
20336e94dc5SPeter Avalossection for details.
20436e94dc5SPeter Avalos.Pp
20518de8d7fSPeter AvalosNormally each user wishing to use SSH
2069f304aafSPeter Avaloswith public key authentication runs this once to create the authentication
20718de8d7fSPeter Avaloskey in
2089f304aafSPeter Avalos.Pa ~/.ssh/id_ecdsa ,
2090cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ecdsa_sk ,
2100cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ed25519 ,
2110cbfa66cSDaniel Fojt.Pa ~/.ssh/id_ed25519_sk
21218de8d7fSPeter Avalosor
21318de8d7fSPeter Avalos.Pa ~/.ssh/id_rsa .
21418de8d7fSPeter AvalosAdditionally, the system administrator may use this to generate host keys,
21518de8d7fSPeter Avalosas seen in
21618de8d7fSPeter Avalos.Pa /etc/rc .
21718de8d7fSPeter Avalos.Pp
21818de8d7fSPeter AvalosNormally this program generates the key and asks for a file in which
21918de8d7fSPeter Avalosto store the private key.
22018de8d7fSPeter AvalosThe public key is stored in a file with the same name but
22118de8d7fSPeter Avalos.Dq .pub
22218de8d7fSPeter Avalosappended.
22318de8d7fSPeter AvalosThe program also asks for a passphrase.
22418de8d7fSPeter AvalosThe passphrase may be empty to indicate no passphrase
22518de8d7fSPeter Avalos(host keys must have an empty passphrase), or it may be a string of
22618de8d7fSPeter Avalosarbitrary length.
22718de8d7fSPeter AvalosA passphrase is similar to a password, except it can be a phrase with a
22818de8d7fSPeter Avalosseries of words, punctuation, numbers, whitespace, or any string of
22918de8d7fSPeter Avaloscharacters you want.
23018de8d7fSPeter AvalosGood passphrases are 10-30 characters long, are
23118de8d7fSPeter Avalosnot simple sentences or otherwise easily guessable (English
23218de8d7fSPeter Avalosprose has only 1-2 bits of entropy per character, and provides very bad
23318de8d7fSPeter Avalospassphrases), and contain a mix of upper and lowercase letters,
23418de8d7fSPeter Avalosnumbers, and non-alphanumeric characters.
23518de8d7fSPeter AvalosThe passphrase can be changed later by using the
23618de8d7fSPeter Avalos.Fl p
23718de8d7fSPeter Avalosoption.
23818de8d7fSPeter Avalos.Pp
23918de8d7fSPeter AvalosThere is no way to recover a lost passphrase.
2401c188a7fSPeter AvalosIf the passphrase is lost or forgotten, a new key must be generated
2411c188a7fSPeter Avalosand the corresponding public key copied to other machines.
24218de8d7fSPeter Avalos.Pp
243664f4763Szrj.Nm
244664f4763Szrjwill by default write keys in an OpenSSH-specific format.
245664f4763SzrjThis format is preferred as it offers better protection for
246664f4763Szrjkeys at rest as well as allowing storage of key comments within
247664f4763Szrjthe private key file itself.
248664f4763SzrjThe key comment may be useful to help identify the key.
24918de8d7fSPeter AvalosThe comment is initialized to
25018de8d7fSPeter Avalos.Dq user@host
25118de8d7fSPeter Avaloswhen the key is created, but can be changed using the
25218de8d7fSPeter Avalos.Fl c
25318de8d7fSPeter Avalosoption.
25418de8d7fSPeter Avalos.Pp
255664f4763SzrjIt is still possible for
256664f4763Szrj.Nm
257664f4763Szrjto write the previously-used PEM format private keys using the
258664f4763Szrj.Fl m
259664f4763Szrjflag.
260664f4763SzrjThis may be used when generating new keys, and existing new-format
261664f4763Szrjkeys may be converted using this option in conjunction with the
262664f4763Szrj.Fl p
263664f4763Szrj(change passphrase) flag.
264664f4763Szrj.Pp
26550a69bb5SSascha WildnerAfter a key is generated,
26650a69bb5SSascha Wildner.Nm
26750a69bb5SSascha Wildnerwill ask where the keys
26818de8d7fSPeter Avalosshould be placed to be activated.
26918de8d7fSPeter Avalos.Pp
27018de8d7fSPeter AvalosThe options are as follows:
27118de8d7fSPeter Avalos.Bl -tag -width Ds
2721c188a7fSPeter Avalos.It Fl A
273ee116499SAntonio Huete JimenezGenerate host keys of all default key types (rsa, ecdsa, and
274ee116499SAntonio Huete Jimenezed25519) if they do not already exist.
275ee116499SAntonio Huete JimenezThe host keys are generated with the default key file path,
2761c188a7fSPeter Avalosan empty passphrase, default bits for the key type, and default comment.
277ce74bacaSMatthew DillonIf
278ce74bacaSMatthew Dillon.Fl f
279ce74bacaSMatthew Dillonhas also been specified, its argument is used as a prefix to the
280ce74bacaSMatthew Dillondefault path for the resulting host key files.
2811c188a7fSPeter AvalosThis is used by
2821c188a7fSPeter Avalos.Pa /etc/rc
2831c188a7fSPeter Avalosto generate new host keys.
28436e94dc5SPeter Avalos.It Fl a Ar rounds
2850cbfa66cSDaniel FojtWhen saving a private key, this option specifies the number of KDF
28650a69bb5SSascha Wildner(key derivation function, currently
28750a69bb5SSascha Wildner.Xr bcrypt_pbkdf 3 )
28850a69bb5SSascha Wildnerrounds used.
28936e94dc5SPeter AvalosHigher numbers result in slower passphrase verification and increased
29036e94dc5SPeter Avalosresistance to brute-force password cracking (should the keys be stolen).
29150a69bb5SSascha WildnerThe default is 16 rounds.
29218de8d7fSPeter Avalos.It Fl B
29318de8d7fSPeter AvalosShow the bubblebabble digest of specified private or public key file.
29418de8d7fSPeter Avalos.It Fl b Ar bits
29518de8d7fSPeter AvalosSpecifies the number of bits in the key to create.
2960cbfa66cSDaniel FojtFor RSA keys, the minimum size is 1024 bits and the default is 3072 bits.
2970cbfa66cSDaniel FojtGenerally, 3072 bits is considered sufficient.
2981c188a7fSPeter AvalosFor ECDSA keys, the
2991c188a7fSPeter Avalos.Fl b
30099e85e0dSPeter Avalosflag determines the key length by selecting from one of three elliptic
3011c188a7fSPeter Avaloscurve sizes: 256, 384 or 521 bits.
3021c188a7fSPeter AvalosAttempting to use bit lengths other than these three values for ECDSA keys
3031c188a7fSPeter Avaloswill fail.
3040cbfa66cSDaniel FojtECDSA-SK, Ed25519 and Ed25519-SK keys have a fixed length and the
30536e94dc5SPeter Avalos.Fl b
30636e94dc5SPeter Avalosflag will be ignored.
30718de8d7fSPeter Avalos.It Fl C Ar comment
30818de8d7fSPeter AvalosProvides a new comment.
30918de8d7fSPeter Avalos.It Fl c
31018de8d7fSPeter AvalosRequests changing the comment in the private and public key files.
31118de8d7fSPeter AvalosThe program will prompt for the file containing the private keys, for
31218de8d7fSPeter Avalosthe passphrase if the key has one, and for the new comment.
313856ea928SPeter Avalos.It Fl D Ar pkcs11
314664f4763SzrjDownload the public keys provided by the PKCS#11 shared library
315856ea928SPeter Avalos.Ar pkcs11 .
316856ea928SPeter AvalosWhen used in combination with
317856ea928SPeter Avalos.Fl s ,
318856ea928SPeter Avalosthis option indicates that a CA key resides in a PKCS#11 token (see the
319856ea928SPeter Avalos.Sx CERTIFICATES
320856ea928SPeter Avalossection for details).
321e9778795SPeter Avalos.It Fl E Ar fingerprint_hash
322e9778795SPeter AvalosSpecifies the hash algorithm used when displaying key fingerprints.
323e9778795SPeter AvalosValid options are:
324e9778795SPeter Avalos.Dq md5
325e9778795SPeter Avalosand
326e9778795SPeter Avalos.Dq sha256 .
327e9778795SPeter AvalosThe default is
328e9778795SPeter Avalos.Dq sha256 .
32918de8d7fSPeter Avalos.It Fl e
33018de8d7fSPeter AvalosThis option will read a private or public OpenSSH key file and
331664f4763Szrjprint to stdout a public key in one of the formats specified by the
332856ea928SPeter Avalos.Fl m
333856ea928SPeter Avalosoption.
334856ea928SPeter AvalosThe default export format is
335856ea928SPeter Avalos.Dq RFC4716 .
336856ea928SPeter AvalosThis option allows exporting OpenSSH keys for use by other programs, including
337856ea928SPeter Avalosseveral commercial SSH implementations.
338664f4763Szrj.It Fl F Ar hostname | [hostname]:port
33918de8d7fSPeter AvalosSearch for the specified
34018de8d7fSPeter Avalos.Ar hostname
341664f4763Szrj(with optional port number)
34218de8d7fSPeter Avalosin a
34318de8d7fSPeter Avalos.Pa known_hosts
34418de8d7fSPeter Avalosfile, listing any occurrences found.
34518de8d7fSPeter AvalosThis option is useful to find hashed host names or addresses and may also be
34618de8d7fSPeter Avalosused in conjunction with the
34718de8d7fSPeter Avalos.Fl H
34818de8d7fSPeter Avalosoption to print found keys in a hashed format.
34918de8d7fSPeter Avalos.It Fl f Ar filename
35018de8d7fSPeter AvalosSpecifies the filename of the key file.
35118de8d7fSPeter Avalos.It Fl g
35218de8d7fSPeter AvalosUse generic DNS format when printing fingerprint resource records using the
35318de8d7fSPeter Avalos.Fl r
35418de8d7fSPeter Avaloscommand.
35518de8d7fSPeter Avalos.It Fl H
35618de8d7fSPeter AvalosHash a
35718de8d7fSPeter Avalos.Pa known_hosts
35818de8d7fSPeter Avalosfile.
35918de8d7fSPeter AvalosThis replaces all hostnames and addresses with hashed representations
36018de8d7fSPeter Avaloswithin the specified file; the original content is moved to a file with
36118de8d7fSPeter Avalosa .old suffix.
36218de8d7fSPeter AvalosThese hashes may be used normally by
36318de8d7fSPeter Avalos.Nm ssh
36418de8d7fSPeter Avalosand
36518de8d7fSPeter Avalos.Nm sshd ,
36618de8d7fSPeter Avalosbut they do not reveal identifying information should the file's contents
36718de8d7fSPeter Avalosbe disclosed.
36818de8d7fSPeter AvalosThis option will not modify existing hashed hostnames and is therefore safe
36918de8d7fSPeter Avalosto use on files that mix hashed and non-hashed names.
370856ea928SPeter Avalos.It Fl h
371856ea928SPeter AvalosWhen signing a key, create a host certificate instead of a user
372856ea928SPeter Avaloscertificate.
373ee116499SAntonio Huete JimenezSee the
374856ea928SPeter Avalos.Sx CERTIFICATES
375856ea928SPeter Avalossection for details.
376856ea928SPeter Avalos.It Fl I Ar certificate_identity
377856ea928SPeter AvalosSpecify the key identity when signing a public key.
378ee116499SAntonio Huete JimenezSee the
379856ea928SPeter Avalos.Sx CERTIFICATES
380856ea928SPeter Avalossection for details.
38118de8d7fSPeter Avalos.It Fl i
38218de8d7fSPeter AvalosThis option will read an unencrypted private (or public) key file
383856ea928SPeter Avalosin the format specified by the
384856ea928SPeter Avalos.Fl m
385856ea928SPeter Avalosoption and print an OpenSSH compatible private
38618de8d7fSPeter Avalos(or public) key to stdout.
38736e94dc5SPeter AvalosThis option allows importing keys from other software, including several
38836e94dc5SPeter Avaloscommercial SSH implementations.
38936e94dc5SPeter AvalosThe default import format is
39036e94dc5SPeter Avalos.Dq RFC4716 .
3910cbfa66cSDaniel Fojt.It Fl K
3920cbfa66cSDaniel FojtDownload resident keys from a FIDO authenticator.
3930cbfa66cSDaniel FojtPublic and private key files will be written to the current directory for
3940cbfa66cSDaniel Fojteach downloaded key.
39550a69bb5SSascha WildnerIf multiple FIDO authenticators are attached, keys will be downloaded from
39650a69bb5SSascha Wildnerthe first touched authenticator.
397ee116499SAntonio Huete JimenezSee the
398ee116499SAntonio Huete Jimenez.Sx FIDO AUTHENTICATOR
399ee116499SAntonio Huete Jimenezsection for more information.
40036e94dc5SPeter Avalos.It Fl k
40136e94dc5SPeter AvalosGenerate a KRL file.
40236e94dc5SPeter AvalosIn this mode,
40336e94dc5SPeter Avalos.Nm
40436e94dc5SPeter Avaloswill generate a KRL file at the location specified via the
40536e94dc5SPeter Avalos.Fl f
40636e94dc5SPeter Avalosflag that revokes every key or certificate presented on the command line.
40736e94dc5SPeter AvalosKeys/certificates to be revoked may be specified by public key file or
40836e94dc5SPeter Avalosusing the format described in the
40936e94dc5SPeter Avalos.Sx KEY REVOCATION LISTS
41036e94dc5SPeter Avalossection.
411856ea928SPeter Avalos.It Fl L
412e9778795SPeter AvalosPrints the contents of one or more certificates.
41318de8d7fSPeter Avalos.It Fl l
41418de8d7fSPeter AvalosShow fingerprint of specified public key file.
41518de8d7fSPeter Avalos.Nm
416*ba1276acSMatthew Dillonwill try to find the matching public key file and prints its fingerprint.
41718de8d7fSPeter AvalosIf combined with
41818de8d7fSPeter Avalos.Fl v ,
419e9778795SPeter Avalosa visual ASCII art representation of the key is supplied with the
420e9778795SPeter Avalosfingerprint.
4210cbfa66cSDaniel Fojt.It Fl M Cm generate
4220cbfa66cSDaniel FojtGenerate candidate Diffie-Hellman Group Exchange (DH-GEX) parameters for
4230cbfa66cSDaniel Fojteventual use by the
4240cbfa66cSDaniel Fojt.Sq diffie-hellman-group-exchange-*
4250cbfa66cSDaniel Fojtkey exchange methods.
4260cbfa66cSDaniel FojtThe numbers generated by this operation must be further screened before
4270cbfa66cSDaniel Fojtuse.
4280cbfa66cSDaniel FojtSee the
4290cbfa66cSDaniel Fojt.Sx MODULI GENERATION
4300cbfa66cSDaniel Fojtsection for more information.
4310cbfa66cSDaniel Fojt.It Fl M Cm screen
4320cbfa66cSDaniel FojtScreen candidate parameters for Diffie-Hellman Group Exchange.
4330cbfa66cSDaniel FojtThis will accept a list of candidate numbers and test that they are
4340cbfa66cSDaniel Fojtsafe (Sophie Germain) primes with acceptable group generators.
4350cbfa66cSDaniel FojtThe results of this operation may be added to the
4360cbfa66cSDaniel Fojt.Pa /etc/moduli
4370cbfa66cSDaniel Fojtfile.
4380cbfa66cSDaniel FojtSee the
4390cbfa66cSDaniel Fojt.Sx MODULI GENERATION
4400cbfa66cSDaniel Fojtsection for more information.
441856ea928SPeter Avalos.It Fl m Ar key_format
442664f4763SzrjSpecify a key format for key generation, the
443856ea928SPeter Avalos.Fl i
444664f4763Szrj(import),
445856ea928SPeter Avalos.Fl e
446664f4763Szrj(export) conversion options, and the
447664f4763Szrj.Fl p
448664f4763Szrjchange passphrase operation.
449664f4763SzrjThe latter may be used to convert between OpenSSH private key and PEM
450664f4763Szrjprivate key formats.
451856ea928SPeter AvalosThe supported key formats are:
452856ea928SPeter Avalos.Dq RFC4716
453856ea928SPeter Avalos(RFC 4716/SSH2 public or private key),
454856ea928SPeter Avalos.Dq PKCS8
4550cbfa66cSDaniel Fojt(PKCS8 public or private key)
456856ea928SPeter Avalosor
457856ea928SPeter Avalos.Dq PEM
458856ea928SPeter Avalos(PEM public key).
4590cbfa66cSDaniel FojtBy default OpenSSH will write newly-generated private keys in its own
4600cbfa66cSDaniel Fojtformat, but when converting public keys for export the default format is
461856ea928SPeter Avalos.Dq RFC4716 .
462664f4763SzrjSetting a format of
463664f4763Szrj.Dq PEM
464664f4763Szrjwhen generating or updating a supported private key type will cause the
465664f4763Szrjkey to be stored in the legacy PEM private key format.
46618de8d7fSPeter Avalos.It Fl N Ar new_passphrase
46718de8d7fSPeter AvalosProvides the new passphrase.
468856ea928SPeter Avalos.It Fl n Ar principals
469856ea928SPeter AvalosSpecify one or more principals (user or host names) to be included in
470856ea928SPeter Avalosa certificate when signing a key.
471856ea928SPeter AvalosMultiple principals may be specified, separated by commas.
472ee116499SAntonio Huete JimenezSee the
473856ea928SPeter Avalos.Sx CERTIFICATES
474856ea928SPeter Avalossection for details.
475856ea928SPeter Avalos.It Fl O Ar option
4760cbfa66cSDaniel FojtSpecify a key/value option.
4770cbfa66cSDaniel FojtThese are specific to the operation that
4780cbfa66cSDaniel Fojt.Nm
4790cbfa66cSDaniel Fojthas been requested to perform.
480664f4763Szrj.Pp
4810cbfa66cSDaniel FojtWhen signing certificates, one of the options listed in the
4820cbfa66cSDaniel Fojt.Sx CERTIFICATES
4830cbfa66cSDaniel Fojtsection may be specified here.
4840cbfa66cSDaniel Fojt.Pp
4850cbfa66cSDaniel FojtWhen performing moduli generation or screening, one of the options
4860cbfa66cSDaniel Fojtlisted in the
4870cbfa66cSDaniel Fojt.Sx MODULI GENERATION
4880cbfa66cSDaniel Fojtsection may be specified.
4890cbfa66cSDaniel Fojt.Pp
490ee116499SAntonio Huete JimenezWhen generating FIDO authenticator-backed keys, the options listed in the
491ee116499SAntonio Huete Jimenez.Sx FIDO AUTHENTICATOR
492ee116499SAntonio Huete Jimenezsection may be specified.
49350a69bb5SSascha Wildner.Pp
49450a69bb5SSascha WildnerWhen performing signature-related options using the
49550a69bb5SSascha Wildner.Fl Y
49650a69bb5SSascha Wildnerflag, the following options are accepted:
49750a69bb5SSascha Wildner.Bl -tag -width Ds
498ee116499SAntonio Huete Jimenez.It Cm hashalg Ns = Ns Ar algorithm
499ee116499SAntonio Huete JimenezSelects the hash algorithm to use for hashing the message to be signed.
500ee116499SAntonio Huete JimenezValid algorithms are
501ee116499SAntonio Huete Jimenez.Dq sha256
502ee116499SAntonio Huete Jimenezand
503ee116499SAntonio Huete Jimenez.Dq sha512.
504ee116499SAntonio Huete JimenezThe default is
505ee116499SAntonio Huete Jimenez.Dq sha512.
50650a69bb5SSascha Wildner.It Cm print-pubkey
50750a69bb5SSascha WildnerPrint the full public key to standard output after signature verification.
50850a69bb5SSascha Wildner.It Cm verify-time Ns = Ns Ar timestamp
50950a69bb5SSascha WildnerSpecifies a time to use when validating signatures instead of the current
51050a69bb5SSascha Wildnertime.
511ee116499SAntonio Huete JimenezThe time may be specified as a date or time in the YYYYMMDD[Z] or
512ee116499SAntonio Huete Jimenezin YYYYMMDDHHMM[SS][Z] formats.
513ee116499SAntonio Huete JimenezDates and times will be interpreted in the current system time zone unless
514ee116499SAntonio Huete Jimenezsuffixed with a Z character, which causes them to be interpreted in the
515ee116499SAntonio Huete JimenezUTC time zone.
5160cbfa66cSDaniel Fojt.El
5170cbfa66cSDaniel Fojt.Pp
518*ba1276acSMatthew DillonWhen generating SSHFP DNS records from public keys using the
519*ba1276acSMatthew Dillon.Fl r
520*ba1276acSMatthew Dillonflag, the following options are accepted:
521*ba1276acSMatthew Dillon.Bl -tag -width Ds
522*ba1276acSMatthew Dillon.It Cm hashalg Ns = Ns Ar algorithm
523*ba1276acSMatthew DillonSelects a hash algorithm to use when printing SSHFP records using the
524*ba1276acSMatthew Dillon.Fl D
525*ba1276acSMatthew Dillonflag.
526*ba1276acSMatthew DillonValid algorithms are
527*ba1276acSMatthew Dillon.Dq sha1
528*ba1276acSMatthew Dillonand
529*ba1276acSMatthew Dillon.Dq sha256 .
530*ba1276acSMatthew DillonThe default is to print both.
531*ba1276acSMatthew Dillon.El
532*ba1276acSMatthew Dillon.Pp
5330cbfa66cSDaniel FojtThe
5340cbfa66cSDaniel Fojt.Fl O
5350cbfa66cSDaniel Fojtoption may be specified multiple times.
5360cbfa66cSDaniel Fojt.It Fl P Ar passphrase
5370cbfa66cSDaniel FojtProvides the (old) passphrase.
5380cbfa66cSDaniel Fojt.It Fl p
5390cbfa66cSDaniel FojtRequests changing the passphrase of a private key file instead of
5400cbfa66cSDaniel Fojtcreating a new private key.
5410cbfa66cSDaniel FojtThe program will prompt for the file
5420cbfa66cSDaniel Fojtcontaining the private key, for the old passphrase, and twice for the
5430cbfa66cSDaniel Fojtnew passphrase.
5440cbfa66cSDaniel Fojt.It Fl Q
5450cbfa66cSDaniel FojtTest whether keys have been revoked in a KRL.
5460cbfa66cSDaniel FojtIf the
5470cbfa66cSDaniel Fojt.Fl l
5480cbfa66cSDaniel Fojtoption is also specified then the contents of the KRL will be printed.
5490cbfa66cSDaniel Fojt.It Fl q
5500cbfa66cSDaniel FojtSilence
5510cbfa66cSDaniel Fojt.Nm ssh-keygen .
5520cbfa66cSDaniel Fojt.It Fl R Ar hostname | [hostname]:port
5530cbfa66cSDaniel FojtRemoves all keys belonging to the specified
5540cbfa66cSDaniel Fojt.Ar hostname
5550cbfa66cSDaniel Fojt(with optional port number)
5560cbfa66cSDaniel Fojtfrom a
5570cbfa66cSDaniel Fojt.Pa known_hosts
5580cbfa66cSDaniel Fojtfile.
5590cbfa66cSDaniel FojtThis option is useful to delete hashed hosts (see the
5600cbfa66cSDaniel Fojt.Fl H
5610cbfa66cSDaniel Fojtoption above).
5620cbfa66cSDaniel Fojt.It Fl r Ar hostname
5630cbfa66cSDaniel FojtPrint the SSHFP fingerprint resource record named
5640cbfa66cSDaniel Fojt.Ar hostname
5650cbfa66cSDaniel Fojtfor the specified public key file.
5660cbfa66cSDaniel Fojt.It Fl s Ar ca_key
5670cbfa66cSDaniel FojtCertify (sign) a public key using the specified CA key.
568ee116499SAntonio Huete JimenezSee the
5690cbfa66cSDaniel Fojt.Sx CERTIFICATES
5700cbfa66cSDaniel Fojtsection for details.
5710cbfa66cSDaniel Fojt.Pp
5720cbfa66cSDaniel FojtWhen generating a KRL,
5730cbfa66cSDaniel Fojt.Fl s
5740cbfa66cSDaniel Fojtspecifies a path to a CA public key file used to revoke certificates directly
5750cbfa66cSDaniel Fojtby key ID or serial number.
5760cbfa66cSDaniel FojtSee the
5770cbfa66cSDaniel Fojt.Sx KEY REVOCATION LISTS
5780cbfa66cSDaniel Fojtsection for details.
579*ba1276acSMatthew Dillon.It Fl t Cm ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
5800cbfa66cSDaniel FojtSpecifies the type of key to create.
5810cbfa66cSDaniel FojtThe possible values are
5820cbfa66cSDaniel Fojt.Dq ecdsa ,
5830cbfa66cSDaniel Fojt.Dq ecdsa-sk ,
5840cbfa66cSDaniel Fojt.Dq ed25519 ,
5850cbfa66cSDaniel Fojt.Dq ed25519-sk ,
5860cbfa66cSDaniel Fojtor
5870cbfa66cSDaniel Fojt.Dq rsa .
5880cbfa66cSDaniel Fojt.Pp
5890cbfa66cSDaniel FojtThis flag may also be used to specify the desired signature type when
5900cbfa66cSDaniel Fojtsigning certificates using an RSA CA key.
5910cbfa66cSDaniel FojtThe available RSA signature variants are
5920cbfa66cSDaniel Fojt.Dq ssh-rsa
5930cbfa66cSDaniel Fojt(SHA1 signatures, not recommended),
5940cbfa66cSDaniel Fojt.Dq rsa-sha2-256 ,
5950cbfa66cSDaniel Fojtand
5960cbfa66cSDaniel Fojt.Dq rsa-sha2-512
5970cbfa66cSDaniel Fojt(the default).
5980cbfa66cSDaniel Fojt.It Fl U
5990cbfa66cSDaniel FojtWhen used in combination with
600ee116499SAntonio Huete Jimenez.Fl s
601ee116499SAntonio Huete Jimenezor
602ee116499SAntonio Huete Jimenez.Fl Y Cm sign ,
6030cbfa66cSDaniel Fojtthis option indicates that a CA key resides in a
6040cbfa66cSDaniel Fojt.Xr ssh-agent 1 .
6050cbfa66cSDaniel FojtSee the
6060cbfa66cSDaniel Fojt.Sx CERTIFICATES
6070cbfa66cSDaniel Fojtsection for more information.
6080cbfa66cSDaniel Fojt.It Fl u
6090cbfa66cSDaniel FojtUpdate a KRL.
6100cbfa66cSDaniel FojtWhen specified with
6110cbfa66cSDaniel Fojt.Fl k ,
6120cbfa66cSDaniel Fojtkeys listed via the command line are added to the existing KRL rather than
6130cbfa66cSDaniel Fojta new KRL being created.
6140cbfa66cSDaniel Fojt.It Fl V Ar validity_interval
6150cbfa66cSDaniel FojtSpecify a validity interval when signing a certificate.
6160cbfa66cSDaniel FojtA validity interval may consist of a single time, indicating that the
6170cbfa66cSDaniel Fojtcertificate is valid beginning now and expiring at that time, or may consist
6180cbfa66cSDaniel Fojtof two times separated by a colon to indicate an explicit time interval.
6190cbfa66cSDaniel Fojt.Pp
620ee116499SAntonio Huete JimenezThe start time may be specified as:
621ee116499SAntonio Huete Jimenez.Bl -bullet -compact
622ee116499SAntonio Huete Jimenez.It
623ee116499SAntonio Huete JimenezThe string
6240cbfa66cSDaniel Fojt.Dq always
625ee116499SAntonio Huete Jimenezto indicate the certificate has no specified start time.
626ee116499SAntonio Huete Jimenez.It
627ee116499SAntonio Huete JimenezA date or time in the system time zone formatted as YYYYMMDD or
628ee116499SAntonio Huete JimenezYYYYMMDDHHMM[SS].
629ee116499SAntonio Huete Jimenez.It
630ee116499SAntonio Huete JimenezA date or time in the UTC time zone as YYYYMMDDZ or YYYYMMDDHHMM[SS]Z.
631ee116499SAntonio Huete Jimenez.It
632ee116499SAntonio Huete JimenezA relative time before the current system time consisting of a minus sign
633ee116499SAntonio Huete Jimenezfollowed by an interval in the format described in the
6340cbfa66cSDaniel FojtTIME FORMATS section of
6350cbfa66cSDaniel Fojt.Xr sshd_config 5 .
636ee116499SAntonio Huete Jimenez.It
637ee116499SAntonio Huete JimenezA raw seconds since epoch (Jan 1 1970 00:00:00 UTC) as a hexadecimal
638ee116499SAntonio Huete Jimeneznumber beginning with
639ee116499SAntonio Huete Jimenez.Dq 0x .
640ee116499SAntonio Huete Jimenez.El
6410cbfa66cSDaniel Fojt.Pp
642ee116499SAntonio Huete JimenezThe end time may be specified similarly to the start time:
643ee116499SAntonio Huete Jimenez.Bl -bullet -compact
644ee116499SAntonio Huete Jimenez.It
645ee116499SAntonio Huete JimenezThe string
6460cbfa66cSDaniel Fojt.Dq forever
647ee116499SAntonio Huete Jimenezto indicate the certificate has no specified end time.
648ee116499SAntonio Huete Jimenez.It
649ee116499SAntonio Huete JimenezA date or time in the system time zone formatted as YYYYMMDD or
650ee116499SAntonio Huete JimenezYYYYMMDDHHMM[SS].
651ee116499SAntonio Huete Jimenez.It
652ee116499SAntonio Huete JimenezA date or time in the UTC time zone as YYYYMMDDZ or YYYYMMDDHHMM[SS]Z.
653ee116499SAntonio Huete Jimenez.It
654ee116499SAntonio Huete JimenezA relative time after the current system time consisting of a plus sign
655ee116499SAntonio Huete Jimenezfollowed by an interval in the format described in the
656ee116499SAntonio Huete JimenezTIME FORMATS section of
657ee116499SAntonio Huete Jimenez.Xr sshd_config 5 .
658ee116499SAntonio Huete Jimenez.It
659ee116499SAntonio Huete JimenezA raw seconds since epoch (Jan 1 1970 00:00:00 UTC) as a hexadecimal
660ee116499SAntonio Huete Jimeneznumber beginning with
661ee116499SAntonio Huete Jimenez.Dq 0x .
662ee116499SAntonio Huete Jimenez.El
6630cbfa66cSDaniel Fojt.Pp
6640cbfa66cSDaniel FojtFor example:
665ee116499SAntonio Huete Jimenez.Bl -tag -width Ds
666ee116499SAntonio Huete Jimenez.It +52w1d
667ee116499SAntonio Huete JimenezValid from now to 52 weeks and one day from now.
668ee116499SAntonio Huete Jimenez.It -4w:+4w
669ee116499SAntonio Huete JimenezValid from four weeks ago to four weeks from now.
670ee116499SAntonio Huete Jimenez.It 20100101123000:20110101123000
671ee116499SAntonio Huete JimenezValid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011.
672ee116499SAntonio Huete Jimenez.It 20100101123000Z:20110101123000Z
673ee116499SAntonio Huete JimenezSimilar, but interpreted in the UTC time zone rather than the system time zone.
674ee116499SAntonio Huete Jimenez.It -1d:20110101
675ee116499SAntonio Huete JimenezValid from yesterday to midnight, January 1st, 2011.
676ee116499SAntonio Huete Jimenez.It 0x1:0x2000000000
677ee116499SAntonio Huete JimenezValid from roughly early 1970 to May 2033.
678ee116499SAntonio Huete Jimenez.It -1m:forever
679ee116499SAntonio Huete JimenezValid from one minute ago and never expiring.
680ee116499SAntonio Huete Jimenez.El
6810cbfa66cSDaniel Fojt.It Fl v
6820cbfa66cSDaniel FojtVerbose mode.
6830cbfa66cSDaniel FojtCauses
6840cbfa66cSDaniel Fojt.Nm
6850cbfa66cSDaniel Fojtto print debugging messages about its progress.
6860cbfa66cSDaniel FojtThis is helpful for debugging moduli generation.
6870cbfa66cSDaniel FojtMultiple
6880cbfa66cSDaniel Fojt.Fl v
6890cbfa66cSDaniel Fojtoptions increase the verbosity.
6900cbfa66cSDaniel FojtThe maximum is 3.
6910cbfa66cSDaniel Fojt.It Fl w Ar provider
6920cbfa66cSDaniel FojtSpecifies a path to a library that will be used when creating
6930cbfa66cSDaniel FojtFIDO authenticator-hosted keys, overriding the default of using
6940cbfa66cSDaniel Fojtthe internal USB HID support.
6950cbfa66cSDaniel Fojt.It Fl Y Cm find-principals
6960cbfa66cSDaniel FojtFind the principal(s) associated with the public key of a signature,
6970cbfa66cSDaniel Fojtprovided using the
6980cbfa66cSDaniel Fojt.Fl s
6990cbfa66cSDaniel Fojtflag in an authorized signers file provided using the
7000cbfa66cSDaniel Fojt.Fl f
7010cbfa66cSDaniel Fojtflag.
7020cbfa66cSDaniel FojtThe format of the allowed signers file is documented in the
7030cbfa66cSDaniel Fojt.Sx ALLOWED SIGNERS
7040cbfa66cSDaniel Fojtsection below.
7050cbfa66cSDaniel FojtIf one or more matching principals are found, they are returned on
7060cbfa66cSDaniel Fojtstandard output.
707ee116499SAntonio Huete Jimenez.It Fl Y Cm match-principals
708ee116499SAntonio Huete JimenezFind principal matching the principal name provided using the
709ee116499SAntonio Huete Jimenez.Fl I
710ee116499SAntonio Huete Jimenezflag in the authorized signers file specified using the
711ee116499SAntonio Huete Jimenez.Fl f
712ee116499SAntonio Huete Jimenezflag.
713ee116499SAntonio Huete JimenezIf one or more matching principals are found, they are returned on
714ee116499SAntonio Huete Jimenezstandard output.
7150cbfa66cSDaniel Fojt.It Fl Y Cm check-novalidate
7160cbfa66cSDaniel FojtChecks that a signature generated using
7170cbfa66cSDaniel Fojt.Nm
7180cbfa66cSDaniel Fojt.Fl Y Cm sign
7190cbfa66cSDaniel Fojthas a valid structure.
7200cbfa66cSDaniel FojtThis does not validate if a signature comes from an authorized signer.
7210cbfa66cSDaniel FojtWhen testing a signature,
7220cbfa66cSDaniel Fojt.Nm
7230cbfa66cSDaniel Fojtaccepts a message on standard input and a signature namespace using
7240cbfa66cSDaniel Fojt.Fl n .
7250cbfa66cSDaniel FojtA file containing the corresponding signature must also be supplied using the
7260cbfa66cSDaniel Fojt.Fl s
7270cbfa66cSDaniel Fojtflag.
7280cbfa66cSDaniel FojtSuccessful testing of the signature is signalled by
7290cbfa66cSDaniel Fojt.Nm
7300cbfa66cSDaniel Fojtreturning a zero exit status.
7310cbfa66cSDaniel Fojt.It Fl Y Cm sign
732*ba1276acSMatthew DillonCryptographically sign a file or some data using an SSH key.
7330cbfa66cSDaniel FojtWhen signing,
7340cbfa66cSDaniel Fojt.Nm
7350cbfa66cSDaniel Fojtaccepts zero or more files to sign on the command-line - if no files
7360cbfa66cSDaniel Fojtare specified then
7370cbfa66cSDaniel Fojt.Nm
7380cbfa66cSDaniel Fojtwill sign data presented on standard input.
7390cbfa66cSDaniel FojtSignatures are written to the path of the input file with
7400cbfa66cSDaniel Fojt.Dq .sig
7410cbfa66cSDaniel Fojtappended, or to standard output if the message to be signed was read from
7420cbfa66cSDaniel Fojtstandard input.
7430cbfa66cSDaniel Fojt.Pp
7440cbfa66cSDaniel FojtThe key used for signing is specified using the
7450cbfa66cSDaniel Fojt.Fl f
7460cbfa66cSDaniel Fojtoption and may refer to either a private key, or a public key with the private
7470cbfa66cSDaniel Fojthalf available via
7480cbfa66cSDaniel Fojt.Xr ssh-agent 1 .
7490cbfa66cSDaniel FojtAn additional signature namespace, used to prevent signature confusion across
7500cbfa66cSDaniel Fojtdifferent domains of use (e.g. file signing vs email signing) must be provided
7510cbfa66cSDaniel Fojtvia the
7520cbfa66cSDaniel Fojt.Fl n
7530cbfa66cSDaniel Fojtflag.
7540cbfa66cSDaniel FojtNamespaces are arbitrary strings, and may include:
7550cbfa66cSDaniel Fojt.Dq file
7560cbfa66cSDaniel Fojtfor file signing,
7570cbfa66cSDaniel Fojt.Dq email
7580cbfa66cSDaniel Fojtfor email signing.
7590cbfa66cSDaniel FojtFor custom uses, it is recommended to use names following a
7600cbfa66cSDaniel FojtNAMESPACE@YOUR.DOMAIN pattern to generate unambiguous namespaces.
7610cbfa66cSDaniel Fojt.It Fl Y Cm verify
7620cbfa66cSDaniel FojtRequest to verify a signature generated using
7630cbfa66cSDaniel Fojt.Nm
7640cbfa66cSDaniel Fojt.Fl Y Cm sign
7650cbfa66cSDaniel Fojtas described above.
7660cbfa66cSDaniel FojtWhen verifying a signature,
7670cbfa66cSDaniel Fojt.Nm
7680cbfa66cSDaniel Fojtaccepts a message on standard input and a signature namespace using
7690cbfa66cSDaniel Fojt.Fl n .
7700cbfa66cSDaniel FojtA file containing the corresponding signature must also be supplied using the
7710cbfa66cSDaniel Fojt.Fl s
7720cbfa66cSDaniel Fojtflag, along with the identity of the signer using
7730cbfa66cSDaniel Fojt.Fl I
7740cbfa66cSDaniel Fojtand a list of allowed signers via the
7750cbfa66cSDaniel Fojt.Fl f
7760cbfa66cSDaniel Fojtflag.
7770cbfa66cSDaniel FojtThe format of the allowed signers file is documented in the
7780cbfa66cSDaniel Fojt.Sx ALLOWED SIGNERS
7790cbfa66cSDaniel Fojtsection below.
7800cbfa66cSDaniel FojtA file containing revoked keys can be passed using the
7810cbfa66cSDaniel Fojt.Fl r
7820cbfa66cSDaniel Fojtflag.
7830cbfa66cSDaniel FojtThe revocation file may be a KRL or a one-per-line list of public keys.
7840cbfa66cSDaniel FojtSuccessful verification by an authorized signer is signalled by
7850cbfa66cSDaniel Fojt.Nm
7860cbfa66cSDaniel Fojtreturning a zero exit status.
7870cbfa66cSDaniel Fojt.It Fl y
7880cbfa66cSDaniel FojtThis option will read a private
7890cbfa66cSDaniel FojtOpenSSH format file and print an OpenSSH public key to stdout.
79050a69bb5SSascha Wildner.It Fl Z Ar cipher
79150a69bb5SSascha WildnerSpecifies the cipher to use for encryption when writing an OpenSSH-format
79250a69bb5SSascha Wildnerprivate key file.
79350a69bb5SSascha WildnerThe list of available ciphers may be obtained using
79450a69bb5SSascha Wildner.Qq ssh -Q cipher .
79550a69bb5SSascha WildnerThe default is
79650a69bb5SSascha Wildner.Dq aes256-ctr .
7970cbfa66cSDaniel Fojt.It Fl z Ar serial_number
7980cbfa66cSDaniel FojtSpecifies a serial number to be embedded in the certificate to distinguish
7990cbfa66cSDaniel Fojtthis certificate from others from the same CA.
8000cbfa66cSDaniel FojtIf the
8010cbfa66cSDaniel Fojt.Ar serial_number
8020cbfa66cSDaniel Fojtis prefixed with a
8030cbfa66cSDaniel Fojt.Sq +
8040cbfa66cSDaniel Fojtcharacter, then the serial number will be incremented for each certificate
8050cbfa66cSDaniel Fojtsigned on a single command-line.
8060cbfa66cSDaniel FojtThe default serial number is zero.
8070cbfa66cSDaniel Fojt.Pp
8080cbfa66cSDaniel FojtWhen generating a KRL, the
8090cbfa66cSDaniel Fojt.Fl z
8100cbfa66cSDaniel Fojtflag is used to specify a KRL version number.
8110cbfa66cSDaniel Fojt.El
8120cbfa66cSDaniel Fojt.Sh MODULI GENERATION
8130cbfa66cSDaniel Fojt.Nm
8140cbfa66cSDaniel Fojtmay be used to generate groups for the Diffie-Hellman Group Exchange
8150cbfa66cSDaniel Fojt(DH-GEX) protocol.
8160cbfa66cSDaniel FojtGenerating these groups is a two-step process: first, candidate
8170cbfa66cSDaniel Fojtprimes are generated using a fast, but memory intensive process.
8180cbfa66cSDaniel FojtThese candidate primes are then tested for suitability (a CPU-intensive
8190cbfa66cSDaniel Fojtprocess).
8200cbfa66cSDaniel Fojt.Pp
8210cbfa66cSDaniel FojtGeneration of primes is performed using the
8220cbfa66cSDaniel Fojt.Fl M Cm generate
8230cbfa66cSDaniel Fojtoption.
8240cbfa66cSDaniel FojtThe desired length of the primes may be specified by the
8250cbfa66cSDaniel Fojt.Fl O Cm bits
8260cbfa66cSDaniel Fojtoption.
8270cbfa66cSDaniel FojtFor example:
8280cbfa66cSDaniel Fojt.Pp
8290cbfa66cSDaniel Fojt.Dl # ssh-keygen -M generate -O bits=2048 moduli-2048.candidates
8300cbfa66cSDaniel Fojt.Pp
8310cbfa66cSDaniel FojtBy default, the search for primes begins at a random point in the
8320cbfa66cSDaniel Fojtdesired length range.
8330cbfa66cSDaniel FojtThis may be overridden using the
8340cbfa66cSDaniel Fojt.Fl O Cm start
8350cbfa66cSDaniel Fojtoption, which specifies a different start point (in hex).
8360cbfa66cSDaniel Fojt.Pp
8370cbfa66cSDaniel FojtOnce a set of candidates have been generated, they must be screened for
8380cbfa66cSDaniel Fojtsuitability.
8390cbfa66cSDaniel FojtThis may be performed using the
8400cbfa66cSDaniel Fojt.Fl M Cm screen
8410cbfa66cSDaniel Fojtoption.
8420cbfa66cSDaniel FojtIn this mode
8430cbfa66cSDaniel Fojt.Nm
8440cbfa66cSDaniel Fojtwill read candidates from standard input (or a file specified using the
8450cbfa66cSDaniel Fojt.Fl f
8460cbfa66cSDaniel Fojtoption).
8470cbfa66cSDaniel FojtFor example:
8480cbfa66cSDaniel Fojt.Pp
8490cbfa66cSDaniel Fojt.Dl # ssh-keygen -M screen -f moduli-2048.candidates moduli-2048
8500cbfa66cSDaniel Fojt.Pp
8510cbfa66cSDaniel FojtBy default, each candidate will be subjected to 100 primality tests.
8520cbfa66cSDaniel FojtThis may be overridden using the
8530cbfa66cSDaniel Fojt.Fl O Cm prime-tests
8540cbfa66cSDaniel Fojtoption.
8550cbfa66cSDaniel FojtThe DH generator value will be chosen automatically for the
8560cbfa66cSDaniel Fojtprime under consideration.
8570cbfa66cSDaniel FojtIf a specific generator is desired, it may be requested using the
8580cbfa66cSDaniel Fojt.Fl O Cm generator
8590cbfa66cSDaniel Fojtoption.
8600cbfa66cSDaniel FojtValid generator values are 2, 3, and 5.
8610cbfa66cSDaniel Fojt.Pp
8620cbfa66cSDaniel FojtScreened DH groups may be installed in
8630cbfa66cSDaniel Fojt.Pa /etc/moduli .
86450a69bb5SSascha WildnerIt is important that this file contains moduli of a range of bit lengths.
8650cbfa66cSDaniel Fojt.Pp
8660cbfa66cSDaniel FojtA number of options are available for moduli generation and screening via the
8670cbfa66cSDaniel Fojt.Fl O
8680cbfa66cSDaniel Fojtflag:
8690cbfa66cSDaniel Fojt.Bl -tag -width Ds
8700cbfa66cSDaniel Fojt.It Ic lines Ns = Ns Ar number
8710cbfa66cSDaniel FojtExit after screening the specified number of lines while performing DH
8720cbfa66cSDaniel Fojtcandidate screening.
8730cbfa66cSDaniel Fojt.It Ic start-line Ns = Ns Ar line-number
8740cbfa66cSDaniel FojtStart screening at the specified line number while performing DH candidate
8750cbfa66cSDaniel Fojtscreening.
8760cbfa66cSDaniel Fojt.It Ic checkpoint Ns = Ns Ar filename
8770cbfa66cSDaniel FojtWrite the last line processed to the specified file while performing DH
8780cbfa66cSDaniel Fojtcandidate screening.
8790cbfa66cSDaniel FojtThis will be used to skip lines in the input file that have already been
8800cbfa66cSDaniel Fojtprocessed if the job is restarted.
8810cbfa66cSDaniel Fojt.It Ic memory Ns = Ns Ar mbytes
8820cbfa66cSDaniel FojtSpecify the amount of memory to use (in megabytes) when generating
8830cbfa66cSDaniel Fojtcandidate moduli for DH-GEX.
8840cbfa66cSDaniel Fojt.It Ic start Ns = Ns Ar hex-value
8850cbfa66cSDaniel FojtSpecify start point (in hex) when generating candidate moduli for DH-GEX.
8860cbfa66cSDaniel Fojt.It Ic generator Ns = Ns Ar value
8870cbfa66cSDaniel FojtSpecify desired generator (in decimal) when testing candidate moduli for DH-GEX.
8880cbfa66cSDaniel Fojt.El
8890cbfa66cSDaniel Fojt.Sh CERTIFICATES
8900cbfa66cSDaniel Fojt.Nm
8910cbfa66cSDaniel Fojtsupports signing of keys to produce certificates that may be used for
8920cbfa66cSDaniel Fojtuser or host authentication.
8930cbfa66cSDaniel FojtCertificates consist of a public key, some identity information, zero or
8940cbfa66cSDaniel Fojtmore principal (user or host) names and a set of options that
8950cbfa66cSDaniel Fojtare signed by a Certification Authority (CA) key.
8960cbfa66cSDaniel FojtClients or servers may then trust only the CA key and verify its signature
8970cbfa66cSDaniel Fojton a certificate rather than trusting many user/host keys.
8980cbfa66cSDaniel FojtNote that OpenSSH certificates are a different, and much simpler, format to
8990cbfa66cSDaniel Fojtthe X.509 certificates used in
9000cbfa66cSDaniel Fojt.Xr ssl 8 .
9010cbfa66cSDaniel Fojt.Pp
9020cbfa66cSDaniel Fojt.Nm
9030cbfa66cSDaniel Fojtsupports two types of certificates: user and host.
9040cbfa66cSDaniel FojtUser certificates authenticate users to servers, whereas host certificates
9050cbfa66cSDaniel Fojtauthenticate server hosts to users.
9060cbfa66cSDaniel FojtTo generate a user certificate:
9070cbfa66cSDaniel Fojt.Pp
9080cbfa66cSDaniel Fojt.Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
9090cbfa66cSDaniel Fojt.Pp
9100cbfa66cSDaniel FojtThe resultant certificate will be placed in
9110cbfa66cSDaniel Fojt.Pa /path/to/user_key-cert.pub .
9120cbfa66cSDaniel FojtA host certificate requires the
9130cbfa66cSDaniel Fojt.Fl h
9140cbfa66cSDaniel Fojtoption:
9150cbfa66cSDaniel Fojt.Pp
9160cbfa66cSDaniel Fojt.Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
9170cbfa66cSDaniel Fojt.Pp
9180cbfa66cSDaniel FojtThe host certificate will be output to
9190cbfa66cSDaniel Fojt.Pa /path/to/host_key-cert.pub .
9200cbfa66cSDaniel Fojt.Pp
9210cbfa66cSDaniel FojtIt is possible to sign using a CA key stored in a PKCS#11 token by
9220cbfa66cSDaniel Fojtproviding the token library using
9230cbfa66cSDaniel Fojt.Fl D
9240cbfa66cSDaniel Fojtand identifying the CA key by providing its public half as an argument
9250cbfa66cSDaniel Fojtto
9260cbfa66cSDaniel Fojt.Fl s :
9270cbfa66cSDaniel Fojt.Pp
9280cbfa66cSDaniel Fojt.Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
9290cbfa66cSDaniel Fojt.Pp
9300cbfa66cSDaniel FojtSimilarly, it is possible for the CA key to be hosted in a
9310cbfa66cSDaniel Fojt.Xr ssh-agent 1 .
9320cbfa66cSDaniel FojtThis is indicated by the
9330cbfa66cSDaniel Fojt.Fl U
9340cbfa66cSDaniel Fojtflag and, again, the CA key must be identified by its public half.
9350cbfa66cSDaniel Fojt.Pp
9360cbfa66cSDaniel Fojt.Dl $ ssh-keygen -Us ca_key.pub -I key_id user_key.pub
9370cbfa66cSDaniel Fojt.Pp
9380cbfa66cSDaniel FojtIn all cases,
9390cbfa66cSDaniel Fojt.Ar key_id
9400cbfa66cSDaniel Fojtis a "key identifier" that is logged by the server when the certificate
9410cbfa66cSDaniel Fojtis used for authentication.
9420cbfa66cSDaniel Fojt.Pp
9430cbfa66cSDaniel FojtCertificates may be limited to be valid for a set of principal (user/host)
9440cbfa66cSDaniel Fojtnames.
9450cbfa66cSDaniel FojtBy default, generated certificates are valid for all users or hosts.
9460cbfa66cSDaniel FojtTo generate a certificate for a specified set of principals:
9470cbfa66cSDaniel Fojt.Pp
9480cbfa66cSDaniel Fojt.Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
9490cbfa66cSDaniel Fojt.Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain host_key.pub"
9500cbfa66cSDaniel Fojt.Pp
9510cbfa66cSDaniel FojtAdditional limitations on the validity and use of user certificates may
9520cbfa66cSDaniel Fojtbe specified through certificate options.
9530cbfa66cSDaniel FojtA certificate option may disable features of the SSH session, may be
9540cbfa66cSDaniel Fojtvalid only when presented from particular source addresses or may
9550cbfa66cSDaniel Fojtforce the use of a specific command.
9560cbfa66cSDaniel Fojt.Pp
957856ea928SPeter AvalosThe options that are valid for user certificates are:
958ce74bacaSMatthew Dillon.Pp
959ce74bacaSMatthew Dillon.Bl -tag -width Ds -compact
960856ea928SPeter Avalos.It Ic clear
961856ea928SPeter AvalosClear all enabled permissions.
962856ea928SPeter AvalosThis is useful for clearing the default set of permissions so permissions may
963856ea928SPeter Avalosbe added individually.
964ce74bacaSMatthew Dillon.Pp
965ce74bacaSMatthew Dillon.It Ic critical : Ns Ar name Ns Op Ns = Ns Ar contents
966ce74bacaSMatthew Dillon.It Ic extension : Ns Ar name Ns Op Ns = Ns Ar contents
967ce74bacaSMatthew DillonIncludes an arbitrary certificate critical option or extension.
968ce74bacaSMatthew DillonThe specified
969ce74bacaSMatthew Dillon.Ar name
970ce74bacaSMatthew Dillonshould include a domain suffix, e.g.\&
971ce74bacaSMatthew Dillon.Dq name@example.com .
972ce74bacaSMatthew DillonIf
973ce74bacaSMatthew Dillon.Ar contents
974ce74bacaSMatthew Dillonis specified then it is included as the contents of the extension/option
975ce74bacaSMatthew Dillonencoded as a string, otherwise the extension/option is created with no
976ce74bacaSMatthew Dilloncontents (usually indicating a flag).
977ce74bacaSMatthew DillonExtensions may be ignored by a client or server that does not recognise them,
978ce74bacaSMatthew Dillonwhereas unknown critical options will cause the certificate to be refused.
979ce74bacaSMatthew Dillon.Pp
980856ea928SPeter Avalos.It Ic force-command Ns = Ns Ar command
981856ea928SPeter AvalosForces the execution of
982856ea928SPeter Avalos.Ar command
983856ea928SPeter Avalosinstead of any shell or command specified by the user when
984856ea928SPeter Avalosthe certificate is used for authentication.
985ce74bacaSMatthew Dillon.Pp
986856ea928SPeter Avalos.It Ic no-agent-forwarding
987856ea928SPeter AvalosDisable
988856ea928SPeter Avalos.Xr ssh-agent 1
989856ea928SPeter Avalosforwarding (permitted by default).
990ce74bacaSMatthew Dillon.Pp
991856ea928SPeter Avalos.It Ic no-port-forwarding
992856ea928SPeter AvalosDisable port forwarding (permitted by default).
993ce74bacaSMatthew Dillon.Pp
994856ea928SPeter Avalos.It Ic no-pty
995856ea928SPeter AvalosDisable PTY allocation (permitted by default).
996ce74bacaSMatthew Dillon.Pp
997856ea928SPeter Avalos.It Ic no-user-rc
998856ea928SPeter AvalosDisable execution of
999856ea928SPeter Avalos.Pa ~/.ssh/rc
1000856ea928SPeter Avalosby
1001856ea928SPeter Avalos.Xr sshd 8
1002856ea928SPeter Avalos(permitted by default).
1003ce74bacaSMatthew Dillon.Pp
1004856ea928SPeter Avalos.It Ic no-x11-forwarding
1005856ea928SPeter AvalosDisable X11 forwarding (permitted by default).
1006ce74bacaSMatthew Dillon.Pp
1007856ea928SPeter Avalos.It Ic permit-agent-forwarding
1008856ea928SPeter AvalosAllows
1009856ea928SPeter Avalos.Xr ssh-agent 1
1010856ea928SPeter Avalosforwarding.
1011ce74bacaSMatthew Dillon.Pp
1012856ea928SPeter Avalos.It Ic permit-port-forwarding
1013856ea928SPeter AvalosAllows port forwarding.
1014ce74bacaSMatthew Dillon.Pp
1015856ea928SPeter Avalos.It Ic permit-pty
1016856ea928SPeter AvalosAllows PTY allocation.
1017ce74bacaSMatthew Dillon.Pp
1018856ea928SPeter Avalos.It Ic permit-user-rc
1019856ea928SPeter AvalosAllows execution of
1020856ea928SPeter Avalos.Pa ~/.ssh/rc
1021856ea928SPeter Avalosby
1022856ea928SPeter Avalos.Xr sshd 8 .
1023ce74bacaSMatthew Dillon.Pp
1024664f4763Szrj.It Ic permit-X11-forwarding
1025856ea928SPeter AvalosAllows X11 forwarding.
1026ce74bacaSMatthew Dillon.Pp
10270cbfa66cSDaniel Fojt.It Ic no-touch-required
102850a69bb5SSascha WildnerDo not require signatures made using this key include demonstration
10290cbfa66cSDaniel Fojtof user presence (e.g. by having the user touch the authenticator).
10300cbfa66cSDaniel FojtThis option only makes sense for the FIDO authenticator algorithms
10310cbfa66cSDaniel Fojt.Cm ecdsa-sk
10320cbfa66cSDaniel Fojtand
10330cbfa66cSDaniel Fojt.Cm ed25519-sk .
10340cbfa66cSDaniel Fojt.Pp
1035856ea928SPeter Avalos.It Ic source-address Ns = Ns Ar address_list
1036856ea928SPeter AvalosRestrict the source addresses from which the certificate is considered valid.
1037856ea928SPeter AvalosThe
1038856ea928SPeter Avalos.Ar address_list
1039856ea928SPeter Avalosis a comma-separated list of one or more address/netmask pairs in CIDR
1040856ea928SPeter Avalosformat.
104150a69bb5SSascha Wildner.Pp
104250a69bb5SSascha Wildner.It Ic verify-required
104350a69bb5SSascha WildnerRequire signatures made using this key indicate that the user was first
104450a69bb5SSascha Wildnerverified.
104550a69bb5SSascha WildnerThis option only makes sense for the FIDO authenticator algorithms
104650a69bb5SSascha Wildner.Cm ecdsa-sk
104750a69bb5SSascha Wildnerand
104850a69bb5SSascha Wildner.Cm ed25519-sk .
104950a69bb5SSascha WildnerCurrently PIN authentication is the only supported verification method,
105050a69bb5SSascha Wildnerbut other methods may be supported in the future.
1051856ea928SPeter Avalos.El
105236e94dc5SPeter Avalos.Pp
10530cbfa66cSDaniel FojtAt present, no standard options are valid for host keys.
1054856ea928SPeter Avalos.Pp
1055856ea928SPeter AvalosFinally, certificates may be defined with a validity lifetime.
1056856ea928SPeter AvalosThe
1057856ea928SPeter Avalos.Fl V
1058856ea928SPeter Avalosoption allows specification of certificate start and end times.
1059856ea928SPeter AvalosA certificate that is presented at a time outside this range will not be
1060856ea928SPeter Avalosconsidered valid.
106150a69bb5SSascha WildnerBy default, certificates are valid from the
106236e94dc5SPeter Avalos.Ux
106336e94dc5SPeter AvalosEpoch to the distant future.
1064856ea928SPeter Avalos.Pp
1065856ea928SPeter AvalosFor certificates to be used for user or host authentication, the CA
1066856ea928SPeter Avalospublic key must be trusted by
1067856ea928SPeter Avalos.Xr sshd 8
1068856ea928SPeter Avalosor
1069856ea928SPeter Avalos.Xr ssh 1 .
1070ee116499SAntonio Huete JimenezRefer to those manual pages for details.
1071ee116499SAntonio Huete Jimenez.Sh FIDO AUTHENTICATOR
1072ee116499SAntonio Huete Jimenez.Nm
1073ee116499SAntonio Huete Jimenezis able to generate FIDO authenticator-backed keys, after which
1074ee116499SAntonio Huete Jimenezthey may be used much like any other key type supported by OpenSSH, so
1075ee116499SAntonio Huete Jimenezlong as the hardware authenticator is attached when the keys are used.
1076ee116499SAntonio Huete JimenezFIDO authenticators generally require the user to explicitly authorise
1077ee116499SAntonio Huete Jimenezoperations by touching or tapping them.
1078ee116499SAntonio Huete JimenezFIDO keys consist of two parts: a key handle part stored in the
1079ee116499SAntonio Huete Jimenezprivate key file on disk, and a per-device private key that is unique
1080ee116499SAntonio Huete Jimenezto each FIDO authenticator and that cannot be exported from the
1081ee116499SAntonio Huete Jimenezauthenticator hardware.
1082ee116499SAntonio Huete JimenezThese are combined by the hardware at authentication time to derive
1083ee116499SAntonio Huete Jimenezthe real key that is used to sign authentication challenges.
1084ee116499SAntonio Huete JimenezSupported key types are
1085ee116499SAntonio Huete Jimenez.Cm ecdsa-sk
1086ee116499SAntonio Huete Jimenezand
1087ee116499SAntonio Huete Jimenez.Cm ed25519-sk .
1088ee116499SAntonio Huete Jimenez.Pp
1089ee116499SAntonio Huete JimenezThe options that are valid for FIDO keys are:
1090ee116499SAntonio Huete Jimenez.Bl -tag -width Ds
1091ee116499SAntonio Huete Jimenez.It Cm application
1092ee116499SAntonio Huete JimenezOverride the default FIDO application/origin string of
1093ee116499SAntonio Huete Jimenez.Dq ssh: .
1094ee116499SAntonio Huete JimenezThis may be useful when generating host or domain-specific resident keys.
1095ee116499SAntonio Huete JimenezThe specified application string must begin with
1096ee116499SAntonio Huete Jimenez.Dq ssh: .
1097ee116499SAntonio Huete Jimenez.It Cm challenge Ns = Ns Ar path
1098ee116499SAntonio Huete JimenezSpecifies a path to a challenge string that will be passed to the
1099ee116499SAntonio Huete JimenezFIDO authenticator during key generation.
1100ee116499SAntonio Huete JimenezThe challenge string may be used as part of an out-of-band
1101ee116499SAntonio Huete Jimenezprotocol for key enrollment
1102ee116499SAntonio Huete Jimenez(a random challenge is used by default).
1103ee116499SAntonio Huete Jimenez.It Cm device
1104ee116499SAntonio Huete JimenezExplicitly specify a
1105ee116499SAntonio Huete Jimenez.Xr fido 4
1106ee116499SAntonio Huete Jimenezdevice to use, rather than letting the authenticator middleware select one.
1107ee116499SAntonio Huete Jimenez.It Cm no-touch-required
1108ee116499SAntonio Huete JimenezIndicate that the generated private key should not require touch
1109ee116499SAntonio Huete Jimenezevents (user presence) when making signatures.
1110ee116499SAntonio Huete JimenezNote that
1111ee116499SAntonio Huete Jimenez.Xr sshd 8
1112ee116499SAntonio Huete Jimenezwill refuse such signatures by default, unless overridden via
1113ee116499SAntonio Huete Jimenezan authorized_keys option.
1114ee116499SAntonio Huete Jimenez.It Cm resident
1115ee116499SAntonio Huete JimenezIndicate that the key handle should be stored on the FIDO
1116ee116499SAntonio Huete Jimenezauthenticator itself.
1117ee116499SAntonio Huete JimenezThis makes it easier to use the authenticator on multiple computers.
1118ee116499SAntonio Huete JimenezResident keys may be supported on FIDO2 authenticators and typically
1119ee116499SAntonio Huete Jimenezrequire that a PIN be set on the authenticator prior to generation.
1120ee116499SAntonio Huete JimenezResident keys may be loaded off the authenticator using
1121ee116499SAntonio Huete Jimenez.Xr ssh-add 1 .
1122ee116499SAntonio Huete JimenezStoring both parts of a key on a FIDO authenticator increases the likelihood
1123ee116499SAntonio Huete Jimenezof an attacker being able to use a stolen authenticator device.
1124ee116499SAntonio Huete Jimenez.It Cm user
1125ee116499SAntonio Huete JimenezA username to be associated with a resident key,
1126ee116499SAntonio Huete Jimenezoverriding the empty default username.
1127ee116499SAntonio Huete JimenezSpecifying a username may be useful when generating multiple resident keys
1128ee116499SAntonio Huete Jimenezfor the same application name.
1129ee116499SAntonio Huete Jimenez.It Cm verify-required
1130ee116499SAntonio Huete JimenezIndicate that this private key should require user verification for
1131ee116499SAntonio Huete Jimenezeach signature.
1132ee116499SAntonio Huete JimenezNot all FIDO authenticators support this option.
1133ee116499SAntonio Huete JimenezCurrently PIN authentication is the only supported verification method,
1134ee116499SAntonio Huete Jimenezbut other methods may be supported in the future.
1135ee116499SAntonio Huete Jimenez.It Cm write-attestation Ns = Ns Ar path
1136ee116499SAntonio Huete JimenezMay be used at key generation time to record the attestation data
1137ee116499SAntonio Huete Jimenezreturned from FIDO authenticators during key generation.
1138ee116499SAntonio Huete JimenezThis information is potentially sensitive.
1139ee116499SAntonio Huete JimenezBy default, this information is discarded.
1140ee116499SAntonio Huete Jimenez.El
114136e94dc5SPeter Avalos.Sh KEY REVOCATION LISTS
114236e94dc5SPeter Avalos.Nm
114336e94dc5SPeter Avalosis able to manage OpenSSH format Key Revocation Lists (KRLs).
114436e94dc5SPeter AvalosThese binary files specify keys or certificates to be revoked using a
114536e94dc5SPeter Avaloscompact format, taking as little as one bit per certificate if they are being
114636e94dc5SPeter Avalosrevoked by serial number.
114736e94dc5SPeter Avalos.Pp
114836e94dc5SPeter AvalosKRLs may be generated using the
114936e94dc5SPeter Avalos.Fl k
115036e94dc5SPeter Avalosflag.
115136e94dc5SPeter AvalosThis option reads one or more files from the command line and generates a new
115236e94dc5SPeter AvalosKRL.
115336e94dc5SPeter AvalosThe files may either contain a KRL specification (see below) or public keys,
115436e94dc5SPeter Avaloslisted one per line.
115536e94dc5SPeter AvalosPlain public keys are revoked by listing their hash or contents in the KRL and
115636e94dc5SPeter Avaloscertificates revoked by serial number or key ID (if the serial is zero or
115736e94dc5SPeter Avalosnot available).
115836e94dc5SPeter Avalos.Pp
115936e94dc5SPeter AvalosRevoking keys using a KRL specification offers explicit control over the
116036e94dc5SPeter Avalostypes of record used to revoke keys and may be used to directly revoke
116136e94dc5SPeter Avaloscertificates by serial number or key ID without having the complete original
116236e94dc5SPeter Avaloscertificate on hand.
116336e94dc5SPeter AvalosA KRL specification consists of lines containing one of the following directives
116436e94dc5SPeter Avalosfollowed by a colon and some directive-specific information.
116536e94dc5SPeter Avalos.Bl -tag -width Ds
116636e94dc5SPeter Avalos.It Cm serial : Ar serial_number Ns Op - Ns Ar serial_number
116736e94dc5SPeter AvalosRevokes a certificate with the specified serial number.
116836e94dc5SPeter AvalosSerial numbers are 64-bit values, not including zero and may be expressed
116936e94dc5SPeter Avalosin decimal, hex or octal.
117036e94dc5SPeter AvalosIf two serial numbers are specified separated by a hyphen, then the range
117136e94dc5SPeter Avalosof serial numbers including and between each is revoked.
117236e94dc5SPeter AvalosThe CA key must have been specified on the
117336e94dc5SPeter Avalos.Nm
117436e94dc5SPeter Avaloscommand line using the
117536e94dc5SPeter Avalos.Fl s
117636e94dc5SPeter Avalosoption.
117736e94dc5SPeter Avalos.It Cm id : Ar key_id
117836e94dc5SPeter AvalosRevokes a certificate with the specified key ID string.
117936e94dc5SPeter AvalosThe CA key must have been specified on the
118036e94dc5SPeter Avalos.Nm
118136e94dc5SPeter Avaloscommand line using the
118236e94dc5SPeter Avalos.Fl s
118336e94dc5SPeter Avalosoption.
118436e94dc5SPeter Avalos.It Cm key : Ar public_key
118536e94dc5SPeter AvalosRevokes the specified key.
118636e94dc5SPeter AvalosIf a certificate is listed, then it is revoked as a plain public key.
118736e94dc5SPeter Avalos.It Cm sha1 : Ar public_key
1188664f4763SzrjRevokes the specified key by including its SHA1 hash in the KRL.
1189664f4763Szrj.It Cm sha256 : Ar public_key
1190664f4763SzrjRevokes the specified key by including its SHA256 hash in the KRL.
1191664f4763SzrjKRLs that revoke keys by SHA256 hash are not supported by OpenSSH versions
1192664f4763Szrjprior to 7.9.
1193664f4763Szrj.It Cm hash : Ar fingerprint
1194664f4763SzrjRevokes a key using a fingerprint hash, as obtained from a
1195664f4763Szrj.Xr sshd 8
1196664f4763Szrjauthentication log message or the
1197664f4763Szrj.Nm
1198664f4763Szrj.Fl l
1199664f4763Szrjflag.
1200664f4763SzrjOnly SHA256 fingerprints are supported here and resultant KRLs are
1201664f4763Szrjnot supported by OpenSSH versions prior to 7.9.
120236e94dc5SPeter Avalos.El
120336e94dc5SPeter Avalos.Pp
120436e94dc5SPeter AvalosKRLs may be updated using the
120536e94dc5SPeter Avalos.Fl u
120636e94dc5SPeter Avalosflag in addition to
120736e94dc5SPeter Avalos.Fl k .
120836e94dc5SPeter AvalosWhen this option is specified, keys listed via the command line are merged into
120936e94dc5SPeter Avalosthe KRL, adding to those already there.
121036e94dc5SPeter Avalos.Pp
121136e94dc5SPeter AvalosIt is also possible, given a KRL, to test whether it revokes a particular key
121236e94dc5SPeter Avalos(or keys).
121336e94dc5SPeter AvalosThe
121436e94dc5SPeter Avalos.Fl Q
121536e94dc5SPeter Avalosflag will query an existing KRL, testing each key specified on the command line.
121636e94dc5SPeter AvalosIf any key listed on the command line has been revoked (or an error encountered)
121736e94dc5SPeter Avalosthen
121836e94dc5SPeter Avalos.Nm
121936e94dc5SPeter Avaloswill exit with a non-zero exit status.
122036e94dc5SPeter AvalosA zero exit status will only be returned if no key was revoked.
12210cbfa66cSDaniel Fojt.Sh ALLOWED SIGNERS
12220cbfa66cSDaniel FojtWhen verifying signatures,
12230cbfa66cSDaniel Fojt.Nm
12240cbfa66cSDaniel Fojtuses a simple list of identities and keys to determine whether a signature
12250cbfa66cSDaniel Fojtcomes from an authorized source.
12260cbfa66cSDaniel FojtThis "allowed signers" file uses a format patterned after the
12270cbfa66cSDaniel FojtAUTHORIZED_KEYS FILE FORMAT described in
12280cbfa66cSDaniel Fojt.Xr sshd 8 .
12290cbfa66cSDaniel FojtEach line of the file contains the following space-separated fields:
12300cbfa66cSDaniel Fojtprincipals, options, keytype, base64-encoded key.
12310cbfa66cSDaniel FojtEmpty lines and lines starting with a
12320cbfa66cSDaniel Fojt.Ql #
12330cbfa66cSDaniel Fojtare ignored as comments.
12340cbfa66cSDaniel Fojt.Pp
123550a69bb5SSascha WildnerThe principals field is a pattern-list (see PATTERNS in
12360cbfa66cSDaniel Fojt.Xr ssh_config 5 )
12370cbfa66cSDaniel Fojtconsisting of one or more comma-separated USER@DOMAIN identity patterns
12380cbfa66cSDaniel Fojtthat are accepted for signing.
12390cbfa66cSDaniel FojtWhen verifying, the identity presented via the
12400cbfa66cSDaniel Fojt.Fl I
12410cbfa66cSDaniel Fojtoption must match a principals pattern in order for the corresponding key to be
12420cbfa66cSDaniel Fojtconsidered acceptable for verification.
12430cbfa66cSDaniel Fojt.Pp
12440cbfa66cSDaniel FojtThe options (if present) consist of comma-separated option specifications.
12450cbfa66cSDaniel FojtNo spaces are permitted, except within double quotes.
12460cbfa66cSDaniel FojtThe following option specifications are supported (note that option keywords
12470cbfa66cSDaniel Fojtare case-insensitive):
12480cbfa66cSDaniel Fojt.Bl -tag -width Ds
12490cbfa66cSDaniel Fojt.It Cm cert-authority
12500cbfa66cSDaniel FojtIndicates that this key is accepted as a certificate authority (CA) and
12510cbfa66cSDaniel Fojtthat certificates signed by this CA may be accepted for verification.
125250a69bb5SSascha Wildner.It Cm namespaces Ns = Ns "namespace-list"
12530cbfa66cSDaniel FojtSpecifies a pattern-list of namespaces that are accepted for this key.
12540cbfa66cSDaniel FojtIf this option is present, the signature namespace embedded in the
12550cbfa66cSDaniel Fojtsignature object and presented on the verification command-line must
12560cbfa66cSDaniel Fojtmatch the specified list before the key will be considered acceptable.
125750a69bb5SSascha Wildner.It Cm valid-after Ns = Ns "timestamp"
125850a69bb5SSascha WildnerIndicates that the key is valid for use at or after the specified timestamp,
1259ee116499SAntonio Huete Jimenezwhich may be a date or time in the YYYYMMDD[Z] or YYYYMMDDHHMM[SS][Z] formats.
1260ee116499SAntonio Huete JimenezDates and times will be interpreted in the current system time zone unless
1261ee116499SAntonio Huete Jimenezsuffixed with a Z character, which causes them to be interpreted in the UTC
1262ee116499SAntonio Huete Jimeneztime zone.
126350a69bb5SSascha Wildner.It Cm valid-before Ns = Ns "timestamp"
126450a69bb5SSascha WildnerIndicates that the key is valid for use at or before the specified timestamp.
12650cbfa66cSDaniel Fojt.El
12660cbfa66cSDaniel Fojt.Pp
12670cbfa66cSDaniel FojtWhen verifying signatures made by certificates, the expected principal
12680cbfa66cSDaniel Fojtname must match both the principals pattern in the allowed signers file and
12690cbfa66cSDaniel Fojtthe principals embedded in the certificate itself.
12700cbfa66cSDaniel Fojt.Pp
12710cbfa66cSDaniel FojtAn example allowed signers file:
12720cbfa66cSDaniel Fojt.Bd -literal -offset 3n
12730cbfa66cSDaniel Fojt# Comments allowed at start of line
12740cbfa66cSDaniel Fojtuser1@example.com,user2@example.com ssh-rsa AAAAX1...
12750cbfa66cSDaniel Fojt# A certificate authority, trusted for all principals in a domain.
12760cbfa66cSDaniel Fojt*@example.com cert-authority ssh-ed25519 AAAB4...
12770cbfa66cSDaniel Fojt# A key that is accepted only for file signing.
12780cbfa66cSDaniel Fojtuser2@example.com namespaces="file" ssh-ed25519 AAA41...
12790cbfa66cSDaniel Fojt.Ed
12800cbfa66cSDaniel Fojt.Sh ENVIRONMENT
12810cbfa66cSDaniel Fojt.Bl -tag -width Ds
12820cbfa66cSDaniel Fojt.It Ev SSH_SK_PROVIDER
12830cbfa66cSDaniel FojtSpecifies a path to a library that will be used when loading any
12840cbfa66cSDaniel FojtFIDO authenticator-hosted keys, overriding the default of using
12850cbfa66cSDaniel Fojtthe built-in USB HID support.
12860cbfa66cSDaniel Fojt.El
128718de8d7fSPeter Avalos.Sh FILES
12889f304aafSPeter Avalos.Bl -tag -width Ds -compact
12899f304aafSPeter Avalos.It Pa ~/.ssh/id_ecdsa
12900cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ecdsa_sk
129136e94dc5SPeter Avalos.It Pa ~/.ssh/id_ed25519
12920cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ed25519_sk
129318de8d7fSPeter Avalos.It Pa ~/.ssh/id_rsa
1294*ba1276acSMatthew DillonContains the ECDSA, authenticator-hosted ECDSA, Ed25519,
12950cbfa66cSDaniel Fojtauthenticator-hosted Ed25519 or RSA authentication identity of the user.
129618de8d7fSPeter AvalosThis file should not be readable by anyone but the user.
129718de8d7fSPeter AvalosIt is possible to
129818de8d7fSPeter Avalosspecify a passphrase when generating the key; that passphrase will be
1299856ea928SPeter Avalosused to encrypt the private part of this file using 128-bit AES.
130018de8d7fSPeter AvalosThis file is not automatically accessed by
130118de8d7fSPeter Avalos.Nm
130218de8d7fSPeter Avalosbut it is offered as the default file for the private key.
130318de8d7fSPeter Avalos.Xr ssh 1
130418de8d7fSPeter Avaloswill read this file when a login attempt is made.
13059f304aafSPeter Avalos.Pp
13069f304aafSPeter Avalos.It Pa ~/.ssh/id_ecdsa.pub
13070cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ecdsa_sk.pub
130836e94dc5SPeter Avalos.It Pa ~/.ssh/id_ed25519.pub
13090cbfa66cSDaniel Fojt.It Pa ~/.ssh/id_ed25519_sk.pub
131018de8d7fSPeter Avalos.It Pa ~/.ssh/id_rsa.pub
1311*ba1276acSMatthew DillonContains the ECDSA, authenticator-hosted ECDSA, Ed25519,
13120cbfa66cSDaniel Fojtauthenticator-hosted Ed25519 or RSA public key for authentication.
131318de8d7fSPeter AvalosThe contents of this file should be added to
131418de8d7fSPeter Avalos.Pa ~/.ssh/authorized_keys
131518de8d7fSPeter Avaloson all machines
131618de8d7fSPeter Avaloswhere the user wishes to log in using public key authentication.
131718de8d7fSPeter AvalosThere is no need to keep the contents of this file secret.
13189f304aafSPeter Avalos.Pp
131918de8d7fSPeter Avalos.It Pa /etc/moduli
132018de8d7fSPeter AvalosContains Diffie-Hellman groups used for DH-GEX.
132118de8d7fSPeter AvalosThe file format is described in
132218de8d7fSPeter Avalos.Xr moduli 5 .
132318de8d7fSPeter Avalos.El
132418de8d7fSPeter Avalos.Sh SEE ALSO
132518de8d7fSPeter Avalos.Xr ssh 1 ,
132618de8d7fSPeter Avalos.Xr ssh-add 1 ,
132718de8d7fSPeter Avalos.Xr ssh-agent 1 ,
132818de8d7fSPeter Avalos.Xr moduli 5 ,
132918de8d7fSPeter Avalos.Xr sshd 8
133018de8d7fSPeter Avalos.Rs
133118de8d7fSPeter Avalos.%R RFC 4716
133218de8d7fSPeter Avalos.%T "The Secure Shell (SSH) Public Key File Format"
133318de8d7fSPeter Avalos.%D 2006
133418de8d7fSPeter Avalos.Re
133518de8d7fSPeter Avalos.Sh AUTHORS
133618de8d7fSPeter AvalosOpenSSH is a derivative of the original and free
133718de8d7fSPeter Avalosssh 1.2.12 release by Tatu Ylonen.
133818de8d7fSPeter AvalosAaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
133918de8d7fSPeter AvalosTheo de Raadt and Dug Song
134018de8d7fSPeter Avalosremoved many bugs, re-added newer features and
134118de8d7fSPeter Avaloscreated OpenSSH.
134218de8d7fSPeter AvalosMarkus Friedl contributed the support for SSH
134318de8d7fSPeter Avalosprotocol versions 1.5 and 2.0.
1344