xref: /netbsd-src/crypto/external/bsd/openssh/dist/ssh-keygen.1 (revision 6a493d6bc668897c91594964a732d38505b70cbb)
1.\"	$NetBSD: ssh-keygen.1,v 1.11 2013/11/08 19:18:25 christos Exp $
2.\"	$OpenBSD: ssh-keygen.1,v 1.116 2013/06/27 14:05:37 jmc Exp $
3.\"
4.\"  -*- nroff -*-
5.\"
6.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
7.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8.\"                    All rights reserved
9.\"
10.\" As far as I am concerned, the code I have written for this software
11.\" can be used freely for any purpose.  Any derived versions of this
12.\" software must be clearly marked as such, and if the derived work is
13.\" incompatible with the protocol description in the RFC file, it must be
14.\" called by a name other than "ssh" or "Secure Shell".
15.\"
16.\"
17.\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
18.\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
19.\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
20.\"
21.\" Redistribution and use in source and binary forms, with or without
22.\" modification, are permitted provided that the following conditions
23.\" are met:
24.\" 1. Redistributions of source code must retain the above copyright
25.\"    notice, this list of conditions and the following disclaimer.
26.\" 2. Redistributions in binary form must reproduce the above copyright
27.\"    notice, this list of conditions and the following disclaimer in the
28.\"    documentation and/or other materials provided with the distribution.
29.\"
30.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
31.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
34.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
35.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40.\"
41.Dd June 27 2013
42.Dt SSH-KEYGEN 1
43.Os
44.Sh NAME
45.Nm ssh-keygen
46.Nd authentication key generation, management and conversion
47.Sh SYNOPSIS
48.Bk -words
49.Nm ssh-keygen
50.Op Fl q
51.Op Fl b Ar bits
52.Fl t Ar type
53.Op Fl N Ar new_passphrase
54.Op Fl C Ar comment
55.Op Fl f Ar output_keyfile
56.Nm ssh-keygen
57.Fl p
58.Op Fl P Ar old_passphrase
59.Op Fl N Ar new_passphrase
60.Op Fl f Ar keyfile
61.Nm ssh-keygen
62.Fl i
63.Op Fl m Ar key_format
64.Op Fl f Ar input_keyfile
65.Nm ssh-keygen
66.Fl e
67.Op Fl m Ar key_format
68.Op Fl f Ar input_keyfile
69.Nm ssh-keygen
70.Fl y
71.Op Fl f Ar input_keyfile
72.Nm ssh-keygen
73.Fl c
74.Op Fl P Ar passphrase
75.Op Fl C Ar comment
76.Op Fl f Ar keyfile
77.Nm ssh-keygen
78.Fl l
79.Op Fl f Ar input_keyfile
80.Nm ssh-keygen
81.Fl B
82.Op Fl f Ar input_keyfile
83.Nm ssh-keygen
84.Fl D Ar pkcs11
85.Nm ssh-keygen
86.Fl F Ar hostname
87.Op Fl f Ar known_hosts_file
88.Op Fl l
89.Nm ssh-keygen
90.Fl H
91.Op Fl f Ar known_hosts_file
92.Nm ssh-keygen
93.Fl R Ar hostname
94.Op Fl f Ar known_hosts_file
95.Nm ssh-keygen
96.Fl r Ar hostname
97.Op Fl f Ar input_keyfile
98.Op Fl g
99.Nm ssh-keygen
100.Fl G Ar output_file
101.Op Fl v
102.Op Fl b Ar bits
103.Op Fl M Ar memory
104.Op Fl S Ar start_point
105.Nm ssh-keygen
106.Fl T Ar output_file
107.Fl f Ar input_file
108.Op Fl v
109.Op Fl a Ar num_trials
110.Op Fl J Ar num_lines
111.Op Fl j Ar start_line
112.Op Fl K Ar checkpt
113.Op Fl W Ar generator
114.Nm ssh-keygen
115.Fl s Ar ca_key
116.Fl I Ar certificate_identity
117.Op Fl h
118.Op Fl n Ar principals
119.Op Fl O Ar option
120.Op Fl V Ar validity_interval
121.Op Fl z Ar serial_number
122.Ar
123.Nm ssh-keygen
124.Fl L
125.Op Fl f Ar input_keyfile
126.Nm ssh-keygen
127.Fl A
128.Nm ssh-keygen
129.Fl k
130.Fl f Ar krl_file
131.Op Fl u
132.Op Fl s Ar ca_public
133.Op Fl z Ar version_number
134.Ar
135.Nm ssh-keygen
136.Fl Q
137.Fl f Ar krl_file
138.Ar
139.Ek
140.Sh DESCRIPTION
141.Nm
142generates, manages and converts authentication keys for
143.Xr ssh 1 .
144.Nm
145can create RSA keys for use by SSH protocol version 1 and DSA, ECDSA or RSA
146keys for use by SSH protocol version 2.
147The type of key to be generated is specified with the
148.Fl t
149option.
150If invoked without any arguments,
151.Nm
152will generate an RSA key for use in SSH protocol 2 connections.
153.Pp
154.Nm
155is also used to generate groups for use in Diffie-Hellman group
156exchange (DH-GEX).
157See the
158.Sx MODULI GENERATION
159section for details.
160.Pp
161Finally,
162.Nm
163can be used to generate and update Key Revocation Lists, and to test whether
164given keys have been revoked by one.
165See the
166.Sx KEY REVOCATION LISTS
167section for details.
168.Pp
169Normally each user wishing to use SSH
170with public key authentication runs this once to create the authentication
171key in
172.Pa ~/.ssh/identity ,
173.Pa ~/.ssh/id_ecdsa ,
174.Pa ~/.ssh/id_dsa
175or
176.Pa ~/.ssh/id_rsa .
177Additionally, the system administrator may use this to generate host keys,
178as seen in
179.Pa /etc/rc.d/sshd .
180.Pp
181Normally this program generates the key and asks for a file in which
182to store the private key.
183The public key is stored in a file with the same name but
184.Dq .pub
185appended.
186The program also asks for a passphrase.
187The passphrase may be empty to indicate no passphrase
188(host keys must have an empty passphrase), or it may be a string of
189arbitrary length.
190A passphrase is similar to a password, except it can be a phrase with a
191series of words, punctuation, numbers, whitespace, or any string of
192characters you want.
193Good passphrases are 10-30 characters long, are
194not simple sentences or otherwise easily guessable (English
195prose has only 1-2 bits of entropy per character, and provides very bad
196passphrases), and contain a mix of upper and lowercase letters,
197numbers, and non-alphanumeric characters.
198The passphrase can be changed later by using the
199.Fl p
200option.
201.Pp
202There is no way to recover a lost passphrase.
203If the passphrase is lost or forgotten, a new key must be generated
204and the corresponding public key copied to other machines.
205.Pp
206For RSA1 keys,
207there is also a comment field in the key file that is only for
208convenience to the user to help identify the key.
209The comment can tell what the key is for, or whatever is useful.
210The comment is initialized to
211.Dq user@host
212when the key is created, but can be changed using the
213.Fl c
214option.
215.Pp
216After a key is generated, instructions below detail where the keys
217should be placed to be activated.
218.Pp
219The options are as follows:
220.Bl -tag -width Ds
221.It Fl A
222For each of the key types (rsa1, rsa, dsa and ecdsa) for which host keys
223do not exist, generate the host keys with the default key file path,
224an empty passphrase, default bits for the key type, and default comment.
225This is used by
226.Pa /etc/rc
227to generate new host keys.
228.It Fl a Ar trials
229Specifies the number of primality tests to perform when screening DH-GEX
230candidates using the
231.Fl T
232command.
233.It Fl B
234Show the bubblebabble digest of specified private or public key file.
235.It Fl b Ar bits
236Specifies the number of bits in the key to create.
237For RSA keys, the minimum size is 768 bits and the default is 2048 bits.
238Generally, 2048 bits is considered sufficient.
239DSA keys must be exactly 1024 bits as specified by FIPS 186-2.
240For ECDSA keys, the
241.Fl b
242flag determines the key length by selecting from one of three elliptic
243curve sizes: 256, 384 or 521 bits.
244Attempting to use bit lengths other than these three values for ECDSA keys
245will fail.
246.It Fl C Ar comment
247Provides a new comment.
248.It Fl c
249Requests changing the comment in the private and public key files.
250This operation is only supported for RSA1 keys.
251The program will prompt for the file containing the private keys, for
252the passphrase if the key has one, and for the new comment.
253.It Fl D Ar pkcs11
254Download the RSA public keys provided by the PKCS#11 shared library
255.Ar pkcs11 .
256When used in combination with
257.Fl s ,
258this option indicates that a CA key resides in a PKCS#11 token (see the
259.Sx CERTIFICATES
260section for details).
261.It Fl e
262This option will read a private or public OpenSSH key file and
263print to stdout the key in one of the formats specified by the
264.Fl m
265option.
266The default export format is
267.Dq RFC4716 .
268This option allows exporting OpenSSH keys for use by other programs, including
269several commercial SSH implementations.
270.It Fl F Ar hostname
271Search for the specified
272.Ar hostname
273in a
274.Pa known_hosts
275file, listing any occurrences found.
276This option is useful to find hashed host names or addresses and may also be
277used in conjunction with the
278.Fl H
279option to print found keys in a hashed format.
280.It Fl f Ar filename
281Specifies the filename of the key file.
282.It Fl G Ar output_file
283Generate candidate primes for DH-GEX.
284These primes must be screened for
285safety (using the
286.Fl T
287option) before use.
288.It Fl g
289Use generic DNS format when printing fingerprint resource records using the
290.Fl r
291command.
292.It Fl H
293Hash a
294.Pa known_hosts
295file.
296This replaces all hostnames and addresses with hashed representations
297within the specified file; the original content is moved to a file with
298a .old suffix.
299These hashes may be used normally by
300.Nm ssh
301and
302.Nm sshd ,
303but they do not reveal identifying information should the file's contents
304be disclosed.
305This option will not modify existing hashed hostnames and is therefore safe
306to use on files that mix hashed and non-hashed names.
307.It Fl h
308When signing a key, create a host certificate instead of a user
309certificate.
310Please see the
311.Sx CERTIFICATES
312section for details.
313.It Fl I Ar certificate_identity
314Specify the key identity when signing a public key.
315Please see the
316.Sx CERTIFICATES
317section for details.
318.It Fl i
319This option will read an unencrypted private (or public) key file
320in the format specified by the
321.Fl m
322option and print an OpenSSH compatible private
323(or public) key to stdout.
324.It Fl J Ar num_lines
325Exit after screening the specified number of lines
326while performing DH candidate screening using the
327.Fl T
328option.
329.It Fl j Ar start_line
330Start screening at the specified line number
331while performing DH candidate screening using the
332.Fl T
333option.
334.It Fl K Ar checkpt
335Write the last line processed to the file
336.Ar checkpt
337while performing DH candidate screening using the
338.Fl T
339option.
340This will be used to skip lines in the input file that have already been
341processed if the job is restarted.
342This option allows importing keys from other software, including several
343commercial SSH implementations.
344The default import format is
345.Dq RFC4716 .
346.It Fl k
347Generate a KRL file.
348In this mode,
349.Nm
350will generate a KRL file at the location specified via the
351.Fl f
352flag that revokes every key or certificate presented on the command line.
353Keys/certificates to be revoked may be specified by public key file or
354using the format described in the
355.Sx KEY REVOCATION LISTS
356section.
357.It Fl L
358Prints the contents of a certificate.
359.It Fl l
360Show fingerprint of specified public key file.
361Private RSA1 keys are also supported.
362For RSA and DSA keys
363.Nm
364tries to find the matching public key file and prints its fingerprint.
365If combined with
366.Fl v ,
367an ASCII art representation of the key is supplied with the fingerprint.
368.It Fl M Ar memory
369Specify the amount of memory to use (in megabytes) when generating
370candidate moduli for DH-GEX.
371.It Fl m Ar key_format
372Specify a key format for the
373.Fl i
374(import) or
375.Fl e
376(export) conversion options.
377The supported key formats are:
378.Dq RFC4716
379(RFC 4716/SSH2 public or private key),
380.Dq PKCS8
381(PEM PKCS8 public key)
382or
383.Dq PEM
384(PEM public key).
385The default conversion format is
386.Dq RFC4716 .
387.It Fl N Ar new_passphrase
388Provides the new passphrase.
389.It Fl n Ar principals
390Specify one or more principals (user or host names) to be included in
391a certificate when signing a key.
392Multiple principals may be specified, separated by commas.
393Please see the
394.Sx CERTIFICATES
395section for details.
396.It Fl O Ar option
397Specify a certificate option when signing a key.
398This option may be specified multiple times.
399Please see the
400.Sx CERTIFICATES
401section for details.
402The options that are valid for user certificates are:
403.Bl -tag -width Ds
404.It Ic clear
405Clear all enabled permissions.
406This is useful for clearing the default set of permissions so permissions may
407be added individually.
408.It Ic force-command Ns = Ns Ar command
409Forces the execution of
410.Ar command
411instead of any shell or command specified by the user when
412the certificate is used for authentication.
413.It Ic no-agent-forwarding
414Disable
415.Xr ssh-agent 1
416forwarding (permitted by default).
417.It Ic no-port-forwarding
418Disable port forwarding (permitted by default).
419.It Ic no-pty
420Disable PTY allocation (permitted by default).
421.It Ic no-user-rc
422Disable execution of
423.Pa ~/.ssh/rc
424by
425.Xr sshd 8
426(permitted by default).
427.It Ic no-x11-forwarding
428Disable X11 forwarding (permitted by default).
429.It Ic permit-agent-forwarding
430Allows
431.Xr ssh-agent 1
432forwarding.
433.It Ic permit-port-forwarding
434Allows port forwarding.
435.It Ic permit-pty
436Allows PTY allocation.
437.It Ic permit-user-rc
438Allows execution of
439.Pa ~/.ssh/rc
440by
441.Xr sshd 8 .
442.It Ic permit-x11-forwarding
443Allows X11 forwarding.
444.It Ic source-address Ns = Ns Ar address_list
445Restrict the source addresses from which the certificate is considered valid.
446The
447.Ar address_list
448is a comma-separated list of one or more address/netmask pairs in CIDR
449format.
450.El
451.Pp
452At present, no options are valid for host keys.
453.It Fl P Ar passphrase
454Provides the (old) passphrase.
455.It Fl p
456Requests changing the passphrase of a private key file instead of
457creating a new private key.
458The program will prompt for the file
459containing the private key, for the old passphrase, and twice for the
460new passphrase.
461.It Fl Q
462Test whether keys have been revoked in a KRL.
463.It Fl q
464Silence
465.Nm ssh-keygen .
466Used by
467.Pa /etc/rc.d/sshd
468when creating a new key.
469.It Fl R Ar hostname
470Removes all keys belonging to
471.Ar hostname
472from a
473.Pa known_hosts
474file.
475This option is useful to delete hashed hosts (see the
476.Fl H
477option above).
478.It Fl r Ar hostname
479Print the SSHFP fingerprint resource record named
480.Ar hostname
481for the specified public key file.
482.It Fl S Ar start
483Specify start point (in hex) when generating candidate moduli for DH-GEX.
484.It Fl s Ar ca_key
485Certify (sign) a public key using the specified CA key.
486Please see the
487.Sx CERTIFICATES
488section for details.
489.Pp
490When generating a KRL,
491.Fl s
492specifies a path to a CA public key file used to revoke certificates directly
493by key ID or serial number.
494See the
495.Sx KEY REVOCATION LISTS
496section for details.
497.It Fl T Ar output_file
498Test DH group exchange candidate primes (generated using the
499.Fl G
500option) for safety.
501.It Fl t Ar type
502Specifies the type of key to create.
503The possible values are
504.Dq rsa1
505for protocol version 1 and
506.Dq dsa ,
507.Dq ecdsa
508or
509.Dq rsa
510for protocol version 2.
511.It Fl u
512Update a KRL.
513When specified with
514.Fl k ,
515keys listed via the command line are added to the existing KRL rather than
516a new KRL being created.
517.It Fl V Ar validity_interval
518Specify a validity interval when signing a certificate.
519A validity interval may consist of a single time, indicating that the
520certificate is valid beginning now and expiring at that time, or may consist
521of two times separated by a colon to indicate an explicit time interval.
522The start time may be specified as a date in YYYYMMDD format, a time
523in YYYYMMDDHHMMSS format or a relative time (to the current time) consisting
524of a minus sign followed by a relative time in the format described in the
525TIME FORMATS section of
526.Xr sshd_config 5 .
527The end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMMSS time or
528a relative time starting with a plus character.
529.Pp
530For example:
531.Dq +52w1d
532(valid from now to 52 weeks and one day from now),
533.Dq -4w:+4w
534(valid from four weeks ago to four weeks from now),
535.Dq 20100101123000:20110101123000
536(valid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011),
537.Dq -1d:20110101
538(valid from yesterday to midnight, January 1st, 2011).
539.It Fl v
540Verbose mode.
541Causes
542.Nm
543to print debugging messages about its progress.
544This is helpful for debugging moduli generation.
545Multiple
546.Fl v
547options increase the verbosity.
548The maximum is 3.
549.It Fl W Ar generator
550Specify desired generator when testing candidate moduli for DH-GEX.
551.It Fl y
552This option will read a private
553OpenSSH format file and print an OpenSSH public key to stdout.
554.It Fl z Ar serial_number
555Specifies a serial number to be embedded in the certificate to distinguish
556this certificate from others from the same CA.
557The default serial number is zero.
558.Pp
559When generating a KRL, the
560.Fl z
561flag is used to specify a KRL version number.
562.El
563.Sh MODULI GENERATION
564.Nm
565may be used to generate groups for the Diffie-Hellman Group Exchange
566(DH-GEX) protocol.
567Generating these groups is a two-step process: first, candidate
568primes are generated using a fast, but memory intensive process.
569These candidate primes are then tested for suitability (a CPU-intensive
570process).
571.Pp
572Generation of primes is performed using the
573.Fl G
574option.
575The desired length of the primes may be specified by the
576.Fl b
577option.
578For example:
579.Pp
580.Dl # ssh-keygen -G moduli-2048.candidates -b 2048
581.Pp
582By default, the search for primes begins at a random point in the
583desired length range.
584This may be overridden using the
585.Fl S
586option, which specifies a different start point (in hex).
587.Pp
588Once a set of candidates have been generated, they must be screened for
589suitability.
590This may be performed using the
591.Fl T
592option.
593In this mode
594.Nm
595will read candidates from standard input (or a file specified using the
596.Fl f
597option).
598For example:
599.Pp
600.Dl # ssh-keygen -T moduli-2048 -f moduli-2048.candidates
601.Pp
602By default, each candidate will be subjected to 100 primality tests.
603This may be overridden using the
604.Fl a
605option.
606The DH generator value will be chosen automatically for the
607prime under consideration.
608If a specific generator is desired, it may be requested using the
609.Fl W
610option.
611Valid generator values are 2, 3, and 5.
612.Pp
613Screened DH groups may be installed in
614.Pa /etc/moduli .
615It is important that this file contains moduli of a range of bit lengths and
616that both ends of a connection share common moduli.
617.Sh CERTIFICATES
618.Nm
619supports signing of keys to produce certificates that may be used for
620user or host authentication.
621Certificates consist of a public key, some identity information, zero or
622more principal (user or host) names and a set of options that
623are signed by a Certification Authority (CA) key.
624Clients or servers may then trust only the CA key and verify its signature
625on a certificate rather than trusting many user/host keys.
626Note that OpenSSH certificates are a different, and much simpler, format to
627the X.509 certificates used in
628.Xr ssl 8 .
629.Pp
630.Nm
631supports two types of certificates: user and host.
632User certificates authenticate users to servers, whereas host certificates
633authenticate server hosts to users.
634To generate a user certificate:
635.Pp
636.Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
637.Pp
638The resultant certificate will be placed in
639.Pa /path/to/user_key-cert.pub .
640A host certificate requires the
641.Fl h
642option:
643.Pp
644.Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
645.Pp
646The host certificate will be output to
647.Pa /path/to/host_key-cert.pub .
648.Pp
649It is possible to sign using a CA key stored in a PKCS#11 token by
650providing the token library using
651.Fl D
652and identifying the CA key by providing its public half as an argument
653to
654.Fl s :
655.Pp
656.Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id host_key.pub
657.Pp
658In all cases,
659.Ar key_id
660is a "key identifier" that is logged by the server when the certificate
661is used for authentication.
662.Pp
663Certificates may be limited to be valid for a set of principal (user/host)
664names.
665By default, generated certificates are valid for all users or hosts.
666To generate a certificate for a specified set of principals:
667.Pp
668.Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
669.Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain user_key.pub"
670.Pp
671Additional limitations on the validity and use of user certificates may
672be specified through certificate options.
673A certificate option may disable features of the SSH session, may be
674valid only when presented from particular source addresses or may
675force the use of a specific command.
676For a list of valid certificate options, see the documentation for the
677.Fl O
678option above.
679.Pp
680Finally, certificates may be defined with a validity lifetime.
681The
682.Fl V
683option allows specification of certificate start and end times.
684A certificate that is presented at a time outside this range will not be
685considered valid.
686By default, certificates are valid from
687.Ux
688Epoch to the distant future.
689.Pp
690For certificates to be used for user or host authentication, the CA
691public key must be trusted by
692.Xr sshd 8
693or
694.Xr ssh 1 .
695Please refer to those manual pages for details.
696.Sh KEY REVOCATION LISTS
697.Nm
698is able to manage OpenSSH format Key Revocation Lists (KRLs).
699These binary files specify keys or certificates to be revoked using a
700compact format, taking as little a one bit per certificate if they are being
701revoked by serial number.
702.Pp
703KRLs may be generated using the
704.Fl k
705flag.
706This option reads one or more files from the command line and generates a new
707KRL.
708The files may either contain a KRL specification (see below) or public keys,
709listed one per line.
710Plain public keys are revoked by listing their hash or contents in the KRL and
711certificates revoked by serial number or key ID (if the serial is zero or
712not available).
713.Pp
714Revoking keys using a KRL specification offers explicit control over the
715types of record used to revoke keys and may be used to directly revoke
716certificates by serial number or key ID without having the complete original
717certificate on hand.
718A KRL specification consists of lines containing one of the following directives
719followed by a colon and some directive-specific information.
720.Bl -tag -width Ds
721.It Cm serial : Ar serial_number Ns Op - Ns Ar serial_number
722Revokes a certificate with the specified serial number.
723Serial numbers are 64-bit values, not including zero and may be expressed
724in decimal, hex or octal.
725If two serial numbers are specified separated by a hyphen, then the range
726of serial numbers including and between each is revoked.
727The CA key must have been specified on the
728.Nm
729command line using the
730.Fl s
731option.
732.It Cm id : Ar key_id
733Revokes a certificate with the specified key ID string.
734The CA key must have been specified on the
735.Nm
736command line using the
737.Fl s
738option.
739.It Cm key : Ar public_key
740Revokes the specified key.
741If a certificate is listed, then it is revoked as a plain public key.
742.It Cm sha1 : Ar public_key
743Revokes the specified key by its SHA1 hash.
744.El
745.Pp
746KRLs may be updated using the
747.Fl u
748flag in addition to
749.Fl k .
750When this option is specified, keys listed via the command line are merged into
751the KRL, adding to those already there.
752.Pp
753It is also possible, given a KRL, to test whether it revokes a particular key
754(or keys).
755The
756.Fl Q
757flag will query an existing KRL, testing each key specified on the commandline.
758If any key listed on the command line has been revoked (or an error encountered)
759then
760.Nm
761will exit with a non-zero exit status.
762A zero exit status will only be returned if no key was revoked.
763.Sh FILES
764.Bl -tag -width Ds -compact
765.It Pa ~/.ssh/identity
766Contains the protocol version 1 RSA authentication identity of the user.
767This file should not be readable by anyone but the user.
768It is possible to
769specify a passphrase when generating the key; that passphrase will be
770used to encrypt the private part of this file using 3DES.
771This file is not automatically accessed by
772.Nm
773but it is offered as the default file for the private key.
774.Xr ssh 1
775will read this file when a login attempt is made.
776.Pp
777.It Pa ~/.ssh/identity.pub
778Contains the protocol version 1 RSA public key for authentication.
779The contents of this file should be added to
780.Pa ~/.ssh/authorized_keys
781on all machines
782where the user wishes to log in using RSA authentication.
783There is no need to keep the contents of this file secret.
784.Pp
785.It Pa ~/.ssh/id_dsa
786.It Pa ~/.ssh/id_ecdsa
787.It Pa ~/.ssh/id_rsa
788Contains the protocol version 2 DSA, ECDSA or RSA authentication identity of the user.
789This file should not be readable by anyone but the user.
790It is possible to
791specify a passphrase when generating the key; that passphrase will be
792used to encrypt the private part of this file using 128-bit AES.
793This file is not automatically accessed by
794.Nm
795but it is offered as the default file for the private key.
796.Xr ssh 1
797will read this file when a login attempt is made.
798.Pp
799.It Pa ~/.ssh/id_dsa.pub
800.It Pa ~/.ssh/id_ecdsa.pub
801.It Pa ~/.ssh/id_rsa.pub
802Contains the protocol version 2 DSA, ECDSA or RSA public key for authentication.
803The contents of this file should be added to
804.Pa ~/.ssh/authorized_keys
805on all machines
806where the user wishes to log in using public key authentication.
807There is no need to keep the contents of this file secret.
808.Pp
809.It Pa /etc/moduli
810Contains Diffie-Hellman groups used for DH-GEX.
811The file format is described in
812.Xr moduli 5 .
813.El
814.Sh SEE ALSO
815.Xr ssh 1 ,
816.Xr ssh-add 1 ,
817.Xr ssh-agent 1 ,
818.Xr moduli 5 ,
819.Xr sshd 8
820.Rs
821.%R RFC 4716
822.%T "The Secure Shell (SSH) Public Key File Format"
823.%D 2006
824.Re
825.Sh AUTHORS
826OpenSSH is a derivative of the original and free
827ssh 1.2.12 release by Tatu Ylonen.
828Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
829Theo de Raadt and Dug Song
830removed many bugs, re-added newer features and
831created OpenSSH.
832Markus Friedl contributed the support for SSH
833protocol versions 1.5 and 2.0.
834