summaryrefslogtreecommitdiff
path: root/ssh-keygen.1
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keygen.1')
-rw-r--r--ssh-keygen.154
1 files changed, 40 insertions, 14 deletions
diff --git a/ssh-keygen.1 b/ssh-keygen.1
index bfa2eb5f3..124456577 100644
--- a/ssh-keygen.1
+++ b/ssh-keygen.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-keygen.1,v 1.150 2018/09/12 06:18:59 djm Exp $ 1.\" $OpenBSD: ssh-keygen.1,v 1.157 2019/03/05 16:17:12 naddy Exp $
2.\" 2.\"
3.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 3.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -35,7 +35,7 @@
35.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37.\" 37.\"
38.Dd $Mdocdate: September 12 2018 $ 38.Dd $Mdocdate: March 5 2019 $
39.Dt SSH-KEYGEN 1 39.Dt SSH-KEYGEN 1
40.Os 40.Os
41.Sh NAME 41.Sh NAME
@@ -50,11 +50,13 @@
50.Op Fl N Ar new_passphrase 50.Op Fl N Ar new_passphrase
51.Op Fl C Ar comment 51.Op Fl C Ar comment
52.Op Fl f Ar output_keyfile 52.Op Fl f Ar output_keyfile
53.Op Fl m Ar format
53.Nm ssh-keygen 54.Nm ssh-keygen
54.Fl p 55.Fl p
55.Op Fl P Ar old_passphrase 56.Op Fl P Ar old_passphrase
56.Op Fl N Ar new_passphrase 57.Op Fl N Ar new_passphrase
57.Op Fl f Ar keyfile 58.Op Fl f Ar keyfile
59.Op Fl m Ar format
58.Nm ssh-keygen 60.Nm ssh-keygen
59.Fl i 61.Fl i
60.Op Fl m Ar key_format 62.Op Fl m Ar key_format
@@ -205,16 +207,28 @@ There is no way to recover a lost passphrase.
205If the passphrase is lost or forgotten, a new key must be generated 207If the passphrase is lost or forgotten, a new key must be generated
206and the corresponding public key copied to other machines. 208and the corresponding public key copied to other machines.
207.Pp 209.Pp
208For keys stored in the newer OpenSSH format, 210.Nm
209there is also a comment field in the key file that is only for 211will by default write keys in an OpenSSH-specific format.
210convenience to the user to help identify the key. 212This format is preferred as it offers better protection for
211The comment can tell what the key is for, or whatever is useful. 213keys at rest as well as allowing storage of key comments within
214the private key file itself.
215The key comment may be useful to help identify the key.
212The comment is initialized to 216The comment is initialized to
213.Dq user@host 217.Dq user@host
214when the key is created, but can be changed using the 218when the key is created, but can be changed using the
215.Fl c 219.Fl c
216option. 220option.
217.Pp 221.Pp
222It is still possible for
223.Nm
224to write the previously-used PEM format private keys using the
225.Fl m
226flag.
227This may be used when generating new keys, and existing new-format
228keys may be converted using this option in conjunction with the
229.Fl p
230(change passphrase) flag.
231.Pp
218After a key is generated, instructions below detail where the keys 232After a key is generated, instructions below detail where the keys
219should be placed to be activated. 233should be placed to be activated.
220.Pp 234.Pp
@@ -265,7 +279,7 @@ Requests changing the comment in the private and public key files.
265The program will prompt for the file containing the private keys, for 279The program will prompt for the file containing the private keys, for
266the passphrase if the key has one, and for the new comment. 280the passphrase if the key has one, and for the new comment.
267.It Fl D Ar pkcs11 281.It Fl D Ar pkcs11
268Download the RSA public keys provided by the PKCS#11 shared library 282Download the public keys provided by the PKCS#11 shared library
269.Ar pkcs11 . 283.Ar pkcs11 .
270When used in combination with 284When used in combination with
271.Fl s , 285.Fl s ,
@@ -282,16 +296,17 @@ The default is
282.Dq sha256 . 296.Dq sha256 .
283.It Fl e 297.It Fl e
284This option will read a private or public OpenSSH key file and 298This option will read a private or public OpenSSH key file and
285print to stdout the key in one of the formats specified by the 299print to stdout a public key in one of the formats specified by the
286.Fl m 300.Fl m
287option. 301option.
288The default export format is 302The default export format is
289.Dq RFC4716 . 303.Dq RFC4716 .
290This option allows exporting OpenSSH keys for use by other programs, including 304This option allows exporting OpenSSH keys for use by other programs, including
291several commercial SSH implementations. 305several commercial SSH implementations.
292.It Fl F Ar hostname 306.It Fl F Ar hostname | [hostname]:port
293Search for the specified 307Search for the specified
294.Ar hostname 308.Ar hostname
309(with optional port number)
295in a 310in a
296.Pa known_hosts 311.Pa known_hosts
297file, listing any occurrences found. 312file, listing any occurrences found.
@@ -391,11 +406,15 @@ fingerprint.
391Specify the amount of memory to use (in megabytes) when generating 406Specify the amount of memory to use (in megabytes) when generating
392candidate moduli for DH-GEX. 407candidate moduli for DH-GEX.
393.It Fl m Ar key_format 408.It Fl m Ar key_format
394Specify a key format for the 409Specify a key format for key generation, the
395.Fl i 410.Fl i
396(import) or 411(import),
397.Fl e 412.Fl e
398(export) conversion options. 413(export) conversion options, and the
414.Fl p
415change passphrase operation.
416The latter may be used to convert between OpenSSH private key and PEM
417private key formats.
399The supported key formats are: 418The supported key formats are:
400.Dq RFC4716 419.Dq RFC4716
401(RFC 4716/SSH2 public or private key), 420(RFC 4716/SSH2 public or private key),
@@ -517,9 +536,10 @@ Test whether keys have been revoked in a KRL.
517.It Fl q 536.It Fl q
518Silence 537Silence
519.Nm ssh-keygen . 538.Nm ssh-keygen .
520.It Fl R Ar hostname 539.It Fl R Ar hostname | [hostname]:port
521Removes all keys belonging to 540Removes all keys belonging to the specified
522.Ar hostname 541.Ar hostname
542(with optional port number)
523from a 543from a
524.Pa known_hosts 544.Pa known_hosts
525file. 545file.
@@ -620,6 +640,12 @@ OpenSSH format file and print an OpenSSH public key to stdout.
620.It Fl z Ar serial_number 640.It Fl z Ar serial_number
621Specifies a serial number to be embedded in the certificate to distinguish 641Specifies a serial number to be embedded in the certificate to distinguish
622this certificate from others from the same CA. 642this certificate from others from the same CA.
643If the
644.Ar serial_number
645is prefixed with a
646.Sq +
647character, then the serial number will be incremented for each certificate
648signed on a single command-line.
623The default serial number is zero. 649The default serial number is zero.
624.Pp 650.Pp
625When generating a KRL, the 651When generating a KRL, the