xref: /freebsd/crypto/openssh/ssh-keygen.1 (revision 2f513db72b034fd5ef7f080b11be5c711c15186a)
1*2f513db7SEd Maste.\"	$OpenBSD: ssh-keygen.1,v 1.150 2018/09/12 06:18:59 djm Exp $
21e8db6e2SBrian Feldman.\"
3511b41d2SMark Murray.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4511b41d2SMark Murray.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5511b41d2SMark Murray.\"                    All rights reserved
6511b41d2SMark Murray.\"
7b66f2d16SKris Kennaway.\" As far as I am concerned, the code I have written for this software
8b66f2d16SKris Kennaway.\" can be used freely for any purpose.  Any derived versions of this
9b66f2d16SKris Kennaway.\" software must be clearly marked as such, and if the derived work is
10b66f2d16SKris Kennaway.\" incompatible with the protocol description in the RFC file, it must be
11b66f2d16SKris Kennaway.\" called by a name other than "ssh" or "Secure Shell".
12511b41d2SMark Murray.\"
13b66f2d16SKris Kennaway.\"
14b66f2d16SKris Kennaway.\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
15b66f2d16SKris Kennaway.\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
16b66f2d16SKris Kennaway.\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
17b66f2d16SKris Kennaway.\"
18b66f2d16SKris Kennaway.\" Redistribution and use in source and binary forms, with or without
19b66f2d16SKris Kennaway.\" modification, are permitted provided that the following conditions
20b66f2d16SKris Kennaway.\" are met:
21b66f2d16SKris Kennaway.\" 1. Redistributions of source code must retain the above copyright
22b66f2d16SKris Kennaway.\"    notice, this list of conditions and the following disclaimer.
23b66f2d16SKris Kennaway.\" 2. Redistributions in binary form must reproduce the above copyright
24b66f2d16SKris Kennaway.\"    notice, this list of conditions and the following disclaimer in the
25b66f2d16SKris Kennaway.\"    documentation and/or other materials provided with the distribution.
26b66f2d16SKris Kennaway.\"
27b66f2d16SKris Kennaway.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
28b66f2d16SKris Kennaway.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29b66f2d16SKris Kennaway.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30b66f2d16SKris Kennaway.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
31b66f2d16SKris Kennaway.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32b66f2d16SKris Kennaway.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33b66f2d16SKris Kennaway.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34b66f2d16SKris Kennaway.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35b66f2d16SKris Kennaway.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36b66f2d16SKris Kennaway.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37511b41d2SMark Murray.\"
38*2f513db7SEd Maste.Dd $Mdocdate: September 12 2018 $
39511b41d2SMark Murray.Dt SSH-KEYGEN 1
40511b41d2SMark Murray.Os
41511b41d2SMark Murray.Sh NAME
42511b41d2SMark Murray.Nm ssh-keygen
431e8db6e2SBrian Feldman.Nd authentication key generation, management and conversion
44511b41d2SMark Murray.Sh SYNOPSIS
45d0c8c0bcSDag-Erling Smørgrav.Bk -words
46e2f6069cSDag-Erling Smørgrav.Nm ssh-keygen
471e8db6e2SBrian Feldman.Op Fl q
48511b41d2SMark Murray.Op Fl b Ar bits
494f52dfbbSDag-Erling Smørgrav.Op Fl t Cm dsa | ecdsa | ed25519 | rsa
50511b41d2SMark Murray.Op Fl N Ar new_passphrase
51511b41d2SMark Murray.Op Fl C Ar comment
52b66f2d16SKris Kennaway.Op Fl f Ar output_keyfile
53511b41d2SMark Murray.Nm ssh-keygen
54511b41d2SMark Murray.Fl p
55511b41d2SMark Murray.Op Fl P Ar old_passphrase
56511b41d2SMark Murray.Op Fl N Ar new_passphrase
57511b41d2SMark Murray.Op Fl f Ar keyfile
58511b41d2SMark Murray.Nm ssh-keygen
591e8db6e2SBrian Feldman.Fl i
60e2f6069cSDag-Erling Smørgrav.Op Fl m Ar key_format
61b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile
62a04a10f8SKris Kennaway.Nm ssh-keygen
631e8db6e2SBrian Feldman.Fl e
64e2f6069cSDag-Erling Smørgrav.Op Fl m Ar key_format
65b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile
66a04a10f8SKris Kennaway.Nm ssh-keygen
67a04a10f8SKris Kennaway.Fl y
68b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile
69a04a10f8SKris Kennaway.Nm ssh-keygen
70511b41d2SMark Murray.Fl c
71511b41d2SMark Murray.Op Fl P Ar passphrase
72511b41d2SMark Murray.Op Fl C Ar comment
73511b41d2SMark Murray.Op Fl f Ar keyfile
74511b41d2SMark Murray.Nm ssh-keygen
75511b41d2SMark Murray.Fl l
76bc5531deSDag-Erling Smørgrav.Op Fl v
77bc5531deSDag-Erling Smørgrav.Op Fl E Ar fingerprint_hash
78b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile
79a04a10f8SKris Kennaway.Nm ssh-keygen
801e8db6e2SBrian Feldman.Fl B
811e8db6e2SBrian Feldman.Op Fl f Ar input_keyfile
82ae1f160dSDag-Erling Smørgrav.Nm ssh-keygen
83b15c8340SDag-Erling Smørgrav.Fl D Ar pkcs11
84ae1f160dSDag-Erling Smørgrav.Nm ssh-keygen
855e8dbd04SDag-Erling Smørgrav.Fl F Ar hostname
865e8dbd04SDag-Erling Smørgrav.Op Fl f Ar known_hosts_file
87cce7d346SDag-Erling Smørgrav.Op Fl l
885e8dbd04SDag-Erling Smørgrav.Nm ssh-keygen
895e8dbd04SDag-Erling Smørgrav.Fl H
905e8dbd04SDag-Erling Smørgrav.Op Fl f Ar known_hosts_file
915e8dbd04SDag-Erling Smørgrav.Nm ssh-keygen
925e8dbd04SDag-Erling Smørgrav.Fl R Ar hostname
935e8dbd04SDag-Erling Smørgrav.Op Fl f Ar known_hosts_file
945e8dbd04SDag-Erling Smørgrav.Nm ssh-keygen
95d95e11bfSDag-Erling Smørgrav.Fl r Ar hostname
96d95e11bfSDag-Erling Smørgrav.Op Fl f Ar input_keyfile
97d95e11bfSDag-Erling Smørgrav.Op Fl g
98d95e11bfSDag-Erling Smørgrav.Nm ssh-keygen
99d95e11bfSDag-Erling Smørgrav.Fl G Ar output_file
100efcad6b7SDag-Erling Smørgrav.Op Fl v
101d95e11bfSDag-Erling Smørgrav.Op Fl b Ar bits
102d95e11bfSDag-Erling Smørgrav.Op Fl M Ar memory
103d95e11bfSDag-Erling Smørgrav.Op Fl S Ar start_point
104d95e11bfSDag-Erling Smørgrav.Nm ssh-keygen
105d95e11bfSDag-Erling Smørgrav.Fl T Ar output_file
106d95e11bfSDag-Erling Smørgrav.Fl f Ar input_file
107efcad6b7SDag-Erling Smørgrav.Op Fl v
108f7167e0eSDag-Erling Smørgrav.Op Fl a Ar rounds
109462c32cbSDag-Erling Smørgrav.Op Fl J Ar num_lines
110462c32cbSDag-Erling Smørgrav.Op Fl j Ar start_line
111462c32cbSDag-Erling Smørgrav.Op Fl K Ar checkpt
112d95e11bfSDag-Erling Smørgrav.Op Fl W Ar generator
113b15c8340SDag-Erling Smørgrav.Nm ssh-keygen
114b15c8340SDag-Erling Smørgrav.Fl s Ar ca_key
115b15c8340SDag-Erling Smørgrav.Fl I Ar certificate_identity
116b15c8340SDag-Erling Smørgrav.Op Fl h
1174f52dfbbSDag-Erling Smørgrav.Op Fl U
1184f52dfbbSDag-Erling Smørgrav.Op Fl D Ar pkcs11_provider
119b15c8340SDag-Erling Smørgrav.Op Fl n Ar principals
120e2f6069cSDag-Erling Smørgrav.Op Fl O Ar option
121b15c8340SDag-Erling Smørgrav.Op Fl V Ar validity_interval
122e2f6069cSDag-Erling Smørgrav.Op Fl z Ar serial_number
123b15c8340SDag-Erling Smørgrav.Ar
124b15c8340SDag-Erling Smørgrav.Nm ssh-keygen
125b15c8340SDag-Erling Smørgrav.Fl L
126b15c8340SDag-Erling Smørgrav.Op Fl f Ar input_keyfile
127e146993eSDag-Erling Smørgrav.Nm ssh-keygen
128e146993eSDag-Erling Smørgrav.Fl A
1294f52dfbbSDag-Erling Smørgrav.Op Fl f Ar prefix_path
1306888a9beSDag-Erling Smørgrav.Nm ssh-keygen
1316888a9beSDag-Erling Smørgrav.Fl k
1326888a9beSDag-Erling Smørgrav.Fl f Ar krl_file
1336888a9beSDag-Erling Smørgrav.Op Fl u
1346888a9beSDag-Erling Smørgrav.Op Fl s Ar ca_public
1356888a9beSDag-Erling Smørgrav.Op Fl z Ar version_number
1366888a9beSDag-Erling Smørgrav.Ar
1376888a9beSDag-Erling Smørgrav.Nm ssh-keygen
1386888a9beSDag-Erling Smørgrav.Fl Q
1396888a9beSDag-Erling Smørgrav.Fl f Ar krl_file
1406888a9beSDag-Erling Smørgrav.Ar
141b15c8340SDag-Erling Smørgrav.Ek
142511b41d2SMark Murray.Sh DESCRIPTION
143511b41d2SMark Murray.Nm
1441e8db6e2SBrian Feldmangenerates, manages and converts authentication keys for
145511b41d2SMark Murray.Xr ssh 1 .
146a04a10f8SKris Kennaway.Nm
1474f52dfbbSDag-Erling Smørgravcan create keys for use by SSH protocol version 2.
148acc1a9efSDag-Erling Smørgrav.Pp
149d95e11bfSDag-Erling SmørgravThe type of key to be generated is specified with the
1501e8db6e2SBrian Feldman.Fl t
151ae1f160dSDag-Erling Smørgravoption.
152021d409fSDag-Erling SmørgravIf invoked without any arguments,
153021d409fSDag-Erling Smørgrav.Nm
1544f52dfbbSDag-Erling Smørgravwill generate an RSA key.
155a04a10f8SKris Kennaway.Pp
156d95e11bfSDag-Erling Smørgrav.Nm
157d95e11bfSDag-Erling Smørgravis also used to generate groups for use in Diffie-Hellman group
158d95e11bfSDag-Erling Smørgravexchange (DH-GEX).
159d95e11bfSDag-Erling SmørgravSee the
160d95e11bfSDag-Erling Smørgrav.Sx MODULI GENERATION
161d95e11bfSDag-Erling Smørgravsection for details.
162d95e11bfSDag-Erling Smørgrav.Pp
1636888a9beSDag-Erling SmørgravFinally,
1646888a9beSDag-Erling Smørgrav.Nm
1656888a9beSDag-Erling Smørgravcan be used to generate and update Key Revocation Lists, and to test whether
1666888a9beSDag-Erling Smørgravgiven keys have been revoked by one.
1676888a9beSDag-Erling SmørgravSee the
1686888a9beSDag-Erling Smørgrav.Sx KEY REVOCATION LISTS
1696888a9beSDag-Erling Smørgravsection for details.
1706888a9beSDag-Erling Smørgrav.Pp
171511b41d2SMark MurrayNormally each user wishing to use SSH
1724a421b63SDag-Erling Smørgravwith public key authentication runs this once to create the authentication
173511b41d2SMark Murraykey in
174f7167e0eSDag-Erling Smørgrav.Pa ~/.ssh/id_dsa ,
1754a421b63SDag-Erling Smørgrav.Pa ~/.ssh/id_ecdsa ,
176f7167e0eSDag-Erling Smørgrav.Pa ~/.ssh/id_ed25519
177a04a10f8SKris Kennawayor
178043840dfSDag-Erling Smørgrav.Pa ~/.ssh/id_rsa .
179a04a10f8SKris KennawayAdditionally, the system administrator may use this to generate host keys,
180a04a10f8SKris Kennawayas seen in
181a04a10f8SKris Kennaway.Pa /etc/rc .
182511b41d2SMark Murray.Pp
183511b41d2SMark MurrayNormally this program generates the key and asks for a file in which
184a8f6863aSKris Kennawayto store the private key.
185a8f6863aSKris KennawayThe public key is stored in a file with the same name but
186511b41d2SMark Murray.Dq .pub
187a8f6863aSKris Kennawayappended.
188a8f6863aSKris KennawayThe program also asks for a passphrase.
189a8f6863aSKris KennawayThe passphrase may be empty to indicate no passphrase
1901e8db6e2SBrian Feldman(host keys must have an empty passphrase), or it may be a string of
191a8f6863aSKris Kennawayarbitrary length.
192ae1f160dSDag-Erling SmørgravA passphrase is similar to a password, except it can be a phrase with a
193ae1f160dSDag-Erling Smørgravseries of words, punctuation, numbers, whitespace, or any string of
194ae1f160dSDag-Erling Smørgravcharacters you want.
195ae1f160dSDag-Erling SmørgravGood passphrases are 10-30 characters long, are
196511b41d2SMark Murraynot simple sentences or otherwise easily guessable (English
197ae1f160dSDag-Erling Smørgravprose has only 1-2 bits of entropy per character, and provides very bad
198ae1f160dSDag-Erling Smørgravpassphrases), and contain a mix of upper and lowercase letters,
199ae1f160dSDag-Erling Smørgravnumbers, and non-alphanumeric characters.
200a8f6863aSKris KennawayThe passphrase can be changed later by using the
201511b41d2SMark Murray.Fl p
202511b41d2SMark Murrayoption.
203511b41d2SMark Murray.Pp
204a8f6863aSKris KennawayThere is no way to recover a lost passphrase.
205e146993eSDag-Erling SmørgravIf the passphrase is lost or forgotten, a new key must be generated
206e146993eSDag-Erling Smørgravand the corresponding public key copied to other machines.
207511b41d2SMark Murray.Pp
2084f52dfbbSDag-Erling SmørgravFor keys stored in the newer OpenSSH format,
2091e8db6e2SBrian Feldmanthere is also a comment field in the key file that is only for
210a8f6863aSKris Kennawayconvenience to the user to help identify the key.
211a8f6863aSKris KennawayThe comment can tell what the key is for, or whatever is useful.
212a8f6863aSKris KennawayThe comment is initialized to
213511b41d2SMark Murray.Dq user@host
214511b41d2SMark Murraywhen the key is created, but can be changed using the
215511b41d2SMark Murray.Fl c
216511b41d2SMark Murrayoption.
217511b41d2SMark Murray.Pp
218a04a10f8SKris KennawayAfter a key is generated, instructions below detail where the keys
219a04a10f8SKris Kennawayshould be placed to be activated.
220a04a10f8SKris Kennaway.Pp
221511b41d2SMark MurrayThe options are as follows:
222511b41d2SMark Murray.Bl -tag -width Ds
223e146993eSDag-Erling Smørgrav.It Fl A
2244f52dfbbSDag-Erling SmørgravFor each of the key types (rsa, dsa, ecdsa and ed25519)
225f7167e0eSDag-Erling Smørgravfor which host keys
226e146993eSDag-Erling Smørgravdo not exist, generate the host keys with the default key file path,
227e146993eSDag-Erling Smørgravan empty passphrase, default bits for the key type, and default comment.
2284f52dfbbSDag-Erling SmørgravIf
2294f52dfbbSDag-Erling Smørgrav.Fl f
2304f52dfbbSDag-Erling Smørgravhas also been specified, its argument is used as a prefix to the
2314f52dfbbSDag-Erling Smørgravdefault path for the resulting host key files.
232e146993eSDag-Erling SmørgravThis is used by
233e146993eSDag-Erling Smørgrav.Pa /etc/rc
234e146993eSDag-Erling Smørgravto generate new host keys.
235f7167e0eSDag-Erling Smørgrav.It Fl a Ar rounds
236190cef3dSDag-Erling SmørgravWhen saving a private key this option specifies the number of KDF
237190cef3dSDag-Erling Smørgrav(key derivation function) rounds used.
238f7167e0eSDag-Erling SmørgravHigher numbers result in slower passphrase verification and increased
239f7167e0eSDag-Erling Smørgravresistance to brute-force password cracking (should the keys be stolen).
240f7167e0eSDag-Erling Smørgrav.Pp
2414f52dfbbSDag-Erling SmørgravWhen screening DH-GEX candidates (using the
242d95e11bfSDag-Erling Smørgrav.Fl T
243f7167e0eSDag-Erling Smørgravcommand).
244f7167e0eSDag-Erling SmørgravThis option specifies the number of primality tests to perform.
2455e8dbd04SDag-Erling Smørgrav.It Fl B
2465e8dbd04SDag-Erling SmørgravShow the bubblebabble digest of specified private or public key file.
247511b41d2SMark Murray.It Fl b Ar bits
248a8f6863aSKris KennawaySpecifies the number of bits in the key to create.
249eccfee6eSDag-Erling SmørgravFor RSA keys, the minimum size is 1024 bits and the default is 2048 bits.
250043840dfSDag-Erling SmørgravGenerally, 2048 bits is considered sufficient.
251021d409fSDag-Erling SmørgravDSA keys must be exactly 1024 bits as specified by FIPS 186-2.
252e146993eSDag-Erling SmørgravFor ECDSA keys, the
253e146993eSDag-Erling Smørgrav.Fl b
254462c32cbSDag-Erling Smørgravflag determines the key length by selecting from one of three elliptic
255e146993eSDag-Erling Smørgravcurve sizes: 256, 384 or 521 bits.
256e146993eSDag-Erling SmørgravAttempting to use bit lengths other than these three values for ECDSA keys
257e146993eSDag-Erling Smørgravwill fail.
258bc5531deSDag-Erling SmørgravEd25519 keys have a fixed length and the
259f7167e0eSDag-Erling Smørgrav.Fl b
260f7167e0eSDag-Erling Smørgravflag will be ignored.
2615e8dbd04SDag-Erling Smørgrav.It Fl C Ar comment
2625e8dbd04SDag-Erling SmørgravProvides a new comment.
263511b41d2SMark Murray.It Fl c
264511b41d2SMark MurrayRequests changing the comment in the private and public key files.
265511b41d2SMark MurrayThe program will prompt for the file containing the private keys, for
266ae1f160dSDag-Erling Smørgravthe passphrase if the key has one, and for the new comment.
267b15c8340SDag-Erling Smørgrav.It Fl D Ar pkcs11
268b15c8340SDag-Erling SmørgravDownload the RSA public keys provided by the PKCS#11 shared library
269b15c8340SDag-Erling Smørgrav.Ar pkcs11 .
270e2f6069cSDag-Erling SmørgravWhen used in combination with
271e2f6069cSDag-Erling Smørgrav.Fl s ,
272e2f6069cSDag-Erling Smørgravthis option indicates that a CA key resides in a PKCS#11 token (see the
273e2f6069cSDag-Erling Smørgrav.Sx CERTIFICATES
274e2f6069cSDag-Erling Smørgravsection for details).
275bc5531deSDag-Erling Smørgrav.It Fl E Ar fingerprint_hash
276bc5531deSDag-Erling SmørgravSpecifies the hash algorithm used when displaying key fingerprints.
277bc5531deSDag-Erling SmørgravValid options are:
278bc5531deSDag-Erling Smørgrav.Dq md5
279bc5531deSDag-Erling Smørgravand
280bc5531deSDag-Erling Smørgrav.Dq sha256 .
281bc5531deSDag-Erling SmørgravThe default is
282bc5531deSDag-Erling Smørgrav.Dq sha256 .
2831e8db6e2SBrian Feldman.It Fl e
2841e8db6e2SBrian FeldmanThis option will read a private or public OpenSSH key file and
285e2f6069cSDag-Erling Smørgravprint to stdout the key in one of the formats specified by the
286e2f6069cSDag-Erling Smørgrav.Fl m
287e2f6069cSDag-Erling Smørgravoption.
288e2f6069cSDag-Erling SmørgravThe default export format is
289e2f6069cSDag-Erling Smørgrav.Dq RFC4716 .
290e2f6069cSDag-Erling SmørgravThis option allows exporting OpenSSH keys for use by other programs, including
291e2f6069cSDag-Erling Smørgravseveral commercial SSH implementations.
2925e8dbd04SDag-Erling Smørgrav.It Fl F Ar hostname
2935e8dbd04SDag-Erling SmørgravSearch for the specified
2945e8dbd04SDag-Erling Smørgrav.Ar hostname
2955e8dbd04SDag-Erling Smørgravin a
2965e8dbd04SDag-Erling Smørgrav.Pa known_hosts
2975e8dbd04SDag-Erling Smørgravfile, listing any occurrences found.
2985e8dbd04SDag-Erling SmørgravThis option is useful to find hashed host names or addresses and may also be
2995e8dbd04SDag-Erling Smørgravused in conjunction with the
3005e8dbd04SDag-Erling Smørgrav.Fl H
3015e8dbd04SDag-Erling Smørgravoption to print found keys in a hashed format.
3025e8dbd04SDag-Erling Smørgrav.It Fl f Ar filename
3035e8dbd04SDag-Erling SmørgravSpecifies the filename of the key file.
3045e8dbd04SDag-Erling Smørgrav.It Fl G Ar output_file
3055e8dbd04SDag-Erling SmørgravGenerate candidate primes for DH-GEX.
3065e8dbd04SDag-Erling SmørgravThese primes must be screened for
3075e8dbd04SDag-Erling Smørgravsafety (using the
3085e8dbd04SDag-Erling Smørgrav.Fl T
3095e8dbd04SDag-Erling Smørgravoption) before use.
310d95e11bfSDag-Erling Smørgrav.It Fl g
311d74d50a8SDag-Erling SmørgravUse generic DNS format when printing fingerprint resource records using the
312d74d50a8SDag-Erling Smørgrav.Fl r
313d74d50a8SDag-Erling Smørgravcommand.
3145e8dbd04SDag-Erling Smørgrav.It Fl H
3155e8dbd04SDag-Erling SmørgravHash a
3165e8dbd04SDag-Erling Smørgrav.Pa known_hosts
3174518870cSDag-Erling Smørgravfile.
3184518870cSDag-Erling SmørgravThis replaces all hostnames and addresses with hashed representations
3194518870cSDag-Erling Smørgravwithin the specified file; the original content is moved to a file with
3204518870cSDag-Erling Smørgrava .old suffix.
3215e8dbd04SDag-Erling SmørgravThese hashes may be used normally by
3225e8dbd04SDag-Erling Smørgrav.Nm ssh
3235e8dbd04SDag-Erling Smørgravand
3245e8dbd04SDag-Erling Smørgrav.Nm sshd ,
3255e8dbd04SDag-Erling Smørgravbut they do not reveal identifying information should the file's contents
3265e8dbd04SDag-Erling Smørgravbe disclosed.
3275e8dbd04SDag-Erling SmørgravThis option will not modify existing hashed hostnames and is therefore safe
3285e8dbd04SDag-Erling Smørgravto use on files that mix hashed and non-hashed names.
329b15c8340SDag-Erling Smørgrav.It Fl h
330b15c8340SDag-Erling SmørgravWhen signing a key, create a host certificate instead of a user
331b15c8340SDag-Erling Smørgravcertificate.
332b15c8340SDag-Erling SmørgravPlease see the
333b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES
334b15c8340SDag-Erling Smørgravsection for details.
335b15c8340SDag-Erling Smørgrav.It Fl I Ar certificate_identity
336b15c8340SDag-Erling SmørgravSpecify the key identity when signing a public key.
337b15c8340SDag-Erling SmørgravPlease see the
338b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES
339b15c8340SDag-Erling Smørgravsection for details.
3401e8db6e2SBrian Feldman.It Fl i
3411e8db6e2SBrian FeldmanThis option will read an unencrypted private (or public) key file
342e2f6069cSDag-Erling Smørgravin the format specified by the
343e2f6069cSDag-Erling Smørgrav.Fl m
344e2f6069cSDag-Erling Smørgravoption and print an OpenSSH compatible private
3451e8db6e2SBrian Feldman(or public) key to stdout.
346a0ee8cc6SDag-Erling SmørgravThis option allows importing keys from other software, including several
347a0ee8cc6SDag-Erling Smørgravcommercial SSH implementations.
348a0ee8cc6SDag-Erling SmørgravThe default import format is
349a0ee8cc6SDag-Erling Smørgrav.Dq RFC4716 .
350462c32cbSDag-Erling Smørgrav.It Fl J Ar num_lines
351462c32cbSDag-Erling SmørgravExit after screening the specified number of lines
352462c32cbSDag-Erling Smørgravwhile performing DH candidate screening using the
353462c32cbSDag-Erling Smørgrav.Fl T
354462c32cbSDag-Erling Smørgravoption.
355462c32cbSDag-Erling Smørgrav.It Fl j Ar start_line
356462c32cbSDag-Erling SmørgravStart screening at the specified line number
357462c32cbSDag-Erling Smørgravwhile performing DH candidate screening using the
358462c32cbSDag-Erling Smørgrav.Fl T
359462c32cbSDag-Erling Smørgravoption.
360462c32cbSDag-Erling Smørgrav.It Fl K Ar checkpt
361462c32cbSDag-Erling SmørgravWrite the last line processed to the file
362462c32cbSDag-Erling Smørgrav.Ar checkpt
363462c32cbSDag-Erling Smørgravwhile performing DH candidate screening using the
364462c32cbSDag-Erling Smørgrav.Fl T
365462c32cbSDag-Erling Smørgravoption.
366462c32cbSDag-Erling SmørgravThis will be used to skip lines in the input file that have already been
367462c32cbSDag-Erling Smørgravprocessed if the job is restarted.
3686888a9beSDag-Erling Smørgrav.It Fl k
3696888a9beSDag-Erling SmørgravGenerate a KRL file.
3706888a9beSDag-Erling SmørgravIn this mode,
3716888a9beSDag-Erling Smørgrav.Nm
3726888a9beSDag-Erling Smørgravwill generate a KRL file at the location specified via the
3736888a9beSDag-Erling Smørgrav.Fl f
3746888a9beSDag-Erling Smørgravflag that revokes every key or certificate presented on the command line.
3756888a9beSDag-Erling SmørgravKeys/certificates to be revoked may be specified by public key file or
3766888a9beSDag-Erling Smørgravusing the format described in the
3776888a9beSDag-Erling Smørgrav.Sx KEY REVOCATION LISTS
3786888a9beSDag-Erling Smørgravsection.
379b15c8340SDag-Erling Smørgrav.It Fl L
380acc1a9efSDag-Erling SmørgravPrints the contents of one or more certificates.
381511b41d2SMark Murray.It Fl l
382ae1f160dSDag-Erling SmørgravShow fingerprint of specified public key file.
383ae1f160dSDag-Erling SmørgravFor RSA and DSA keys
384ae1f160dSDag-Erling Smørgrav.Nm
385ae1f160dSDag-Erling Smørgravtries to find the matching public key file and prints its fingerprint.
386d4af9e69SDag-Erling SmørgravIf combined with
387d4af9e69SDag-Erling Smørgrav.Fl v ,
388076ad2f8SDag-Erling Smørgrava visual ASCII art representation of the key is supplied with the
389076ad2f8SDag-Erling Smørgravfingerprint.
3905e8dbd04SDag-Erling Smørgrav.It Fl M Ar memory
3915e8dbd04SDag-Erling SmørgravSpecify the amount of memory to use (in megabytes) when generating
3925e8dbd04SDag-Erling Smørgravcandidate moduli for DH-GEX.
393e2f6069cSDag-Erling Smørgrav.It Fl m Ar key_format
394e2f6069cSDag-Erling SmørgravSpecify a key format for the
395e2f6069cSDag-Erling Smørgrav.Fl i
396e2f6069cSDag-Erling Smørgrav(import) or
397e2f6069cSDag-Erling Smørgrav.Fl e
398e2f6069cSDag-Erling Smørgrav(export) conversion options.
399e2f6069cSDag-Erling SmørgravThe supported key formats are:
400e2f6069cSDag-Erling Smørgrav.Dq RFC4716
401e2f6069cSDag-Erling Smørgrav(RFC 4716/SSH2 public or private key),
402e2f6069cSDag-Erling Smørgrav.Dq PKCS8
403e2f6069cSDag-Erling Smørgrav(PEM PKCS8 public key)
404e2f6069cSDag-Erling Smørgravor
405e2f6069cSDag-Erling Smørgrav.Dq PEM
406e2f6069cSDag-Erling Smørgrav(PEM public key).
407e2f6069cSDag-Erling SmørgravThe default conversion format is
408e2f6069cSDag-Erling Smørgrav.Dq RFC4716 .
409190cef3dSDag-Erling SmørgravSetting a format of
410190cef3dSDag-Erling Smørgrav.Dq PEM
411190cef3dSDag-Erling Smørgravwhen generating or updating a supported private key type will cause the
412190cef3dSDag-Erling Smørgravkey to be stored in the legacy PEM private key format.
4135e8dbd04SDag-Erling Smørgrav.It Fl N Ar new_passphrase
4145e8dbd04SDag-Erling SmørgravProvides the new passphrase.
415b15c8340SDag-Erling Smørgrav.It Fl n Ar principals
416b15c8340SDag-Erling SmørgravSpecify one or more principals (user or host names) to be included in
417b15c8340SDag-Erling Smørgrava certificate when signing a key.
418b15c8340SDag-Erling SmørgravMultiple principals may be specified, separated by commas.
419b15c8340SDag-Erling SmørgravPlease see the
420b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES
421b15c8340SDag-Erling Smørgravsection for details.
422e2f6069cSDag-Erling Smørgrav.It Fl O Ar option
423e2f6069cSDag-Erling SmørgravSpecify a certificate option when signing a key.
424b15c8340SDag-Erling SmørgravThis option may be specified multiple times.
4254f52dfbbSDag-Erling SmørgravSee also the
426b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES
4274f52dfbbSDag-Erling Smørgravsection for further details.
42847dd1d1bSDag-Erling Smørgrav.Pp
42947dd1d1bSDag-Erling SmørgravAt present, no standard options are valid for host keys.
430e2f6069cSDag-Erling SmørgravThe options that are valid for user certificates are:
4314f52dfbbSDag-Erling Smørgrav.Pp
4324f52dfbbSDag-Erling Smørgrav.Bl -tag -width Ds -compact
4338ad9b54aSDag-Erling Smørgrav.It Ic clear
4348ad9b54aSDag-Erling SmørgravClear all enabled permissions.
4358ad9b54aSDag-Erling SmørgravThis is useful for clearing the default set of permissions so permissions may
4368ad9b54aSDag-Erling Smørgravbe added individually.
4374f52dfbbSDag-Erling Smørgrav.Pp
4384f52dfbbSDag-Erling Smørgrav.It Ic critical : Ns Ar name Ns Op Ns = Ns Ar contents
4394f52dfbbSDag-Erling Smørgrav.It Ic extension : Ns Ar name Ns Op Ns = Ns Ar contents
4404f52dfbbSDag-Erling SmørgravIncludes an arbitrary certificate critical option or extension.
4414f52dfbbSDag-Erling SmørgravThe specified
4424f52dfbbSDag-Erling Smørgrav.Ar name
4434f52dfbbSDag-Erling Smørgravshould include a domain suffix, e.g.\&
4444f52dfbbSDag-Erling Smørgrav.Dq name@example.com .
4454f52dfbbSDag-Erling SmørgravIf
4464f52dfbbSDag-Erling Smørgrav.Ar contents
4474f52dfbbSDag-Erling Smørgravis specified then it is included as the contents of the extension/option
4484f52dfbbSDag-Erling Smørgravencoded as a string, otherwise the extension/option is created with no
4494f52dfbbSDag-Erling Smørgravcontents (usually indicating a flag).
4504f52dfbbSDag-Erling SmørgravExtensions may be ignored by a client or server that does not recognise them,
4514f52dfbbSDag-Erling Smørgravwhereas unknown critical options will cause the certificate to be refused.
4524f52dfbbSDag-Erling Smørgrav.Pp
4538ad9b54aSDag-Erling Smørgrav.It Ic force-command Ns = Ns Ar command
4548ad9b54aSDag-Erling SmørgravForces the execution of
4558ad9b54aSDag-Erling Smørgrav.Ar command
4568ad9b54aSDag-Erling Smørgravinstead of any shell or command specified by the user when
4578ad9b54aSDag-Erling Smørgravthe certificate is used for authentication.
4584f52dfbbSDag-Erling Smørgrav.Pp
459b15c8340SDag-Erling Smørgrav.It Ic no-agent-forwarding
460b15c8340SDag-Erling SmørgravDisable
461b15c8340SDag-Erling Smørgrav.Xr ssh-agent 1
462b15c8340SDag-Erling Smørgravforwarding (permitted by default).
4634f52dfbbSDag-Erling Smørgrav.Pp
464b15c8340SDag-Erling Smørgrav.It Ic no-port-forwarding
465b15c8340SDag-Erling SmørgravDisable port forwarding (permitted by default).
4664f52dfbbSDag-Erling Smørgrav.Pp
467b15c8340SDag-Erling Smørgrav.It Ic no-pty
468b15c8340SDag-Erling SmørgravDisable PTY allocation (permitted by default).
4694f52dfbbSDag-Erling Smørgrav.Pp
470b15c8340SDag-Erling Smørgrav.It Ic no-user-rc
471b15c8340SDag-Erling SmørgravDisable execution of
472b15c8340SDag-Erling Smørgrav.Pa ~/.ssh/rc
473b15c8340SDag-Erling Smørgravby
474b15c8340SDag-Erling Smørgrav.Xr sshd 8
475b15c8340SDag-Erling Smørgrav(permitted by default).
4764f52dfbbSDag-Erling Smørgrav.Pp
4778ad9b54aSDag-Erling Smørgrav.It Ic no-x11-forwarding
4788ad9b54aSDag-Erling SmørgravDisable X11 forwarding (permitted by default).
4794f52dfbbSDag-Erling Smørgrav.Pp
480b15c8340SDag-Erling Smørgrav.It Ic permit-agent-forwarding
481b15c8340SDag-Erling SmørgravAllows
482b15c8340SDag-Erling Smørgrav.Xr ssh-agent 1
483b15c8340SDag-Erling Smørgravforwarding.
4844f52dfbbSDag-Erling Smørgrav.Pp
485b15c8340SDag-Erling Smørgrav.It Ic permit-port-forwarding
486b15c8340SDag-Erling SmørgravAllows port forwarding.
4874f52dfbbSDag-Erling Smørgrav.Pp
488b15c8340SDag-Erling Smørgrav.It Ic permit-pty
489b15c8340SDag-Erling SmørgravAllows PTY allocation.
4904f52dfbbSDag-Erling Smørgrav.Pp
491b15c8340SDag-Erling Smørgrav.It Ic permit-user-rc
492b15c8340SDag-Erling SmørgravAllows execution of
493b15c8340SDag-Erling Smørgrav.Pa ~/.ssh/rc
494b15c8340SDag-Erling Smørgravby
495b15c8340SDag-Erling Smørgrav.Xr sshd 8 .
4964f52dfbbSDag-Erling Smørgrav.Pp
49747dd1d1bSDag-Erling Smørgrav.It Ic permit-X11-forwarding
4988ad9b54aSDag-Erling SmørgravAllows X11 forwarding.
4994f52dfbbSDag-Erling Smørgrav.Pp
5008ad9b54aSDag-Erling Smørgrav.It Ic source-address Ns = Ns Ar address_list
5018ad9b54aSDag-Erling SmørgravRestrict the source addresses from which the certificate is considered valid.
502b15c8340SDag-Erling SmørgravThe
503b15c8340SDag-Erling Smørgrav.Ar address_list
504b15c8340SDag-Erling Smørgravis a comma-separated list of one or more address/netmask pairs in CIDR
505b15c8340SDag-Erling Smørgravformat.
506b15c8340SDag-Erling Smørgrav.El
5075e8dbd04SDag-Erling Smørgrav.It Fl P Ar passphrase
5085e8dbd04SDag-Erling SmørgravProvides the (old) passphrase.
509511b41d2SMark Murray.It Fl p
510511b41d2SMark MurrayRequests changing the passphrase of a private key file instead of
511a8f6863aSKris Kennawaycreating a new private key.
512a8f6863aSKris KennawayThe program will prompt for the file
513511b41d2SMark Murraycontaining the private key, for the old passphrase, and twice for the
514511b41d2SMark Murraynew passphrase.
5156888a9beSDag-Erling Smørgrav.It Fl Q
5166888a9beSDag-Erling SmørgravTest whether keys have been revoked in a KRL.
517511b41d2SMark Murray.It Fl q
518511b41d2SMark MurraySilence
519511b41d2SMark Murray.Nm ssh-keygen .
5205e8dbd04SDag-Erling Smørgrav.It Fl R Ar hostname
5215e8dbd04SDag-Erling SmørgravRemoves all keys belonging to
5225e8dbd04SDag-Erling Smørgrav.Ar hostname
5235e8dbd04SDag-Erling Smørgravfrom a
5245e8dbd04SDag-Erling Smørgrav.Pa known_hosts
5255e8dbd04SDag-Erling Smørgravfile.
5265e8dbd04SDag-Erling SmørgravThis option is useful to delete hashed hosts (see the
5275e8dbd04SDag-Erling Smørgrav.Fl H
5285e8dbd04SDag-Erling Smørgravoption above).
5295e8dbd04SDag-Erling Smørgrav.It Fl r Ar hostname
5305e8dbd04SDag-Erling SmørgravPrint the SSHFP fingerprint resource record named
5315e8dbd04SDag-Erling Smørgrav.Ar hostname
5325e8dbd04SDag-Erling Smørgravfor the specified public key file.
5335e8dbd04SDag-Erling Smørgrav.It Fl S Ar start
5345e8dbd04SDag-Erling SmørgravSpecify start point (in hex) when generating candidate moduli for DH-GEX.
535b15c8340SDag-Erling Smørgrav.It Fl s Ar ca_key
536b15c8340SDag-Erling SmørgravCertify (sign) a public key using the specified CA key.
537b15c8340SDag-Erling SmørgravPlease see the
538b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES
539b15c8340SDag-Erling Smørgravsection for details.
5406888a9beSDag-Erling Smørgrav.Pp
5416888a9beSDag-Erling SmørgravWhen generating a KRL,
5426888a9beSDag-Erling Smørgrav.Fl s
5436888a9beSDag-Erling Smørgravspecifies a path to a CA public key file used to revoke certificates directly
5446888a9beSDag-Erling Smørgravby key ID or serial number.
5456888a9beSDag-Erling SmørgravSee the
5466888a9beSDag-Erling Smørgrav.Sx KEY REVOCATION LISTS
5476888a9beSDag-Erling Smørgravsection for details.
5485e8dbd04SDag-Erling Smørgrav.It Fl T Ar output_file
5495e8dbd04SDag-Erling SmørgravTest DH group exchange candidate primes (generated using the
5505e8dbd04SDag-Erling Smørgrav.Fl G
5515e8dbd04SDag-Erling Smørgravoption) for safety.
5524f52dfbbSDag-Erling Smørgrav.It Fl t Cm dsa | ecdsa | ed25519 | rsa
5535e8dbd04SDag-Erling SmørgravSpecifies the type of key to create.
5541e8db6e2SBrian FeldmanThe possible values are
5554a421b63SDag-Erling Smørgrav.Dq dsa ,
556f7167e0eSDag-Erling Smørgrav.Dq ecdsa ,
557f7167e0eSDag-Erling Smørgrav.Dq ed25519 ,
5581e8db6e2SBrian Feldmanor
5594f52dfbbSDag-Erling Smørgrav.Dq rsa .
5604f52dfbbSDag-Erling Smørgrav.It Fl U
5614f52dfbbSDag-Erling SmørgravWhen used in combination with
5624f52dfbbSDag-Erling Smørgrav.Fl s ,
5634f52dfbbSDag-Erling Smørgravthis option indicates that a CA key resides in a
5644f52dfbbSDag-Erling Smørgrav.Xr ssh-agent 1 .
5654f52dfbbSDag-Erling SmørgravSee the
5664f52dfbbSDag-Erling Smørgrav.Sx CERTIFICATES
5674f52dfbbSDag-Erling Smørgravsection for more information.
5686888a9beSDag-Erling Smørgrav.It Fl u
5696888a9beSDag-Erling SmørgravUpdate a KRL.
5706888a9beSDag-Erling SmørgravWhen specified with
5716888a9beSDag-Erling Smørgrav.Fl k ,
5726888a9beSDag-Erling Smørgravkeys listed via the command line are added to the existing KRL rather than
5736888a9beSDag-Erling Smørgrava new KRL being created.
574b15c8340SDag-Erling Smørgrav.It Fl V Ar validity_interval
575b15c8340SDag-Erling SmørgravSpecify a validity interval when signing a certificate.
576b15c8340SDag-Erling SmørgravA validity interval may consist of a single time, indicating that the
577b15c8340SDag-Erling Smørgravcertificate is valid beginning now and expiring at that time, or may consist
578b15c8340SDag-Erling Smørgravof two times separated by a colon to indicate an explicit time interval.
57947dd1d1bSDag-Erling Smørgrav.Pp
58047dd1d1bSDag-Erling SmørgravThe start time may be specified as the string
58147dd1d1bSDag-Erling Smørgrav.Dq always
58247dd1d1bSDag-Erling Smørgravto indicate the certificate has no specified start time,
58347dd1d1bSDag-Erling Smørgrava date in YYYYMMDD format, a time in YYYYMMDDHHMM[SS] format,
58447dd1d1bSDag-Erling Smørgrava relative time (to the current time) consisting of a minus sign followed by
58547dd1d1bSDag-Erling Smørgravan interval in the format described in the
586e4a9863fSDag-Erling SmørgravTIME FORMATS section of
5878ad9b54aSDag-Erling Smørgrav.Xr sshd_config 5 .
58847dd1d1bSDag-Erling Smørgrav.Pp
58947dd1d1bSDag-Erling SmørgravThe end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMM[SS] time,
59047dd1d1bSDag-Erling Smørgrava relative time starting with a plus character or the string
59147dd1d1bSDag-Erling Smørgrav.Dq forever
59247dd1d1bSDag-Erling Smørgravto indicate that the certificate has no expirty date.
593b15c8340SDag-Erling Smørgrav.Pp
594b15c8340SDag-Erling SmørgravFor example:
595b15c8340SDag-Erling Smørgrav.Dq +52w1d
596b15c8340SDag-Erling Smørgrav(valid from now to 52 weeks and one day from now),
597b15c8340SDag-Erling Smørgrav.Dq -4w:+4w
598b15c8340SDag-Erling Smørgrav(valid from four weeks ago to four weeks from now),
599b15c8340SDag-Erling Smørgrav.Dq 20100101123000:20110101123000
600b15c8340SDag-Erling Smørgrav(valid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011),
601b15c8340SDag-Erling Smørgrav.Dq -1d:20110101
602b15c8340SDag-Erling Smørgrav(valid from yesterday to midnight, January 1st, 2011).
60347dd1d1bSDag-Erling Smørgrav.Dq -1m:forever
60447dd1d1bSDag-Erling Smørgrav(valid from one minute ago and never expiring).
605efcad6b7SDag-Erling Smørgrav.It Fl v
606efcad6b7SDag-Erling SmørgravVerbose mode.
607efcad6b7SDag-Erling SmørgravCauses
608efcad6b7SDag-Erling Smørgrav.Nm
609efcad6b7SDag-Erling Smørgravto print debugging messages about its progress.
610efcad6b7SDag-Erling SmørgravThis is helpful for debugging moduli generation.
611efcad6b7SDag-Erling SmørgravMultiple
612efcad6b7SDag-Erling Smørgrav.Fl v
613efcad6b7SDag-Erling Smørgravoptions increase the verbosity.
614efcad6b7SDag-Erling SmørgravThe maximum is 3.
6155e8dbd04SDag-Erling Smørgrav.It Fl W Ar generator
6165e8dbd04SDag-Erling SmørgravSpecify desired generator when testing candidate moduli for DH-GEX.
6175e8dbd04SDag-Erling Smørgrav.It Fl y
6185e8dbd04SDag-Erling SmørgravThis option will read a private
6195e8dbd04SDag-Erling SmørgravOpenSSH format file and print an OpenSSH public key to stdout.
620e2f6069cSDag-Erling Smørgrav.It Fl z Ar serial_number
621e2f6069cSDag-Erling SmørgravSpecifies a serial number to be embedded in the certificate to distinguish
622e2f6069cSDag-Erling Smørgravthis certificate from others from the same CA.
623e2f6069cSDag-Erling SmørgravThe default serial number is zero.
6246888a9beSDag-Erling Smørgrav.Pp
6256888a9beSDag-Erling SmørgravWhen generating a KRL, the
6266888a9beSDag-Erling Smørgrav.Fl z
6276888a9beSDag-Erling Smørgravflag is used to specify a KRL version number.
628511b41d2SMark Murray.El
629d95e11bfSDag-Erling Smørgrav.Sh MODULI GENERATION
630d95e11bfSDag-Erling Smørgrav.Nm
631d95e11bfSDag-Erling Smørgravmay be used to generate groups for the Diffie-Hellman Group Exchange
632d95e11bfSDag-Erling Smørgrav(DH-GEX) protocol.
633d95e11bfSDag-Erling SmørgravGenerating these groups is a two-step process: first, candidate
634d95e11bfSDag-Erling Smørgravprimes are generated using a fast, but memory intensive process.
635d95e11bfSDag-Erling SmørgravThese candidate primes are then tested for suitability (a CPU-intensive
636d95e11bfSDag-Erling Smørgravprocess).
637d95e11bfSDag-Erling Smørgrav.Pp
638d95e11bfSDag-Erling SmørgravGeneration of primes is performed using the
639d95e11bfSDag-Erling Smørgrav.Fl G
640d95e11bfSDag-Erling Smørgravoption.
641d95e11bfSDag-Erling SmørgravThe desired length of the primes may be specified by the
642d95e11bfSDag-Erling Smørgrav.Fl b
643d95e11bfSDag-Erling Smørgravoption.
644d95e11bfSDag-Erling SmørgravFor example:
645d95e11bfSDag-Erling Smørgrav.Pp
6465e8dbd04SDag-Erling Smørgrav.Dl # ssh-keygen -G moduli-2048.candidates -b 2048
647d95e11bfSDag-Erling Smørgrav.Pp
648d95e11bfSDag-Erling SmørgravBy default, the search for primes begins at a random point in the
649d95e11bfSDag-Erling Smørgravdesired length range.
650d95e11bfSDag-Erling SmørgravThis may be overridden using the
651d95e11bfSDag-Erling Smørgrav.Fl S
652d95e11bfSDag-Erling Smørgravoption, which specifies a different start point (in hex).
653d95e11bfSDag-Erling Smørgrav.Pp
654462c32cbSDag-Erling SmørgravOnce a set of candidates have been generated, they must be screened for
655d95e11bfSDag-Erling Smørgravsuitability.
656d95e11bfSDag-Erling SmørgravThis may be performed using the
657d95e11bfSDag-Erling Smørgrav.Fl T
658d95e11bfSDag-Erling Smørgravoption.
659d95e11bfSDag-Erling SmørgravIn this mode
660d95e11bfSDag-Erling Smørgrav.Nm
661d95e11bfSDag-Erling Smørgravwill read candidates from standard input (or a file specified using the
662d95e11bfSDag-Erling Smørgrav.Fl f
663d95e11bfSDag-Erling Smørgravoption).
664d95e11bfSDag-Erling SmørgravFor example:
665d95e11bfSDag-Erling Smørgrav.Pp
6665e8dbd04SDag-Erling Smørgrav.Dl # ssh-keygen -T moduli-2048 -f moduli-2048.candidates
667d95e11bfSDag-Erling Smørgrav.Pp
668d95e11bfSDag-Erling SmørgravBy default, each candidate will be subjected to 100 primality tests.
669d95e11bfSDag-Erling SmørgravThis may be overridden using the
670d95e11bfSDag-Erling Smørgrav.Fl a
671d95e11bfSDag-Erling Smørgravoption.
672d95e11bfSDag-Erling SmørgravThe DH generator value will be chosen automatically for the
673d95e11bfSDag-Erling Smørgravprime under consideration.
674d95e11bfSDag-Erling SmørgravIf a specific generator is desired, it may be requested using the
675d95e11bfSDag-Erling Smørgrav.Fl W
676d95e11bfSDag-Erling Smørgravoption.
6775e8dbd04SDag-Erling SmørgravValid generator values are 2, 3, and 5.
678d95e11bfSDag-Erling Smørgrav.Pp
679d95e11bfSDag-Erling SmørgravScreened DH groups may be installed in
680d95e11bfSDag-Erling Smørgrav.Pa /etc/moduli .
681d95e11bfSDag-Erling SmørgravIt is important that this file contains moduli of a range of bit lengths and
682d95e11bfSDag-Erling Smørgravthat both ends of a connection share common moduli.
683b15c8340SDag-Erling Smørgrav.Sh CERTIFICATES
684b15c8340SDag-Erling Smørgrav.Nm
685b15c8340SDag-Erling Smørgravsupports signing of keys to produce certificates that may be used for
686b15c8340SDag-Erling Smørgravuser or host authentication.
687b15c8340SDag-Erling SmørgravCertificates consist of a public key, some identity information, zero or
688e2f6069cSDag-Erling Smørgravmore principal (user or host) names and a set of options that
689b15c8340SDag-Erling Smørgravare signed by a Certification Authority (CA) key.
690b15c8340SDag-Erling SmørgravClients or servers may then trust only the CA key and verify its signature
691b15c8340SDag-Erling Smørgravon a certificate rather than trusting many user/host keys.
692b15c8340SDag-Erling SmørgravNote that OpenSSH certificates are a different, and much simpler, format to
693b15c8340SDag-Erling Smørgravthe X.509 certificates used in
694b15c8340SDag-Erling Smørgrav.Xr ssl 8 .
695b15c8340SDag-Erling Smørgrav.Pp
696b15c8340SDag-Erling Smørgrav.Nm
697b15c8340SDag-Erling Smørgravsupports two types of certificates: user and host.
698b15c8340SDag-Erling SmørgravUser certificates authenticate users to servers, whereas host certificates
699b15c8340SDag-Erling Smørgravauthenticate server hosts to users.
700b15c8340SDag-Erling SmørgravTo generate a user certificate:
701b15c8340SDag-Erling Smørgrav.Pp
702b15c8340SDag-Erling Smørgrav.Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
703b15c8340SDag-Erling Smørgrav.Pp
704b15c8340SDag-Erling SmørgravThe resultant certificate will be placed in
7058ad9b54aSDag-Erling Smørgrav.Pa /path/to/user_key-cert.pub .
706b15c8340SDag-Erling SmørgravA host certificate requires the
707b15c8340SDag-Erling Smørgrav.Fl h
708b15c8340SDag-Erling Smørgravoption:
709b15c8340SDag-Erling Smørgrav.Pp
710b15c8340SDag-Erling Smørgrav.Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
711b15c8340SDag-Erling Smørgrav.Pp
712b15c8340SDag-Erling SmørgravThe host certificate will be output to
7138ad9b54aSDag-Erling Smørgrav.Pa /path/to/host_key-cert.pub .
714e2f6069cSDag-Erling Smørgrav.Pp
715e2f6069cSDag-Erling SmørgravIt is possible to sign using a CA key stored in a PKCS#11 token by
716e2f6069cSDag-Erling Smørgravproviding the token library using
717e2f6069cSDag-Erling Smørgrav.Fl D
718e2f6069cSDag-Erling Smørgravand identifying the CA key by providing its public half as an argument
719e2f6069cSDag-Erling Smørgravto
720e2f6069cSDag-Erling Smørgrav.Fl s :
721e2f6069cSDag-Erling Smørgrav.Pp
722fc1ba28aSDag-Erling Smørgrav.Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
723e2f6069cSDag-Erling Smørgrav.Pp
7244f52dfbbSDag-Erling SmørgravSimilarly, it is possible for the CA key to be hosted in a
7254f52dfbbSDag-Erling Smørgrav.Xr ssh-agent 1 .
7264f52dfbbSDag-Erling SmørgravThis is indicated by the
7274f52dfbbSDag-Erling Smørgrav.Fl U
7284f52dfbbSDag-Erling Smørgravflag and, again, the CA key must be identified by its public half.
7294f52dfbbSDag-Erling Smørgrav.Pp
7304f52dfbbSDag-Erling Smørgrav.Dl $ ssh-keygen -Us ca_key.pub -I key_id user_key.pub
7314f52dfbbSDag-Erling Smørgrav.Pp
732e2f6069cSDag-Erling SmørgravIn all cases,
733b15c8340SDag-Erling Smørgrav.Ar key_id
734b15c8340SDag-Erling Smørgravis a "key identifier" that is logged by the server when the certificate
735b15c8340SDag-Erling Smørgravis used for authentication.
736b15c8340SDag-Erling Smørgrav.Pp
737b15c8340SDag-Erling SmørgravCertificates may be limited to be valid for a set of principal (user/host)
738b15c8340SDag-Erling Smørgravnames.
739b15c8340SDag-Erling SmørgravBy default, generated certificates are valid for all users or hosts.
740b15c8340SDag-Erling SmørgravTo generate a certificate for a specified set of principals:
741b15c8340SDag-Erling Smørgrav.Pp
742b15c8340SDag-Erling Smørgrav.Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
743fc1ba28aSDag-Erling Smørgrav.Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain host_key.pub"
744b15c8340SDag-Erling Smørgrav.Pp
745b15c8340SDag-Erling SmørgravAdditional limitations on the validity and use of user certificates may
746e2f6069cSDag-Erling Smørgravbe specified through certificate options.
747e2f6069cSDag-Erling SmørgravA certificate option may disable features of the SSH session, may be
748b15c8340SDag-Erling Smørgravvalid only when presented from particular source addresses or may
749b15c8340SDag-Erling Smørgravforce the use of a specific command.
750e2f6069cSDag-Erling SmørgravFor a list of valid certificate options, see the documentation for the
751b15c8340SDag-Erling Smørgrav.Fl O
752b15c8340SDag-Erling Smørgravoption above.
753b15c8340SDag-Erling Smørgrav.Pp
754b15c8340SDag-Erling SmørgravFinally, certificates may be defined with a validity lifetime.
755b15c8340SDag-Erling SmørgravThe
756b15c8340SDag-Erling Smørgrav.Fl V
757b15c8340SDag-Erling Smørgravoption allows specification of certificate start and end times.
758b15c8340SDag-Erling SmørgravA certificate that is presented at a time outside this range will not be
759b15c8340SDag-Erling Smørgravconsidered valid.
7606888a9beSDag-Erling SmørgravBy default, certificates are valid from
7616888a9beSDag-Erling Smørgrav.Ux
7626888a9beSDag-Erling SmørgravEpoch to the distant future.
763b15c8340SDag-Erling Smørgrav.Pp
764b15c8340SDag-Erling SmørgravFor certificates to be used for user or host authentication, the CA
765b15c8340SDag-Erling Smørgravpublic key must be trusted by
766b15c8340SDag-Erling Smørgrav.Xr sshd 8
767b15c8340SDag-Erling Smørgravor
768b15c8340SDag-Erling Smørgrav.Xr ssh 1 .
769b15c8340SDag-Erling SmørgravPlease refer to those manual pages for details.
7706888a9beSDag-Erling Smørgrav.Sh KEY REVOCATION LISTS
7716888a9beSDag-Erling Smørgrav.Nm
7726888a9beSDag-Erling Smørgravis able to manage OpenSSH format Key Revocation Lists (KRLs).
7736888a9beSDag-Erling SmørgravThese binary files specify keys or certificates to be revoked using a
774f7167e0eSDag-Erling Smørgravcompact format, taking as little as one bit per certificate if they are being
7756888a9beSDag-Erling Smørgravrevoked by serial number.
7766888a9beSDag-Erling Smørgrav.Pp
7776888a9beSDag-Erling SmørgravKRLs may be generated using the
7786888a9beSDag-Erling Smørgrav.Fl k
7796888a9beSDag-Erling Smørgravflag.
7806888a9beSDag-Erling SmørgravThis option reads one or more files from the command line and generates a new
7816888a9beSDag-Erling SmørgravKRL.
7826888a9beSDag-Erling SmørgravThe files may either contain a KRL specification (see below) or public keys,
7836888a9beSDag-Erling Smørgravlisted one per line.
7846888a9beSDag-Erling SmørgravPlain public keys are revoked by listing their hash or contents in the KRL and
7856888a9beSDag-Erling Smørgravcertificates revoked by serial number or key ID (if the serial is zero or
7866888a9beSDag-Erling Smørgravnot available).
7876888a9beSDag-Erling Smørgrav.Pp
7886888a9beSDag-Erling SmørgravRevoking keys using a KRL specification offers explicit control over the
7896888a9beSDag-Erling Smørgravtypes of record used to revoke keys and may be used to directly revoke
7906888a9beSDag-Erling Smørgravcertificates by serial number or key ID without having the complete original
7916888a9beSDag-Erling Smørgravcertificate on hand.
7926888a9beSDag-Erling SmørgravA KRL specification consists of lines containing one of the following directives
7936888a9beSDag-Erling Smørgravfollowed by a colon and some directive-specific information.
7946888a9beSDag-Erling Smørgrav.Bl -tag -width Ds
7956888a9beSDag-Erling Smørgrav.It Cm serial : Ar serial_number Ns Op - Ns Ar serial_number
7966888a9beSDag-Erling SmørgravRevokes a certificate with the specified serial number.
7976888a9beSDag-Erling SmørgravSerial numbers are 64-bit values, not including zero and may be expressed
7986888a9beSDag-Erling Smørgravin decimal, hex or octal.
7996888a9beSDag-Erling SmørgravIf two serial numbers are specified separated by a hyphen, then the range
8006888a9beSDag-Erling Smørgravof serial numbers including and between each is revoked.
8016888a9beSDag-Erling SmørgravThe CA key must have been specified on the
8026888a9beSDag-Erling Smørgrav.Nm
8036888a9beSDag-Erling Smørgravcommand line using the
8046888a9beSDag-Erling Smørgrav.Fl s
8056888a9beSDag-Erling Smørgravoption.
8066888a9beSDag-Erling Smørgrav.It Cm id : Ar key_id
8076888a9beSDag-Erling SmørgravRevokes a certificate with the specified key ID string.
8086888a9beSDag-Erling SmørgravThe CA key must have been specified on the
8096888a9beSDag-Erling Smørgrav.Nm
8106888a9beSDag-Erling Smørgravcommand line using the
8116888a9beSDag-Erling Smørgrav.Fl s
8126888a9beSDag-Erling Smørgravoption.
8136888a9beSDag-Erling Smørgrav.It Cm key : Ar public_key
8146888a9beSDag-Erling SmørgravRevokes the specified key.
8156888a9beSDag-Erling SmørgravIf a certificate is listed, then it is revoked as a plain public key.
8166888a9beSDag-Erling Smørgrav.It Cm sha1 : Ar public_key
817*2f513db7SEd MasteRevokes the specified key by including its SHA1 hash in the KRL.
818*2f513db7SEd Maste.It Cm sha256 : Ar public_key
819*2f513db7SEd MasteRevokes the specified key by including its SHA256 hash in the KRL.
820*2f513db7SEd MasteKRLs that revoke keys by SHA256 hash are not supported by OpenSSH versions
821*2f513db7SEd Masteprior to 7.9.
822*2f513db7SEd Maste.It Cm hash : Ar fingerprint
823*2f513db7SEd MasteRevokes a key using a fingerprint hash, as obtained from a
824*2f513db7SEd Maste.Xr sshd 8
825*2f513db7SEd Masteauthentication log message or the
826*2f513db7SEd Maste.Nm
827*2f513db7SEd Maste.Fl l
828*2f513db7SEd Masteflag.
829*2f513db7SEd MasteOnly SHA256 fingerprints are supported here and resultant KRLs are
830*2f513db7SEd Mastenot supported by OpenSSH versions prior to 7.9.
8316888a9beSDag-Erling Smørgrav.El
8326888a9beSDag-Erling Smørgrav.Pp
8336888a9beSDag-Erling SmørgravKRLs may be updated using the
8346888a9beSDag-Erling Smørgrav.Fl u
8356888a9beSDag-Erling Smørgravflag in addition to
8366888a9beSDag-Erling Smørgrav.Fl k .
8376888a9beSDag-Erling SmørgravWhen this option is specified, keys listed via the command line are merged into
8386888a9beSDag-Erling Smørgravthe KRL, adding to those already there.
8396888a9beSDag-Erling Smørgrav.Pp
8406888a9beSDag-Erling SmørgravIt is also possible, given a KRL, to test whether it revokes a particular key
8416888a9beSDag-Erling Smørgrav(or keys).
8426888a9beSDag-Erling SmørgravThe
8436888a9beSDag-Erling Smørgrav.Fl Q
8446888a9beSDag-Erling Smørgravflag will query an existing KRL, testing each key specified on the command line.
8456888a9beSDag-Erling SmørgravIf any key listed on the command line has been revoked (or an error encountered)
8466888a9beSDag-Erling Smørgravthen
8476888a9beSDag-Erling Smørgrav.Nm
8486888a9beSDag-Erling Smørgravwill exit with a non-zero exit status.
8496888a9beSDag-Erling SmørgravA zero exit status will only be returned if no key was revoked.
850511b41d2SMark Murray.Sh FILES
8514a421b63SDag-Erling Smørgrav.Bl -tag -width Ds -compact
852043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/id_dsa
8534a421b63SDag-Erling Smørgrav.It Pa ~/.ssh/id_ecdsa
854f7167e0eSDag-Erling Smørgrav.It Pa ~/.ssh/id_ed25519
855043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/id_rsa
8564f52dfbbSDag-Erling SmørgravContains the DSA, ECDSA, Ed25519 or RSA
857f7167e0eSDag-Erling Smørgravauthentication identity of the user.
8581e8db6e2SBrian FeldmanThis file should not be readable by anyone but the user.
8591e8db6e2SBrian FeldmanIt is possible to
8601e8db6e2SBrian Feldmanspecify a passphrase when generating the key; that passphrase will be
861b15c8340SDag-Erling Smørgravused to encrypt the private part of this file using 128-bit AES.
8621e8db6e2SBrian FeldmanThis file is not automatically accessed by
8631e8db6e2SBrian Feldman.Nm
8641e8db6e2SBrian Feldmanbut it is offered as the default file for the private key.
865ae1f160dSDag-Erling Smørgrav.Xr ssh 1
8661e8db6e2SBrian Feldmanwill read this file when a login attempt is made.
8674a421b63SDag-Erling Smørgrav.Pp
8684a421b63SDag-Erling Smørgrav.It Pa ~/.ssh/id_dsa.pub
8694a421b63SDag-Erling Smørgrav.It Pa ~/.ssh/id_ecdsa.pub
870f7167e0eSDag-Erling Smørgrav.It Pa ~/.ssh/id_ed25519.pub
871043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/id_rsa.pub
8724f52dfbbSDag-Erling SmørgravContains the DSA, ECDSA, Ed25519 or RSA
873f7167e0eSDag-Erling Smørgravpublic key for authentication.
8741e8db6e2SBrian FeldmanThe contents of this file should be added to
875043840dfSDag-Erling Smørgrav.Pa ~/.ssh/authorized_keys
8761e8db6e2SBrian Feldmanon all machines
877ae1f160dSDag-Erling Smørgravwhere the user wishes to log in using public key authentication.
878a04a10f8SKris KennawayThere is no need to keep the contents of this file secret.
8794a421b63SDag-Erling Smørgrav.Pp
880d95e11bfSDag-Erling Smørgrav.It Pa /etc/moduli
881d95e11bfSDag-Erling SmørgravContains Diffie-Hellman groups used for DH-GEX.
882d95e11bfSDag-Erling SmørgravThe file format is described in
883d95e11bfSDag-Erling Smørgrav.Xr moduli 5 .
884b66f2d16SKris Kennaway.El
885511b41d2SMark Murray.Sh SEE ALSO
886511b41d2SMark Murray.Xr ssh 1 ,
887511b41d2SMark Murray.Xr ssh-add 1 ,
888511b41d2SMark Murray.Xr ssh-agent 1 ,
889d95e11bfSDag-Erling Smørgrav.Xr moduli 5 ,
8901e8db6e2SBrian Feldman.Xr sshd 8
8911e8db6e2SBrian Feldman.Rs
892d4af9e69SDag-Erling Smørgrav.%R RFC 4716
893d4af9e69SDag-Erling Smørgrav.%T "The Secure Shell (SSH) Public Key File Format"
894d4af9e69SDag-Erling Smørgrav.%D 2006
8951e8db6e2SBrian Feldman.Re
896d95e11bfSDag-Erling Smørgrav.Sh AUTHORS
897d95e11bfSDag-Erling SmørgravOpenSSH is a derivative of the original and free
898d95e11bfSDag-Erling Smørgravssh 1.2.12 release by Tatu Ylonen.
899d95e11bfSDag-Erling SmørgravAaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
900d95e11bfSDag-Erling SmørgravTheo de Raadt and Dug Song
901d95e11bfSDag-Erling Smørgravremoved many bugs, re-added newer features and
902d95e11bfSDag-Erling Smørgravcreated OpenSSH.
903d95e11bfSDag-Erling SmørgravMarkus Friedl contributed the support for SSH
904d95e11bfSDag-Erling Smørgravprotocol versions 1.5 and 2.0.
905