6440 ssh packages should be replaceable
[unleashed.git] / usr / src / man / man1 / ssh-keygen.sunssh.1
blob7468f97e7f26a90d479520488d82ef6f907f4142
1 '\" te
2 .\" To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the
3 .\" installed location.
4 .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
5 .TH SSH-KEYGEN 1 "Feb 17, 2009"
6 .SH NAME
7 ssh-keygen \- authentication key generation
8 .SH SYNOPSIS
9 .LP
10 .nf
11 \fBssh-keygen\fR [\fB-q\fR] [\fB-b\fR \fIbits\fR ] \fB-t\fR \fItype\fR [\fB-N\fR \fInew_passphrase\fR]
12      [\fB-C\fR \fIcomment\fR] [\fB-f\fR \fIoutput_keyfile\fR]
13 .fi
15 .LP
16 .nf
17 \fBssh-keygen\fR \fB-p\fR [\fB-P\fR \fIold_passphrase\fR] [\fB-N\fR \fInew_passphrase\fR]
18      [\fB-f\fR \fIkeyfile\fR]
19 .fi
21 .LP
22 .nf
23 \fBssh-keygen\fR \fB-i\fR [\fB-f\fR \fIinput_keyfile\fR]
24 .fi
26 .LP
27 .nf
28 \fBssh-keygen\fR \fB-e\fR [\fB-f\fR \fIinput_keyfile\fR]
29 .fi
31 .LP
32 .nf
33 \fBssh-keygen\fR \fB-y\fR [\fB-f\fR \fIinput_keyfile\fR]
34 .fi
36 .LP
37 .nf
38 \fBssh-keygen\fR \fB-c\fR [\fB-P\fR \fIpassphrase\fR] [\fB-C\fR \fIcomment\fR] [\fB-f\fR \fIkeyfile\fR]
39 .fi
41 .LP
42 .nf
43 \fBssh-keygen\fR \fB-l\fR [\fB-f\fR \fIinput_keyfile\fR]
44 .fi
46 .LP
47 .nf
48 \fBssh-keygen\fR \fB-B\fR [\fB-f\fR \fIinput_keyfile\fR]
49 .fi
51 .LP
52 .nf
53 \fBssh-keygen\fR \fB-F\fR \fIhostname\fR [\fB-f\fR \fIknown_hosts_file\fR]
54 .fi
56 .LP
57 .nf
58 \fBssh-keygen\fR \fB-H\fR [\fB-f\fR \fIknown_hosts_file\fR]
59 .fi
61 .LP
62 .nf
63 \fBssh-keygen\fR \fB-R\fR \fIhostname\fR [\fB-f\fR \fIknown_hosts_file\fR]
64 .fi
66 .SH DESCRIPTION
67 .LP
68 The \fBssh-keygen\fR utility generates, manages, and converts authentication
69 keys for \fBssh\fR(1). \fBssh-keygen\fR can create RSA keys for use by SSH
70 protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. The
71 type of key to be generated is specified with the \fB-t\fR option.
72 .sp
73 .LP
74 Normally, each user wishing to use \fBSSH\fR with \fBRSA\fR or \fBDSA\fR
75 authentication runs this once to create the authentication key in
76 \fB$HOME/.ssh/identity\fR, \fB$HOME/.ssh/id_dsa\fR, or \fB$HOME/.ssh/id_rsa\fR.
77 The system administrator can also use this to generate host keys..
78 .sp
79 .LP
80 Ordinarily, this program generates the key and asks for a file in which to
81 store the private key. The public key is stored in a file with the same name
82 but with the ``\fB\&.pub\fR'' extension appended. The program also asks for a
83 passphrase. The passphrase can be empty to indicate no passphrase (host keys
84 must have empty passphrases), or it can be a string of arbitrary length. Good
85 passphrases are 10-30 characters long, are not simple sentences or otherwise
86 easy to guess, and contain a mix of uppercase and lowercase letters, numbers,
87 and non-alphanumeric characters. (English prose has only 1-2 bits of entropy
88 per word and provides very poor passphrases.) If a passphrase is set, it must
89 be at least 4 characters long.
90 .sp
91 .LP
92 The passphrase can be changed later by using the \fB-p\fR option.
93 .sp
94 .LP
95 There is no way to recover a lost passphrase. If the passphrase is lost or
96 forgotten, you have to generate a new key and copy the corresponding public key
97 to other machines.
98 .sp
99 .LP
100 For \fBRSA\fR, there is also a comment field in the key file that is only for
101 convenience to the user to help identify the key. The \fIcomment\fR can tell
102 what the key is for, or whatever is useful. The comment is initialized to
103 ``\fBuser@host\fR'' when the key is created, but can be changed using the
104 \fB-c\fR option.
107 After a key is generated, instructions below detail where to place the keys to
108 activate them.
109 .SH OPTIONS
111 The following options are supported:
113 .ne 2
115 \fB\fB-b\fR \fIbits\fR\fR
117 .RS 21n
118 Specifies the number of bits in the key to create. The minimum number is 512
119 bits. Generally, 1024 bits is considered sufficient. Key sizes above that no
120 longer improve security but make things slower. The default is 1024 bits.
124 .ne 2
126 \fB\fB-B\fR\fR
128 .RS 21n
129 Shows the bubblebabble digest of the specified private or public key file.
133 .ne 2
135 \fB\fB-c\fR\fR
137 .RS 21n
138 Requests changing the comment in the private and public key files. The program
139 prompts for the file containing the private keys, for the passphrase if the key
140 has one, and for the new comment.
142 This option only applies to \fBrsa1\fR (\fBSSHv1\fR) keys.
146 .ne 2
148 \fB\fB-C\fR \fIcomment\fR\fR
150 .RS 21n
151 Provides the new comment.
155 .ne 2
157 \fB\fB-e\fR\fR
159 .RS 21n
160 This option reads a private or public OpenSSH key file and prints the key in a
161 "SECSH" Public Key File Format to stdout. This option allows exporting keys for
162 use by several other SSH implementations.
166 .ne 2
168 \fB\fB-f\fR\fR
170 .RS 21n
171 Specifies the filename of the key file.
175 .ne 2
177 \fB\fB-F\fR\fR
179 .RS 21n
180 Search for the specified \fIhostname\fR in a \fBknown_hosts\fR file, listing
181 any occurrences found. This option is useful to find hashed host names or
182 addresses and can also be used in conjunction with the \fB-H\fR option to print
183 found keys in a hashed format.
187 .ne 2
189 \fB\fB-H\fR\fR
191 .RS 21n
192 Hash a \fBknown_hosts\fR file. This replaces all host names and addresses with
193 hashed representations within the specified file. The original content is moved
194 to a file with a \fB\&.old\fR suffix. These hashes may be used normally by
195 \fBssh\fR and \fBsshd\fR, but they do not reveal identifying information should
196 the file's contents be disclosed. This option does not modify existing hashed
197 host names and is therefore safe to use on files that mix hashed and non-hashed
198 names.
202 .ne 2
204 \fB\fB-i\fR\fR
206 .RS 21n
207 This option reads an unencrypted private (or public) key file in
208 SSH2-compatible format and prints an OpenSSH compatible private (or public) key
209 to stdout. \fBssh-keygen\fR also reads the "SECSH" Public Key File Format. This
210 option allows importing keys from several other SSH implementations.
214 .ne 2
216 \fB\fB-l\fR\fR
218 .RS 21n
219 Shows the fingerprint of the specified private or public key file.
223 .ne 2
225 \fB\fB-N\fR \fInew_passphrase\fR\fR
227 .RS 21n
228 Provides the new passphrase.
232 .ne 2
234 \fB\fB-p\fR\fR
236 .RS 21n
237 Requests changing the passphrase of a private key file instead of creating a
238 new private key. The program prompts for the file containing the private key,
239 for the old passphrase, and prompts twice for the new passphrase.
243 .ne 2
245 \fB\fB-P\fR \fIpassphrase\fR\fR
247 .RS 21n
248 Provides the (old) passphrase.
252 .ne 2
254 \fB\fB-q\fR\fR
256 .RS 21n
257 Silences \fBssh-keygen\fR.
261 .ne 2
263 \fB\fB-t\fR \fItype\fR\fR
265 .RS 21n
266 Specifies the algorithm used for the key, where \fItype\fR is one of \fBrsa\fR,
267 \fBdsa\fR, and \fBrsa1\fR. Type \fBrsa1\fR is used only for the SSHv1 protocol.
271 .ne 2
273 \fB\fB-R\fR \fIhostname\fR\fR
275 .RS 21n
276 Removes all keys belonging to \fIhostname\fR from a \fBknown_hosts\fR file.
277 This option is useful to delete hashed hosts. See \fB-H\fR.
281 .ne 2
283 \fB\fB-x\fR\fR
285 .RS 21n
286 Obsolete. Replaced by the \fB-e\fR option.
290 .ne 2
292 \fB\fB-X\fR\fR
294 .RS 21n
295 Obsolete. Replaced by the \fB-i\fR option.
299 .ne 2
301 \fB\fB-y\fR\fR
303 .RS 21n
304 This option reads a private OpenSSH format file and prints an OpenSSH public
305 key to stdout.
308 .SH EXIT STATUS
310 The following exit values are returned:
312 .ne 2
314 \fB\fB0\fR\fR
316 .RS 5n
317 Successful completion.
321 .ne 2
323 \fB\fB1\fR\fR
325 .RS 5n
326 An error occurred.
329 .SH FILES
330 .ne 2
332 \fB\fB$HOME/.ssh/identity\fR\fR
334 .RS 27n
335 This file contains the RSA private key for the SSHv1 protocol. This file should
336 not be readable by anyone but the user. It is possible to specify a passphrase
337 when generating the key; that passphrase is used to encrypt the private part of
338 this file using 3DES. This file is not automatically accessed by
339 \fBssh-keygen\fR, but it is offered as the default file for the private key.
340 \fBsshd\fR(1M) reads this file when a login attempt is made.
344 .ne 2
346 \fB\fB$HOME/.ssh/identity.pub\fR\fR
348 .RS 27n
349 This file contains the RSA public key for the SSHv1 protocol. The contents of
350 this file should be added to \fB$HOME/.ssh/authorized_keys\fR on all machines
351 where you wish to log in using \fBRSA\fR authentication. There is no need to
352 keep the contents of this file secret.
356 .ne 2
358 \fB\fB$HOME/.ssh/id_dsa\fR\fR
362 \fB\fB$HOME/.ssh/id_rsa\fR\fR
364 .RS 27n
365 These files contain, respectively, the DSA or RSA private key for the SSHv2
366 protocol. These files should not be readable by anyone but the user. It is
367 possible to specify a passphrase when generating the key; that passphrase is
368 used to encrypt the private part of the file using 3DES. Neither of these files
369 is automatically accessed by \fBssh-keygen\fR but is offered as the default
370 file for the private key. \fBsshd\fR(1M) reads this file when a login attempt
371 is made.
375 .ne 2
377 \fB\fB$HOME/.ssh/id_dsa.pub\fR\fR
381 \fB\fB$HOME/.ssh/id_rsa.pub\fR\fR
383 .RS 27n
384 These files contain, respectively, the DSA or RSA public key for the SSHv2
385 protocol. The contents of these files should be added, respectively, to
386 \fB$HOME/.ssh/authorized_keys\fR on all machines where you wish to log in using
387 DSA or RSA authentication. There is no need to keep the contents of these files
388 secret.
391 .SH ATTRIBUTES
393 See \fBattributes\fR(5) for descriptions of the following attributes:
398 box;
399 c | c
400 l | l .
401 ATTRIBUTE TYPE  ATTRIBUTE VALUE
403 Interface Stability     Committed
406 .SH SEE ALSO
408 \fBssh\fR(1), \fBssh-add\fR(1), \fBssh-agent\fR(1), \fBsshd\fR(1M),
409 \fBattributes\fR(5)