summaryrefslogtreecommitdiff
path: root/ssh-keygen.1
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-10-04 11:23:58 +0100
committerColin Watson <cjwatson@debian.org>2017-10-04 11:23:58 +0100
commit62f54f20bf351468e0124f63cc2902ee40d9b0e9 (patch)
tree3e090f2711b94ca5029d3fa3e8047b1ed1448b1f /ssh-keygen.1
parent6fabaf6fd9b07cc8bc6a17c9c4a5b76849cfc874 (diff)
parent66bf74a92131b7effe49fb0eefe5225151869dc5 (diff)
Import openssh_7.6p1.orig.tar.gz
Diffstat (limited to 'ssh-keygen.1')
-rw-r--r--ssh-keygen.1120
1 files changed, 70 insertions, 50 deletions
diff --git a/ssh-keygen.1 b/ssh-keygen.1
index ce2213c78..5f1ec09b0 100644
--- a/ssh-keygen.1
+++ b/ssh-keygen.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-keygen.1,v 1.133 2016/06/16 06:10:45 jmc Exp $ 1.\" $OpenBSD: ssh-keygen.1,v 1.144 2017/07/08 18:32:54 jmc 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: June 16 2016 $ 38.Dd $Mdocdate: July 8 2017 $
39.Dt SSH-KEYGEN 1 39.Dt SSH-KEYGEN 1
40.Os 40.Os
41.Sh NAME 41.Sh NAME
@@ -46,7 +46,7 @@
46.Nm ssh-keygen 46.Nm ssh-keygen
47.Op Fl q 47.Op Fl q
48.Op Fl b Ar bits 48.Op Fl b Ar bits
49.Op Fl t Cm dsa | ecdsa | ed25519 | rsa | rsa1 49.Op Fl t Cm dsa | ecdsa | ed25519 | rsa
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
@@ -114,6 +114,8 @@
114.Fl s Ar ca_key 114.Fl s Ar ca_key
115.Fl I Ar certificate_identity 115.Fl I Ar certificate_identity
116.Op Fl h 116.Op Fl h
117.Op Fl U
118.Op Fl D Ar pkcs11_provider
117.Op Fl n Ar principals 119.Op Fl n Ar principals
118.Op Fl O Ar option 120.Op Fl O Ar option
119.Op Fl V Ar validity_interval 121.Op Fl V Ar validity_interval
@@ -124,6 +126,7 @@
124.Op Fl f Ar input_keyfile 126.Op Fl f Ar input_keyfile
125.Nm ssh-keygen 127.Nm ssh-keygen
126.Fl A 128.Fl A
129.Op Fl f Ar prefix_path
127.Nm ssh-keygen 130.Nm ssh-keygen
128.Fl k 131.Fl k
129.Fl f Ar krl_file 132.Fl f Ar krl_file
@@ -141,18 +144,14 @@
141generates, manages and converts authentication keys for 144generates, manages and converts authentication keys for
142.Xr ssh 1 . 145.Xr ssh 1 .
143.Nm 146.Nm
144can create keys for use by SSH protocol versions 1 and 2. 147can create keys for use by SSH protocol version 2.
145Protocol 1 should not be used
146and is only offered to support legacy devices.
147It suffers from a number of cryptographic weaknesses
148and doesn't support many of the advanced features available for protocol 2.
149.Pp 148.Pp
150The type of key to be generated is specified with the 149The type of key to be generated is specified with the
151.Fl t 150.Fl t
152option. 151option.
153If invoked without any arguments, 152If invoked without any arguments,
154.Nm 153.Nm
155will generate an RSA key for use in SSH protocol 2 connections. 154will generate an RSA key.
156.Pp 155.Pp
157.Nm 156.Nm
158is also used to generate groups for use in Diffie-Hellman group 157is also used to generate groups for use in Diffie-Hellman group
@@ -172,7 +171,6 @@ section for details.
172Normally each user wishing to use SSH 171Normally each user wishing to use SSH
173with public key authentication runs this once to create the authentication 172with public key authentication runs this once to create the authentication
174key in 173key in
175.Pa ~/.ssh/identity ,
176.Pa ~/.ssh/id_dsa , 174.Pa ~/.ssh/id_dsa ,
177.Pa ~/.ssh/id_ecdsa , 175.Pa ~/.ssh/id_ecdsa ,
178.Pa ~/.ssh/id_ed25519 176.Pa ~/.ssh/id_ed25519
@@ -207,7 +205,7 @@ There is no way to recover a lost passphrase.
207If the passphrase is lost or forgotten, a new key must be generated 205If the passphrase is lost or forgotten, a new key must be generated
208and the corresponding public key copied to other machines. 206and the corresponding public key copied to other machines.
209.Pp 207.Pp
210For RSA1 keys and keys stored in the newer OpenSSH format, 208For keys stored in the newer OpenSSH format,
211there is also a comment field in the key file that is only for 209there is also a comment field in the key file that is only for
212convenience to the user to help identify the key. 210convenience to the user to help identify the key.
213The comment can tell what the key is for, or whatever is useful. 211The comment can tell what the key is for, or whatever is useful.
@@ -223,24 +221,26 @@ should be placed to be activated.
223The options are as follows: 221The options are as follows:
224.Bl -tag -width Ds 222.Bl -tag -width Ds
225.It Fl A 223.It Fl A
226For each of the key types (rsa1, rsa, dsa, ecdsa and ed25519) 224For each of the key types (rsa, dsa, ecdsa and ed25519)
227for which host keys 225for which host keys
228do not exist, generate the host keys with the default key file path, 226do not exist, generate the host keys with the default key file path,
229an empty passphrase, default bits for the key type, and default comment. 227an empty passphrase, default bits for the key type, and default comment.
228If
229.Fl f
230has also been specified, its argument is used as a prefix to the
231default path for the resulting host key files.
230This is used by 232This is used by
231.Pa /etc/rc 233.Pa /etc/rc
232to generate new host keys. 234to generate new host keys.
233.It Fl a Ar rounds 235.It Fl a Ar rounds
234When saving a new-format private key (i.e. an ed25519 key or any SSH protocol 236When saving a new-format private key (i.e. an ed25519 key or when the
2352 key when the
236.Fl o 237.Fl o
237flag is set), this option specifies the number of KDF (key derivation function) 238flag is set), this option specifies the number of KDF (key derivation function)
238rounds used. 239rounds used.
239Higher numbers result in slower passphrase verification and increased 240Higher numbers result in slower passphrase verification and increased
240resistance to brute-force password cracking (should the keys be stolen). 241resistance to brute-force password cracking (should the keys be stolen).
241.Pp 242.Pp
242When screening DH-GEX candidates ( 243When screening DH-GEX candidates (using the
243using the
244.Fl T 244.Fl T
245command). 245command).
246This option specifies the number of primality tests to perform. 246This option specifies the number of primality tests to perform.
@@ -264,7 +264,7 @@ flag will be ignored.
264Provides a new comment. 264Provides a new comment.
265.It Fl c 265.It Fl c
266Requests changing the comment in the private and public key files. 266Requests changing the comment in the private and public key files.
267This operation is only supported for RSA1 keys and keys stored in the 267This operation is only supported for keys stored in the
268newer OpenSSH format. 268newer OpenSSH format.
269The program will prompt for the file containing the private keys, for 269The program will prompt for the file containing the private keys, for
270the passphrase if the key has one, and for the new comment. 270the passphrase if the key has one, and for the new comment.
@@ -384,7 +384,6 @@ section.
384Prints the contents of one or more certificates. 384Prints the contents of one or more certificates.
385.It Fl l 385.It Fl l
386Show fingerprint of specified public key file. 386Show fingerprint of specified public key file.
387Private RSA1 keys are also supported.
388For RSA and DSA keys 387For RSA and DSA keys
389.Nm 388.Nm
390tries to find the matching public key file and prints its fingerprint. 389tries to find the matching public key file and prints its fingerprint.
@@ -423,51 +422,81 @@ section for details.
423.It Fl O Ar option 422.It Fl O Ar option
424Specify a certificate option when signing a key. 423Specify a certificate option when signing a key.
425This option may be specified multiple times. 424This option may be specified multiple times.
426Please see the 425See also the
427.Sx CERTIFICATES 426.Sx CERTIFICATES
428section for details. 427section for further details.
429The options that are valid for user certificates are: 428The options that are valid for user certificates are:
430.Bl -tag -width Ds 429.Pp
430.Bl -tag -width Ds -compact
431.It Ic clear 431.It Ic clear
432Clear all enabled permissions. 432Clear all enabled permissions.
433This is useful for clearing the default set of permissions so permissions may 433This is useful for clearing the default set of permissions so permissions may
434be added individually. 434be added individually.
435.Pp
436.It Ic critical : Ns Ar name Ns Op Ns = Ns Ar contents
437.It Ic extension : Ns Ar name Ns Op Ns = Ns Ar contents
438Includes an arbitrary certificate critical option or extension.
439The specified
440.Ar name
441should include a domain suffix, e.g.\&
442.Dq name@example.com .
443If
444.Ar contents
445is specified then it is included as the contents of the extension/option
446encoded as a string, otherwise the extension/option is created with no
447contents (usually indicating a flag).
448Extensions may be ignored by a client or server that does not recognise them,
449whereas unknown critical options will cause the certificate to be refused.
450.Pp
451At present, no standard options are valid for host keys.
452.Pp
435.It Ic force-command Ns = Ns Ar command 453.It Ic force-command Ns = Ns Ar command
436Forces the execution of 454Forces the execution of
437.Ar command 455.Ar command
438instead of any shell or command specified by the user when 456instead of any shell or command specified by the user when
439the certificate is used for authentication. 457the certificate is used for authentication.
458.Pp
440.It Ic no-agent-forwarding 459.It Ic no-agent-forwarding
441Disable 460Disable
442.Xr ssh-agent 1 461.Xr ssh-agent 1
443forwarding (permitted by default). 462forwarding (permitted by default).
463.Pp
444.It Ic no-port-forwarding 464.It Ic no-port-forwarding
445Disable port forwarding (permitted by default). 465Disable port forwarding (permitted by default).
466.Pp
446.It Ic no-pty 467.It Ic no-pty
447Disable PTY allocation (permitted by default). 468Disable PTY allocation (permitted by default).
469.Pp
448.It Ic no-user-rc 470.It Ic no-user-rc
449Disable execution of 471Disable execution of
450.Pa ~/.ssh/rc 472.Pa ~/.ssh/rc
451by 473by
452.Xr sshd 8 474.Xr sshd 8
453(permitted by default). 475(permitted by default).
476.Pp
454.It Ic no-x11-forwarding 477.It Ic no-x11-forwarding
455Disable X11 forwarding (permitted by default). 478Disable X11 forwarding (permitted by default).
479.Pp
456.It Ic permit-agent-forwarding 480.It Ic permit-agent-forwarding
457Allows 481Allows
458.Xr ssh-agent 1 482.Xr ssh-agent 1
459forwarding. 483forwarding.
484.Pp
460.It Ic permit-port-forwarding 485.It Ic permit-port-forwarding
461Allows port forwarding. 486Allows port forwarding.
487.Pp
462.It Ic permit-pty 488.It Ic permit-pty
463Allows PTY allocation. 489Allows PTY allocation.
490.Pp
464.It Ic permit-user-rc 491.It Ic permit-user-rc
465Allows execution of 492Allows execution of
466.Pa ~/.ssh/rc 493.Pa ~/.ssh/rc
467by 494by
468.Xr sshd 8 . 495.Xr sshd 8 .
496.Pp
469.It Ic permit-x11-forwarding 497.It Ic permit-x11-forwarding
470Allows X11 forwarding. 498Allows X11 forwarding.
499.Pp
471.It Ic source-address Ns = Ns Ar address_list 500.It Ic source-address Ns = Ns Ar address_list
472Restrict the source addresses from which the certificate is considered valid. 501Restrict the source addresses from which the certificate is considered valid.
473The 502The
@@ -475,8 +504,6 @@ The
475is a comma-separated list of one or more address/netmask pairs in CIDR 504is a comma-separated list of one or more address/netmask pairs in CIDR
476format. 505format.
477.El 506.El
478.Pp
479At present, no options are valid for host keys.
480.It Fl o 507.It Fl o
481Causes 508Causes
482.Nm 509.Nm
@@ -530,17 +557,22 @@ section for details.
530Test DH group exchange candidate primes (generated using the 557Test DH group exchange candidate primes (generated using the
531.Fl G 558.Fl G
532option) for safety. 559option) for safety.
533.It Fl t Cm dsa | ecdsa | ed25519 | rsa | rsa1 560.It Fl t Cm dsa | ecdsa | ed25519 | rsa
534Specifies the type of key to create. 561Specifies the type of key to create.
535The possible values are 562The possible values are
536.Dq rsa1
537for protocol version 1 and
538.Dq dsa , 563.Dq dsa ,
539.Dq ecdsa , 564.Dq ecdsa ,
540.Dq ed25519 , 565.Dq ed25519 ,
541or 566or
542.Dq rsa 567.Dq rsa .
543for protocol version 2. 568.It Fl U
569When used in combination with
570.Fl s ,
571this option indicates that a CA key resides in a
572.Xr ssh-agent 1 .
573See the
574.Sx CERTIFICATES
575section for more information.
544.It Fl u 576.It Fl u
545Update a KRL. 577Update a KRL.
546When specified with 578When specified with
@@ -688,6 +720,14 @@ to
688.Pp 720.Pp
689.Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub 721.Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
690.Pp 722.Pp
723Similarly, it is possible for the CA key to be hosted in a
724.Xr ssh-agent 1 .
725This is indicated by the
726.Fl U
727flag and, again, the CA key must be identified by its public half.
728.Pp
729.Dl $ ssh-keygen -Us ca_key.pub -I key_id user_key.pub
730.Pp
691In all cases, 731In all cases,
692.Ar key_id 732.Ar key_id
693is a "key identifier" that is logged by the server when the certificate 733is a "key identifier" that is logged by the server when the certificate
@@ -795,31 +835,11 @@ will exit with a non-zero exit status.
795A zero exit status will only be returned if no key was revoked. 835A zero exit status will only be returned if no key was revoked.
796.Sh FILES 836.Sh FILES
797.Bl -tag -width Ds -compact 837.Bl -tag -width Ds -compact
798.It Pa ~/.ssh/identity
799Contains the protocol version 1 RSA authentication identity of the user.
800This file should not be readable by anyone but the user.
801It is possible to
802specify a passphrase when generating the key; that passphrase will be
803used to encrypt the private part of this file using 3DES.
804This file is not automatically accessed by
805.Nm
806but it is offered as the default file for the private key.
807.Xr ssh 1
808will read this file when a login attempt is made.
809.Pp
810.It Pa ~/.ssh/identity.pub
811Contains the protocol version 1 RSA public key for authentication.
812The contents of this file should be added to
813.Pa ~/.ssh/authorized_keys
814on all machines
815where the user wishes to log in using RSA authentication.
816There is no need to keep the contents of this file secret.
817.Pp
818.It Pa ~/.ssh/id_dsa 838.It Pa ~/.ssh/id_dsa
819.It Pa ~/.ssh/id_ecdsa 839.It Pa ~/.ssh/id_ecdsa
820.It Pa ~/.ssh/id_ed25519 840.It Pa ~/.ssh/id_ed25519
821.It Pa ~/.ssh/id_rsa 841.It Pa ~/.ssh/id_rsa
822Contains the protocol version 2 DSA, ECDSA, Ed25519 or RSA 842Contains the DSA, ECDSA, Ed25519 or RSA
823authentication identity of the user. 843authentication identity of the user.
824This file should not be readable by anyone but the user. 844This file should not be readable by anyone but the user.
825It is possible to 845It is possible to
@@ -835,7 +855,7 @@ will read this file when a login attempt is made.
835.It Pa ~/.ssh/id_ecdsa.pub 855.It Pa ~/.ssh/id_ecdsa.pub
836.It Pa ~/.ssh/id_ed25519.pub 856.It Pa ~/.ssh/id_ed25519.pub
837.It Pa ~/.ssh/id_rsa.pub 857.It Pa ~/.ssh/id_rsa.pub
838Contains the protocol version 2 DSA, ECDSA, Ed25519 or RSA 858Contains the DSA, ECDSA, Ed25519 or RSA
839public key for authentication. 859public key for authentication.
840The contents of this file should be added to 860The contents of this file should be added to
841.Pa ~/.ssh/authorized_keys 861.Pa ~/.ssh/authorized_keys