summaryrefslogtreecommitdiff
path: root/ssh-keygen.0
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2005-01-04 12:58:23 +0000
committerColin Watson <cjwatson@debian.org>2005-01-04 12:58:23 +0000
commitebd2ce335af5861020c79fddb1ae35c03bf036cf (patch)
treeec008b93c62e3241ab611d8c949ebc92905c66b4 /ssh-keygen.0
parente17cc75fe35f62ba52928b5889b5e7aadb62bedb (diff)
parent16f1d21ea191deaaeeba719d01c0ad82aa044653 (diff)
Import OpenSSH 3.9p1.
Diffstat (limited to 'ssh-keygen.0')
-rw-r--r--ssh-keygen.0262
1 files changed, 262 insertions, 0 deletions
diff --git a/ssh-keygen.0 b/ssh-keygen.0
new file mode 100644
index 000000000..38e50b121
--- /dev/null
+++ b/ssh-keygen.0
@@ -0,0 +1,262 @@
1SSH-KEYGEN(1) OpenBSD Reference Manual SSH-KEYGEN(1)
2
3NAME
4 ssh-keygen - authentication key generation, management and conversion
5
6SYNOPSIS
7 ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
8 [-f output_keyfile]
9 ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
10 ssh-keygen -i [-f input_keyfile]
11 ssh-keygen -e [-f input_keyfile]
12 ssh-keygen -y [-f input_keyfile]
13 ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile]
14 ssh-keygen -l [-f input_keyfile]
15 ssh-keygen -B [-f input_keyfile]
16 ssh-keygen -D reader
17 ssh-keygen -U reader [-f input_keyfile]
18 ssh-keygen -r hostname [-f input_keyfile] [-g]
19 ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point]
20 ssh-keygen -T output_file -f input_file [-v] [-a num_trials] [-W
21 generator]
22
23DESCRIPTION
24 ssh-keygen generates, manages and converts authentication keys for
25 ssh(1). ssh-keygen can create RSA keys for use by SSH protocol version 1
26 and RSA or DSA keys for use by SSH protocol version 2. The type of key
27 to be generated is specified with the -t option.
28
29 ssh-keygen is also used to generate groups for use in Diffie-Hellman
30 group exchange (DH-GEX). See the MODULI GENERATION section for details.
31
32 Normally each user wishing to use SSH with RSA or DSA authentication runs
33 this once to create the authentication key in $HOME/.ssh/identity,
34 $HOME/.ssh/id_dsa or $HOME/.ssh/id_rsa. Additionally, the system admin-
35 istrator may use this to generate host keys, as seen in /etc/rc.
36
37 Normally this program generates the key and asks for a file in which to
38 store the private key. The public key is stored in a file with the same
39 name but ``.pub'' appended. The program also asks for a passphrase. The
40 passphrase may be empty to indicate no passphrase (host keys must have an
41 empty passphrase), or it may be a string of arbitrary length. A
42 passphrase is similar to a password, except it can be a phrase with a se-
43 ries of words, punctuation, numbers, whitespace, or any string of charac-
44 ters you want. Good passphrases are 10-30 characters long, are not sim-
45 ple sentences or otherwise easily guessable (English prose has only 1-2
46 bits of entropy per character, and provides very bad passphrases), and
47 contain a mix of upper and lowercase letters, numbers, and non-alphanu-
48 meric characters. The passphrase can be changed later by using the -p
49 option.
50
51 There is no way to recover a lost passphrase. If the passphrase is lost
52 or forgotten, a new key must be generated and copied to the corresponding
53 public key to other machines.
54
55 For RSA1 keys, there is also a comment field in the key file that is only
56 for convenience to the user to help identify the key. The comment can
57 tell what the key is for, or whatever is useful. The comment is initial-
58 ized to ``user@host'' when the key is created, but can be changed using
59 the -c option.
60
61 After a key is generated, instructions below detail where the keys should
62 be placed to be activated.
63
64 The options are as follows:
65
66 -a trials
67 Specifies the number of primality tests to perform when screening
68 DH-GEX candidates using the -T command.
69
70 -b bits
71 Specifies the number of bits in the key to create. Minimum is
72 512 bits. Generally, 1024 bits is considered sufficient. The
73 default is 1024 bits.
74
75 -c Requests changing the comment in the private and public key
76 files. This operation is only supported for RSA1 keys. The pro-
77 gram will prompt for the file containing the private keys, for
78 the passphrase if the key has one, and for the new comment.
79
80 -e This option will read a private or public OpenSSH key file and
81 print the key in a `SECSH Public Key File Format' to stdout.
82 This option allows exporting keys for use by several commercial
83 SSH implementations.
84
85 -g Use generic DNS format when printing fingerprint resource records
86 using the -r command.
87
88 -f filename
89 Specifies the filename of the key file.
90
91 -i This option will read an unencrypted private (or public) key file
92 in SSH2-compatible format and print an OpenSSH compatible private
93 (or public) key to stdout. ssh-keygen also reads the `SECSH
94 Public Key File Format'. This option allows importing keys from
95 several commercial SSH implementations.
96
97 -l Show fingerprint of specified public key file. Private RSA1 keys
98 are also supported. For RSA and DSA keys ssh-keygen tries to
99 find the matching public key file and prints its fingerprint.
100
101 -p Requests changing the passphrase of a private key file instead of
102 creating a new private key. The program will prompt for the file
103 containing the private key, for the old passphrase, and twice for
104 the new passphrase.
105
106 -q Silence ssh-keygen. Used by /etc/rc when creating a new key.
107
108 -y This option will read a private OpenSSH format file and print an
109 OpenSSH public key to stdout.
110
111 -t type
112 Specifies the type of the key to create. The possible values are
113 ``rsa1'' for protocol version 1 and ``rsa'' or ``dsa'' for proto-
114 col version 2.
115
116 -B Show the bubblebabble digest of specified private or public key
117 file.
118
119 -C comment
120 Provides the new comment.
121
122 -D reader
123 Download the RSA public key stored in the smartcard in reader.
124
125 -G output_file
126 Generate candidate primes for DH-GEX. These primes must be
127 screened for safety (using the -T option) before use.
128
129 -M memory
130 Specify the amount of memory to use (in megabytes) when generat-
131 ing candidate moduli for DH-GEX.
132
133 -N new_passphrase
134 Provides the new passphrase.
135
136 -P passphrase
137 Provides the (old) passphrase.
138
139 -S start
140 Specify start point (in hex) when generating candidate moduli for
141 DH-GEX.
142
143 -T output_file
144 Test DH group exchange candidate primes (generated using the -G
145 option) for safety.
146
147 -W generator
148 Specify desired generator when testing candidate moduli for DH-
149 GEX.
150
151 -U reader
152 Upload an existing RSA private key into the smartcard in reader.
153
154 -v Verbose mode. Causes ssh-keygen to print debugging messages
155 about its progress. This is helpful for debugging moduli genera-
156 tion. Multiple -v options increase the verbosity. The maximum
157 is 3.
158
159 -r hostname
160 Print the SSHFP fingerprint resource record named hostname for
161 the specified public key file.
162
163MODULI GENERATION
164 ssh-keygen may be used to generate groups for the Diffie-Hellman Group
165 Exchange (DH-GEX) protocol. Generating these groups is a two-step pro-
166 cess: first, candidate primes are generated using a fast, but memory in-
167 tensive process. These candidate primes are then tested for suitability
168 (a CPU-intensive process).
169
170 Generation of primes is performed using the -G option. The desired
171 length of the primes may be specified by the -b option. For example:
172
173 ssh-keygen -G moduli-2048.candidates -b 2048
174
175 By default, the search for primes begins at a random point in the desired
176 length range. This may be overridden using the -S option, which speci-
177 fies a different start point (in hex).
178
179 Once a set of candidates have been generated, they must be tested for
180 suitability. This may be performed using the -T option. In this mode
181 ssh-keygen will read candidates from standard input (or a file specified
182 using the -f option). For example:
183
184 ssh-keygen -T moduli-2048 -f moduli-2048.candidates
185
186 By default, each candidate will be subjected to 100 primality tests.
187 This may be overridden using the -a option. The DH generator value will
188 be chosen automatically for the prime under consideration. If a specific
189 generator is desired, it may be requested using the -W option. Valid
190 generator values are 2, 3 and 5.
191
192 Screened DH groups may be installed in /etc/moduli. It is important that
193 this file contains moduli of a range of bit lengths and that both ends of
194 a connection share common moduli.
195
196FILES
197 $HOME/.ssh/identity
198 Contains the protocol version 1 RSA authentication identity of
199 the user. This file should not be readable by anyone but the us-
200 er. It is possible to specify a passphrase when generating the
201 key; that passphrase will be used to encrypt the private part of
202 this file using 3DES. This file is not automatically accessed by
203 ssh-keygen but it is offered as the default file for the private
204 key. ssh(1) will read this file when a login attempt is made.
205
206 $HOME/.ssh/identity.pub
207 Contains the protocol version 1 RSA public key for authentica-
208 tion. The contents of this file should be added to
209 $HOME/.ssh/authorized_keys on all machines where the user wishes
210 to log in using RSA authentication. There is no need to keep the
211 contents of this file secret.
212
213 $HOME/.ssh/id_dsa
214 Contains the protocol version 2 DSA authentication identity of
215 the user. This file should not be readable by anyone but the us-
216 er. It is possible to specify a passphrase when generating the
217 key; that passphrase will be used to encrypt the private part of
218 this file using 3DES. This file is not automatically accessed by
219 ssh-keygen but it is offered as the default file for the private
220 key. ssh(1) will read this file when a login attempt is made.
221
222 $HOME/.ssh/id_dsa.pub
223 Contains the protocol version 2 DSA public key for authentica-
224 tion. The contents of this file should be added to
225 $HOME/.ssh/authorized_keys on all machines where the user wishes
226 to log in using public key authentication. There is no need to
227 keep the contents of this file secret.
228
229 $HOME/.ssh/id_rsa
230 Contains the protocol version 2 RSA authentication identity of
231 the user. This file should not be readable by anyone but the us-
232 er. It is possible to specify a passphrase when generating the
233 key; that passphrase will be used to encrypt the private part of
234 this file using 3DES. This file is not automatically accessed by
235 ssh-keygen but it is offered as the default file for the private
236 key. ssh(1) will read this file when a login attempt is made.
237
238 $HOME/.ssh/id_rsa.pub
239 Contains the protocol version 2 RSA public key for authentica-
240 tion. The contents of this file should be added to
241 $HOME/.ssh/authorized_keys on all machines where the user wishes
242 to log in using public key authentication. There is no need to
243 keep the contents of this file secret.
244
245 /etc/moduli
246 Contains Diffie-Hellman groups used for DH-GEX. The file format
247 is described in moduli(5).
248
249SEE ALSO
250 ssh(1), ssh-add(1), ssh-agent(1), moduli(5), sshd(8)
251
252 J. Galbraith and R. Thayer, SECSH Public Key File Format, draft-ietf-
253 secsh-publickeyfile-01.txt, March 2001, work in progress material.
254
255AUTHORS
256 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
257 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
258 de Raadt and Dug Song removed many bugs, re-added newer features and
259 created OpenSSH. Markus Friedl contributed the support for SSH protocol
260 versions 1.5 and 2.0.
261
262OpenBSD 3.6 September 25, 1999 4