summaryrefslogtreecommitdiff
path: root/ssh-keygen.1
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-03-31 10:46:28 +0100
committerColin Watson <cjwatson@debian.org>2010-03-31 10:46:28 +0100
commitefd3d4522636ae029488c2e9730b60c88e257d2e (patch)
tree31e02ac3f16090ce8c53448677356b2b7f423683 /ssh-keygen.1
parentbbec4db36d464ea1d464a707625125f9fd5c7b5e (diff)
parentd1a87e462e1db89f19cd960588d0c6b287cb5ccc (diff)
* New upstream release (LP: #535029).
- After a transition period of about 10 years, this release disables SSH protocol 1 by default. Clients and servers that need to use the legacy protocol must explicitly enable it in ssh_config / sshd_config or on the command-line. - Remove the libsectok/OpenSC-based smartcard code and add support for PKCS#11 tokens. This support is enabled by default in the Debian packaging, since it now doesn't involve additional library dependencies (closes: #231472, LP: #16918). - Add support for certificate authentication of users and hosts using a new, minimal OpenSSH certificate format (closes: #482806). - Added a 'netcat mode' to ssh(1): "ssh -W host:port ...". - Add the ability to revoke keys in sshd(8) and ssh(1). (For the Debian package, this overlaps with the key blacklisting facility added in openssh 1:4.7p1-9, but with different file formats and slightly different scopes; for the moment, I've roughly merged the two.) - Various multiplexing improvements, including support for requesting port-forwardings via the multiplex protocol (closes: #360151). - Allow setting an explicit umask on the sftp-server(8) commandline to override whatever default the user has (closes: #496843). - Many sftp client improvements, including tab-completion, more options, and recursive transfer support for get/put (LP: #33378). The old mget/mput commands never worked properly and have been removed (closes: #270399, #428082). - Do not prompt for a passphrase if we fail to open a keyfile, and log the reason why the open failed to debug (closes: #431538). - Prevent sftp from crashing when given a "-" without a command. Also, allow whitespace to follow a "-" (closes: #531561).
Diffstat (limited to 'ssh-keygen.1')
-rw-r--r--ssh-keygen.1210
1 files changed, 194 insertions, 16 deletions
diff --git a/ssh-keygen.1 b/ssh-keygen.1
index c87d8031a..9dec5a098 100644
--- a/ssh-keygen.1
+++ b/ssh-keygen.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-keygen.1,v 1.79 2008/07/24 23:55:30 sthen Exp $ 1.\" $OpenBSD: ssh-keygen.1,v 1.88 2010/03/08 00:28:55 djm Exp $
2.\" 2.\"
3.\" -*- nroff -*- 3.\" -*- nroff -*-
4.\" 4.\"
@@ -37,7 +37,7 @@
37.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 37.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
38.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39.\" 39.\"
40.Dd $Mdocdate: July 24 2008 $ 40.Dd $Mdocdate: March 8 2010 $
41.Dt SSH-KEYGEN 1 41.Dt SSH-KEYGEN 1
42.Os 42.Os
43.Sh NAME 43.Sh NAME
@@ -52,7 +52,6 @@
52.Op Fl N Ar new_passphrase 52.Op Fl N Ar new_passphrase
53.Op Fl C Ar comment 53.Op Fl C Ar comment
54.Op Fl f Ar output_keyfile 54.Op Fl f Ar output_keyfile
55.Ek
56.Nm ssh-keygen 55.Nm ssh-keygen
57.Fl p 56.Fl p
58.Op Fl P Ar old_passphrase 57.Op Fl P Ar old_passphrase
@@ -79,7 +78,7 @@
79.Fl B 78.Fl B
80.Op Fl f Ar input_keyfile 79.Op Fl f Ar input_keyfile
81.Nm ssh-keygen 80.Nm ssh-keygen
82.Fl D Ar reader 81.Fl D Ar pkcs11
83.Nm ssh-keygen 82.Nm ssh-keygen
84.Fl F Ar hostname 83.Fl F Ar hostname
85.Op Fl f Ar known_hosts_file 84.Op Fl f Ar known_hosts_file
@@ -91,9 +90,6 @@
91.Fl R Ar hostname 90.Fl R Ar hostname
92.Op Fl f Ar known_hosts_file 91.Op Fl f Ar known_hosts_file
93.Nm ssh-keygen 92.Nm ssh-keygen
94.Fl U Ar reader
95.Op Fl f Ar input_keyfile
96.Nm ssh-keygen
97.Fl r Ar hostname 93.Fl r Ar hostname
98.Op Fl f Ar input_keyfile 94.Op Fl f Ar input_keyfile
99.Op Fl g 95.Op Fl g
@@ -109,6 +105,18 @@
109.Op Fl v 105.Op Fl v
110.Op Fl a Ar num_trials 106.Op Fl a Ar num_trials
111.Op Fl W Ar generator 107.Op Fl W Ar generator
108.Nm ssh-keygen
109.Fl s Ar ca_key
110.Fl I Ar certificate_identity
111.Op Fl h
112.Op Fl n Ar principals
113.Op Fl O Ar constraint
114.Op Fl V Ar validity_interval
115.Ar
116.Nm ssh-keygen
117.Fl L
118.Op Fl f Ar input_keyfile
119.Ek
112.Sh DESCRIPTION 120.Sh DESCRIPTION
113.Nm 121.Nm
114generates, manages and converts authentication keys for 122generates, manages and converts authentication keys for
@@ -199,9 +207,9 @@ Requests changing the comment in the private and public key files.
199This operation is only supported for RSA1 keys. 207This operation is only supported for RSA1 keys.
200The program will prompt for the file containing the private keys, for 208The program will prompt for the file containing the private keys, for
201the passphrase if the key has one, and for the new comment. 209the passphrase if the key has one, and for the new comment.
202.It Fl D Ar reader 210.It Fl D Ar pkcs11
203Download the RSA public key stored in the smartcard in 211Download the RSA public keys provided by the PKCS#11 shared library
204.Ar reader . 212.Ar pkcs11 .
205.It Fl e 213.It Fl e
206This option will read a private or public OpenSSH key file and 214This option will read a private or public OpenSSH key file and
207print the key in 215print the key in
@@ -246,6 +254,17 @@ but they do not reveal identifying information should the file's contents
246be disclosed. 254be disclosed.
247This option will not modify existing hashed hostnames and is therefore safe 255This option will not modify existing hashed hostnames and is therefore safe
248to use on files that mix hashed and non-hashed names. 256to use on files that mix hashed and non-hashed names.
257.It Fl h
258When signing a key, create a host certificate instead of a user
259certificate.
260Please see the
261.Sx CERTIFICATES
262section for details.
263.It Fl I Ar certificate_identity
264Specify the key identity when signing a public key.
265Please see the
266.Sx CERTIFICATES
267section for details.
249.It Fl i 268.It Fl i
250This option will read an unencrypted private (or public) key file 269This option will read an unencrypted private (or public) key file
251in SSH2-compatible format and print an OpenSSH compatible private 270in SSH2-compatible format and print an OpenSSH compatible private
@@ -255,6 +274,8 @@ also reads the
255RFC 4716 SSH Public Key File Format. 274RFC 4716 SSH Public Key File Format.
256This option allows importing keys from several commercial 275This option allows importing keys from several commercial
257SSH implementations. 276SSH implementations.
277.It Fl L
278Prints the contents of a certificate.
258.It Fl l 279.It Fl l
259Show fingerprint of specified public key file. 280Show fingerprint of specified public key file.
260Private RSA1 keys are also supported. 281Private RSA1 keys are also supported.
@@ -269,6 +290,71 @@ Specify the amount of memory to use (in megabytes) when generating
269candidate moduli for DH-GEX. 290candidate moduli for DH-GEX.
270.It Fl N Ar new_passphrase 291.It Fl N Ar new_passphrase
271Provides the new passphrase. 292Provides the new passphrase.
293.It Fl n Ar principals
294Specify one or more principals (user or host names) to be included in
295a certificate when signing a key.
296Multiple principals may be specified, separated by commas.
297Please see the
298.Sx CERTIFICATES
299section for details.
300.It Fl O Ar constraint
301Specify a certificate constraint when signing a key.
302This option may be specified multiple times.
303Please see the
304.Sx CERTIFICATES
305section for details.
306The constraints that are valid for user certificates are:
307.Bl -tag -width Ds
308.It Ic no-x11-forwarding
309Disable X11 forwarding (permitted by default).
310.It Ic no-agent-forwarding
311Disable
312.Xr ssh-agent 1
313forwarding (permitted by default).
314.It Ic no-port-forwarding
315Disable port forwarding (permitted by default).
316.It Ic no-pty
317Disable PTY allocation (permitted by default).
318.It Ic no-user-rc
319Disable execution of
320.Pa ~/.ssh/rc
321by
322.Xr sshd 8
323(permitted by default).
324.It Ic clear
325Clear all enabled permissions.
326This is useful for clearing the default set of permissions so permissions may
327be added individually.
328.It Ic permit-x11-forwarding
329Allows X11 forwarding.
330.It Ic permit-agent-forwarding
331Allows
332.Xr ssh-agent 1
333forwarding.
334.It Ic permit-port-forwarding
335Allows port forwarding.
336.It Ic permit-pty
337Allows PTY allocation.
338.It Ic permit-user-rc
339Allows execution of
340.Pa ~/.ssh/rc
341by
342.Xr sshd 8 .
343.It Ic force-command=command
344Forces the execution of
345.Ar command
346instead of any shell or command specified by the user when
347the certificate is used for authentication.
348.It Ic source-address=address_list
349Restrict the source addresses from which the certificate is considered valid
350from.
351The
352.Ar address_list
353is a comma-separated list of one or more address/netmask pairs in CIDR
354format.
355.El
356.Pp
357At present, no constraints are valid for host keys.
272.It Fl P Ar passphrase 358.It Fl P Ar passphrase
273Provides the (old) passphrase. 359Provides the (old) passphrase.
274.It Fl p 360.It Fl p
@@ -296,6 +382,11 @@ Print the SSHFP fingerprint resource record named
296for the specified public key file. 382for the specified public key file.
297.It Fl S Ar start 383.It Fl S Ar start
298Specify start point (in hex) when generating candidate moduli for DH-GEX. 384Specify start point (in hex) when generating candidate moduli for DH-GEX.
385.It Fl s Ar ca_key
386Certify (sign) a public key using the specified CA key.
387Please see the
388.Sx CERTIFICATES
389section for details.
299.It Fl T Ar output_file 390.It Fl T Ar output_file
300Test DH group exchange candidate primes (generated using the 391Test DH group exchange candidate primes (generated using the
301.Fl G 392.Fl G
@@ -309,9 +400,29 @@ for protocol version 1 and
309or 400or
310.Dq dsa 401.Dq dsa
311for protocol version 2. 402for protocol version 2.
312.It Fl U Ar reader 403.It Fl V Ar validity_interval
313Upload an existing RSA private key into the smartcard in 404Specify a validity interval when signing a certificate.
314.Ar reader . 405A validity interval may consist of a single time, indicating that the
406certificate is valid beginning now and expiring at that time, or may consist
407of two times separated by a colon to indicate an explicit time interval.
408The start time may be specified as a date in YYYYMMDD format, a time
409in YYYYMMDDHHMMSS format or a relative time (to the current time) consisting
410of a minus sign followed by a relative time in the format described in the
411.Sx TIME FORMATS
412section of
413.Xr ssh_config 5 .
414The end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMMSS time or
415a relative time starting with a plus character.
416.Pp
417For example:
418.Dq +52w1d
419(valid from now to 52 weeks and one day from now),
420.Dq -4w:+4w
421(valid from four weeks ago to four weeks from now),
422.Dq 20100101123000:20110101123000
423(valid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011),
424.Dq -1d:20110101
425(valid from yesterday to midnight, January 1st, 2011).
315.It Fl v 426.It Fl v
316Verbose mode. 427Verbose mode.
317Causes 428Causes
@@ -382,6 +493,73 @@ Screened DH groups may be installed in
382.Pa /etc/moduli . 493.Pa /etc/moduli .
383It is important that this file contains moduli of a range of bit lengths and 494It is important that this file contains moduli of a range of bit lengths and
384that both ends of a connection share common moduli. 495that both ends of a connection share common moduli.
496.Sh CERTIFICATES
497.Nm
498supports signing of keys to produce certificates that may be used for
499user or host authentication.
500Certificates consist of a public key, some identity information, zero or
501more principal (user or host) names and an optional set of constraints that
502are signed by a Certification Authority (CA) key.
503Clients or servers may then trust only the CA key and verify its signature
504on a certificate rather than trusting many user/host keys.
505Note that OpenSSH certificates are a different, and much simpler, format to
506the X.509 certificates used in
507.Xr ssl 8 .
508.Pp
509.Nm
510supports two types of certificates: user and host.
511User certificates authenticate users to servers, whereas host certificates
512authenticate server hosts to users.
513To generate a user certificate:
514.Pp
515.Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
516.Pp
517The resultant certificate will be placed in
518.Pa /path/to/user_key_cert.pub .
519A host certificate requires the
520.Fl h
521option:
522.Pp
523.Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
524.Pp
525The host certificate will be output to
526.Pa /path/to/host_key_cert.pub .
527In both cases,
528.Ar key_id
529is a "key identifier" that is logged by the server when the certificate
530is used for authentication.
531.Pp
532Certificates may be limited to be valid for a set of principal (user/host)
533names.
534By default, generated certificates are valid for all users or hosts.
535To generate a certificate for a specified set of principals:
536.Pp
537.Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
538.Dl $ ssh-keygen -s ca_key -I key_id -h -n host.domain user_key.pub
539.Pp
540Additional limitations on the validity and use of user certificates may
541be specified through certificate constraints.
542A constrained certificate may disable features of the SSH session, may be
543valid only when presented from particular source addresses or may
544force the use of a specific command.
545For a list of valid certificate constraints, see the documentation for the
546.Fl O
547option above.
548.Pp
549Finally, certificates may be defined with a validity lifetime.
550The
551.Fl V
552option allows specification of certificate start and end times.
553A certificate that is presented at a time outside this range will not be
554considered valid.
555By default, certificates have a maximum validity interval.
556.Pp
557For certificates to be used for user or host authentication, the CA
558public key must be trusted by
559.Xr sshd 8
560or
561.Xr ssh 1 .
562Please refer to those manual pages for details.
385.Sh FILES 563.Sh FILES
386.Bl -tag -width Ds 564.Bl -tag -width Ds
387.It Pa ~/.ssh/identity 565.It Pa ~/.ssh/identity
@@ -389,7 +567,7 @@ Contains the protocol version 1 RSA authentication identity of the user.
389This file should not be readable by anyone but the user. 567This file should not be readable by anyone but the user.
390It is possible to 568It is possible to
391specify a passphrase when generating the key; that passphrase will be 569specify a passphrase when generating the key; that passphrase will be
392used to encrypt the private part of this file using 3DES. 570used to encrypt the private part of this file using 128-bit AES.
393This file is not automatically accessed by 571This file is not automatically accessed by
394.Nm 572.Nm
395but it is offered as the default file for the private key. 573but it is offered as the default file for the private key.
@@ -407,7 +585,7 @@ Contains the protocol version 2 DSA authentication identity of the user.
407This file should not be readable by anyone but the user. 585This file should not be readable by anyone but the user.
408It is possible to 586It is possible to
409specify a passphrase when generating the key; that passphrase will be 587specify a passphrase when generating the key; that passphrase will be
410used to encrypt the private part of this file using 3DES. 588used to encrypt the private part of this file using 128-bit AES.
411This file is not automatically accessed by 589This file is not automatically accessed by
412.Nm 590.Nm
413but it is offered as the default file for the private key. 591but it is offered as the default file for the private key.
@@ -425,7 +603,7 @@ Contains the protocol version 2 RSA authentication identity of the user.
425This file should not be readable by anyone but the user. 603This file should not be readable by anyone but the user.
426It is possible to 604It is possible to
427specify a passphrase when generating the key; that passphrase will be 605specify a passphrase when generating the key; that passphrase will be
428used to encrypt the private part of this file using 3DES. 606used to encrypt the private part of this file using 128-bit AES.
429This file is not automatically accessed by 607This file is not automatically accessed by
430.Nm 608.Nm
431but it is offered as the default file for the private key. 609but it is offered as the default file for the private key.