summaryrefslogtreecommitdiff
path: root/ssh-keygen.0
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keygen.0')
-rw-r--r--ssh-keygen.0181
1 files changed, 163 insertions, 18 deletions
diff --git a/ssh-keygen.0 b/ssh-keygen.0
index 75703483e..c9877300e 100644
--- a/ssh-keygen.0
+++ b/ssh-keygen.0
@@ -13,15 +13,17 @@ SYNOPSIS
13 ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile] 13 ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile]
14 ssh-keygen -l [-f input_keyfile] 14 ssh-keygen -l [-f input_keyfile]
15 ssh-keygen -B [-f input_keyfile] 15 ssh-keygen -B [-f input_keyfile]
16 ssh-keygen -D reader 16 ssh-keygen -D pkcs11
17 ssh-keygen -F hostname [-f known_hosts_file] [-l] 17 ssh-keygen -F hostname [-f known_hosts_file] [-l]
18 ssh-keygen -H [-f known_hosts_file] 18 ssh-keygen -H [-f known_hosts_file]
19 ssh-keygen -R hostname [-f known_hosts_file] 19 ssh-keygen -R hostname [-f known_hosts_file]
20 ssh-keygen -U reader [-f input_keyfile]
21 ssh-keygen -r hostname [-f input_keyfile] [-g] 20 ssh-keygen -r hostname [-f input_keyfile] [-g]
22 ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point] 21 ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point]
23 ssh-keygen -T output_file -f input_file [-v] [-a num_trials] [-W 22 ssh-keygen -T output_file -f input_file [-v] [-a num_trials]
24 generator] 23 [-W generator]
24 ssh-keygen -s ca_key -I certificate_identity [-h] [-n principals]
25 [-O constraint] [-V validity_interval] file ...
26 ssh-keygen -L [-f input_keyfile]
25 27
26DESCRIPTION 28DESCRIPTION
27 ssh-keygen generates, manages and converts authentication keys for 29 ssh-keygen generates, manages and converts authentication keys for
@@ -89,8 +91,9 @@ DESCRIPTION
89 gram will prompt for the file containing the private keys, for 91 gram will prompt for the file containing the private keys, for
90 the passphrase if the key has one, and for the new comment. 92 the passphrase if the key has one, and for the new comment.
91 93
92 -D reader 94 -D pkcs11
93 Download the RSA public key stored in the smartcard in reader. 95 Download the RSA public keys provided by the PKCS#11 shared li-
96 brary pkcs11.
94 97
95 -e This option will read a private or public OpenSSH key file and 98 -e This option will read a private or public OpenSSH key file and
96 print the key in RFC 4716 SSH Public Key File Format to stdout. 99 print the key in RFC 4716 SSH Public Key File Format to stdout.
@@ -122,12 +125,21 @@ DESCRIPTION
122 and is therefore safe to use on files that mix hashed and non- 125 and is therefore safe to use on files that mix hashed and non-
123 hashed names. 126 hashed names.
124 127
128 -h When signing a key, create a host certificate instead of a user
129 certificate. Please see the CERTIFICATES section for details.
130
131 -I certificate_identity
132 Specify the key identity when signing a public key. Please see
133 the CERTIFICATES section for details.
134
125 -i This option will read an unencrypted private (or public) key file 135 -i This option will read an unencrypted private (or public) key file
126 in SSH2-compatible format and print an OpenSSH compatible private 136 in SSH2-compatible format and print an OpenSSH compatible private
127 (or public) key to stdout. ssh-keygen also reads the RFC 4716 137 (or public) key to stdout. ssh-keygen also reads the RFC 4716
128 SSH Public Key File Format. This option allows importing keys 138 SSH Public Key File Format. This option allows importing keys
129 from several commercial SSH implementations. 139 from several commercial SSH implementations.
130 140
141 -L Prints the contents of a certificate.
142
131 -l Show fingerprint of specified public key file. Private RSA1 keys 143 -l Show fingerprint of specified public key file. Private RSA1 keys
132 are also supported. For RSA and DSA keys ssh-keygen tries to 144 are also supported. For RSA and DSA keys ssh-keygen tries to
133 find the matching public key file and prints its fingerprint. If 145 find the matching public key file and prints its fingerprint. If
@@ -141,6 +153,65 @@ DESCRIPTION
141 -N new_passphrase 153 -N new_passphrase
142 Provides the new passphrase. 154 Provides the new passphrase.
143 155
156 -n principals
157 Specify one or more principals (user or host names) to be includ-
158 ed in a certificate when signing a key. Multiple principals may
159 be specified, separated by commas. Please see the CERTIFICATES
160 section for details.
161
162 -O constraint
163 Specify a certificate constraint when signing a key. This option
164 may be specified multiple times. Please see the CERTIFICATES
165 section for details. The constraints that are valid for user
166 certificates are:
167
168 no-x11-forwarding
169 Disable X11 forwarding (permitted by default).
170
171 no-agent-forwarding
172 Disable ssh-agent(1) forwarding (permitted by default).
173
174 no-port-forwarding
175 Disable port forwarding (permitted by default).
176
177 no-pty Disable PTY allocation (permitted by default).
178
179 no-user-rc
180 Disable execution of ~/.ssh/rc by sshd(8) (permitted by
181 default).
182
183 clear Clear all enabled permissions. This is useful for clear-
184 ing the default set of permissions so permissions may be
185 added individually.
186
187 permit-x11-forwarding
188 Allows X11 forwarding.
189
190 permit-agent-forwarding
191 Allows ssh-agent(1) forwarding.
192
193 permit-port-forwarding
194 Allows port forwarding.
195
196 permit-pty
197 Allows PTY allocation.
198
199 permit-user-rc
200 Allows execution of ~/.ssh/rc by sshd(8).
201
202 force-command=command
203 Forces the execution of command instead of any shell or
204 command specified by the user when the certificate is
205 used for authentication.
206
207 source-address=address_list
208 Restrict the source addresses from which the certificate
209 is considered valid from. The address_list is a comma-
210 separated list of one or more address/netmask pairs in
211 CIDR format.
212
213 At present, no constraints are valid for host keys.
214
144 -P passphrase 215 -P passphrase
145 Provides the (old) passphrase. 216 Provides the (old) passphrase.
146 217
@@ -164,6 +235,10 @@ DESCRIPTION
164 Specify start point (in hex) when generating candidate moduli for 235 Specify start point (in hex) when generating candidate moduli for
165 DH-GEX. 236 DH-GEX.
166 237
238 -s ca_key
239 Certify (sign) a public key using the specified CA key. Please
240 see the CERTIFICATES section for details.
241
167 -T output_file 242 -T output_file
168 Test DH group exchange candidate primes (generated using the -G 243 Test DH group exchange candidate primes (generated using the -G
169 option) for safety. 244 option) for safety.
@@ -173,8 +248,25 @@ DESCRIPTION
173 ``rsa1'' for protocol version 1 and ``rsa'' or ``dsa'' for proto- 248 ``rsa1'' for protocol version 1 and ``rsa'' or ``dsa'' for proto-
174 col version 2. 249 col version 2.
175 250
176 -U reader 251 -V validity_interval
177 Upload an existing RSA private key into the smartcard in reader. 252 Specify a validity interval when signing a certificate. A valid-
253 ity interval may consist of a single time, indicating that the
254 certificate is valid beginning now and expiring at that time, or
255 may consist of two times separated by a colon to indicate an ex-
256 plicit time interval. The start time may be specified as a date
257 in YYYYMMDD format, a time in YYYYMMDDHHMMSS format or a relative
258 time (to the current time) consisting of a minus sign followed by
259 a relative time in the format described in the TIME FORMATS sec-
260 tion of ssh_config(5). The end time may be specified as a YYYYM-
261 MDD date, a YYYYMMDDHHMMSS time or a relative time starting with
262 a plus character.
263
264 For example: ``+52w1d'' (valid from now to 52 weeks and one day
265 from now), ``-4w:+4w'' (valid from four weeks ago to four weeks
266 from now), ``20100101123000:20110101123000'' (valid from 12:30
267 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011),
268 ``-1d:20110101'' (valid from yesterday to midnight, January 1st,
269 2011).
178 270
179 -v Verbose mode. Causes ssh-keygen to print debugging messages 271 -v Verbose mode. Causes ssh-keygen to print debugging messages
180 about its progress. This is helpful for debugging moduli genera- 272 about its progress. This is helpful for debugging moduli genera-
@@ -221,15 +313,66 @@ MODULI GENERATION
221 this file contains moduli of a range of bit lengths and that both ends of 313 this file contains moduli of a range of bit lengths and that both ends of
222 a connection share common moduli. 314 a connection share common moduli.
223 315
316CERTIFICATES
317 ssh-keygen supports signing of keys to produce certificates that may be
318 used for user or host authentication. Certificates consist of a public
319 key, some identity information, zero or more principal (user or host)
320 names and an optional set of constraints that are signed by a Certifica-
321 tion Authority (CA) key. Clients or servers may then trust only the CA
322 key and verify its signature on a certificate rather than trusting many
323 user/host keys. Note that OpenSSH certificates are a different, and much
324 simpler, format to the X.509 certificates used in ssl(8).
325
326 ssh-keygen supports two types of certificates: user and host. User cer-
327 tificates authenticate users to servers, whereas host certificates au-
328 thenticate server hosts to users. To generate a user certificate:
329
330 $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
331
332 The resultant certificate will be placed in /path/to/user_key_cert.pub.
333 A host certificate requires the -h option:
334
335 $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
336
337 The host certificate will be output to /path/to/host_key_cert.pub. In
338 both cases, key_id is a "key identifier" that is logged by the server
339 when the certificate is used for authentication.
340
341 Certificates may be limited to be valid for a set of principal (us-
342 er/host) names. By default, generated certificates are valid for all
343 users or hosts. To generate a certificate for a specified set of princi-
344 pals:
345
346 $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
347 $ ssh-keygen -s ca_key -I key_id -h -n host.domain $0
348
349 Additional limitations on the validity and use of user certificates may
350 be specified through certificate constraints. A constrained certificate
351 may disable features of the SSH session, may be valid only when presented
352 from particular source addresses or may force the use of a specific com-
353 mand. For a list of valid certificate constraints, see the documentation
354 for the -O option above.
355
356 Finally, certificates may be defined with a validity lifetime. The -V
357 option allows specification of certificate start and end times. A cer-
358 tificate that is presented at a time outside this range will not be con-
359 sidered valid. By default, certificates have a maximum validity inter-
360 val.
361
362 For certificates to be used for user or host authentication, the CA pub-
363 lic key must be trusted by sshd(8) or ssh(1). Please refer to those man-
364 ual pages for details.
365
224FILES 366FILES
225 ~/.ssh/identity 367 ~/.ssh/identity
226 Contains the protocol version 1 RSA authentication identity of 368 Contains the protocol version 1 RSA authentication identity of
227 the user. This file should not be readable by anyone but the us- 369 the user. This file should not be readable by anyone but the us-
228 er. It is possible to specify a passphrase when generating the 370 er. It is possible to specify a passphrase when generating the
229 key; that passphrase will be used to encrypt the private part of 371 key; that passphrase will be used to encrypt the private part of
230 this file using 3DES. This file is not automatically accessed by 372 this file using 128-bit AES. This file is not automatically ac-
231 ssh-keygen but it is offered as the default file for the private 373 cessed by ssh-keygen but it is offered as the default file for
232 key. ssh(1) will read this file when a login attempt is made. 374 the private key. ssh(1) will read this file when a login attempt
375 is made.
233 376
234 ~/.ssh/identity.pub 377 ~/.ssh/identity.pub
235 Contains the protocol version 1 RSA public key for authentica- 378 Contains the protocol version 1 RSA public key for authentica-
@@ -243,9 +386,10 @@ FILES
243 the user. This file should not be readable by anyone but the us- 386 the user. This file should not be readable by anyone but the us-
244 er. It is possible to specify a passphrase when generating the 387 er. It is possible to specify a passphrase when generating the
245 key; that passphrase will be used to encrypt the private part of 388 key; that passphrase will be used to encrypt the private part of
246 this file using 3DES. This file is not automatically accessed by 389 this file using 128-bit AES. This file is not automatically ac-
247 ssh-keygen but it is offered as the default file for the private 390 cessed by ssh-keygen but it is offered as the default file for
248 key. ssh(1) will read this file when a login attempt is made. 391 the private key. ssh(1) will read this file when a login attempt
392 is made.
249 393
250 ~/.ssh/id_dsa.pub 394 ~/.ssh/id_dsa.pub
251 Contains the protocol version 2 DSA public key for authentica- 395 Contains the protocol version 2 DSA public key for authentica-
@@ -259,9 +403,10 @@ FILES
259 the user. This file should not be readable by anyone but the us- 403 the user. This file should not be readable by anyone but the us-
260 er. It is possible to specify a passphrase when generating the 404 er. It is possible to specify a passphrase when generating the
261 key; that passphrase will be used to encrypt the private part of 405 key; that passphrase will be used to encrypt the private part of
262 this file using 3DES. This file is not automatically accessed by 406 this file using 128-bit AES. This file is not automatically ac-
263 ssh-keygen but it is offered as the default file for the private 407 cessed by ssh-keygen but it is offered as the default file for
264 key. ssh(1) will read this file when a login attempt is made. 408 the private key. ssh(1) will read this file when a login attempt
409 is made.
265 410
266 ~/.ssh/id_rsa.pub 411 ~/.ssh/id_rsa.pub
267 Contains the protocol version 2 RSA public key for authentica- 412 Contains the protocol version 2 RSA public key for authentica-
@@ -286,4 +431,4 @@ AUTHORS
286 created OpenSSH. Markus Friedl contributed the support for SSH protocol 431 created OpenSSH. Markus Friedl contributed the support for SSH protocol
287 versions 1.5 and 2.0. 432 versions 1.5 and 2.0.
288 433
289OpenBSD 4.6 July 24, 2008 5 434OpenBSD 4.6 March 8, 2010 7