1SSH-KEYGEN(1) BSD General Commands Manual SSH-KEYGEN(1)
2
4 ssh-keygen — authentication key generation, management and conversion
5
7 ssh-keygen [-q] [-b bits] [-C comment] [-f output_keyfile] [-m format]
8 [-N new_passphrase] [-t dsa | ecdsa | ed25519 | rsa]
9 ssh-keygen -p [-f keyfile] [-m format] [-N new_passphrase]
10 [-P old_passphrase]
11 ssh-keygen -i [-f input_keyfile] [-m key_format]
12 ssh-keygen -e [-f input_keyfile] [-m key_format]
13 ssh-keygen -y [-f input_keyfile]
14 ssh-keygen -c [-C comment] [-f keyfile] [-P passphrase]
15 ssh-keygen -l [-v] [-E fingerprint_hash] [-f input_keyfile]
16 ssh-keygen -B [-f input_keyfile]
17 ssh-keygen -D pkcs11
18 ssh-keygen -F hostname [-lv] [-f known_hosts_file]
19 ssh-keygen -H [-f known_hosts_file]
20 ssh-keygen -R hostname [-f known_hosts_file]
21 ssh-keygen -r hostname [-g] [-f input_keyfile]
22 ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point]
23 ssh-keygen -f input_file -T output_file [-v] [-a rounds] [-J num_lines]
24 [-j start_line] [-K checkpt] [-W generator]
25 ssh-keygen -I certificate_identity -s ca_key [-hU] [-D pkcs11_provider]
26 [-n principals] [-O option] [-V validity_interval]
27 [-z serial_number] file ...
28 ssh-keygen -L [-f input_keyfile]
29 ssh-keygen -A [-f prefix_path]
30 ssh-keygen -k -f krl_file [-u] [-s ca_public] [-z version_number]
31 file ...
32 ssh-keygen -Q -f krl_file file ...
33 ssh-keygen -Y check-novalidate -n namespace -s signature_file
34 ssh-keygen -Y sign -f key_file -n namespace file ...
35 ssh-keygen -Y verify -f allowed_signers_file -I signer_identity -n
36 namespace -s signature_file [-r revocation_file]
37
39 ssh-keygen generates, manages and converts authentication keys for
40 ssh(1). ssh-keygen can create keys for use by SSH protocol version 2.
41
42 The type of key to be generated is specified with the -t option. If
43 invoked without any arguments, ssh-keygen will generate an RSA key.
44
45 ssh-keygen is also used to generate groups for use in Diffie-Hellman
46 group exchange (DH-GEX). See the MODULI GENERATION section for details.
47
48 Finally, ssh-keygen can be used to generate and update Key Revocation
49 Lists, and to test whether given keys have been revoked by one. See the
50 KEY REVOCATION LISTS section for details.
51
52 Normally each user wishing to use SSH with public key authentication runs
53 this once to create the authentication key in ~/.ssh/id_dsa,
54 ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 or ~/.ssh/id_rsa. Additionally, the
55 system administrator may use this to generate host keys, as seen in
56 /etc/rc.
57
58 Normally this program generates the key and asks for a file in which to
59 store the private key. The public key is stored in a file with the same
60 name but “.pub” appended. The program also asks for a passphrase. The
61 passphrase may be empty to indicate no passphrase (host keys must have an
62 empty passphrase), or it may be a string of arbitrary length. A
63 passphrase is similar to a password, except it can be a phrase with a
64 series of words, punctuation, numbers, whitespace, or any string of char‐
65 acters you want. Good passphrases are 10-30 characters long, are not
66 simple sentences or otherwise easily guessable (English prose has only
67 1-2 bits of entropy per character, and provides very bad passphrases),
68 and contain a mix of upper and lowercase letters, numbers, and non-
69 alphanumeric characters. The passphrase can be changed later by using
70 the -p option.
71
72 There is no way to recover a lost passphrase. If the passphrase is lost
73 or forgotten, a new key must be generated and the corresponding public
74 key copied to other machines.
75
76 ssh-keygen will by default write keys in an OpenSSH-specific format.
77 This format is preferred as it offers better protection for keys at rest
78 as well as allowing storage of key comments within the private key file
79 itself. The key comment may be useful to help identify the key. The
80 comment is initialized to “user@host” when the key is created, but can be
81 changed using the -c option.
82
83 It is still possible for ssh-keygen to write the previously-used PEM for‐
84 mat private keys using the -m flag. This may be used when generating new
85 keys, and existing new-format keys may be converted using this option in
86 conjunction with the -p (change passphrase) flag.
87
88 After a key is generated, instructions below detail where the keys should
89 be placed to be activated.
90
91 The options are as follows:
92
93 -A For each of the key types (rsa, dsa, ecdsa and ed25519) for which
94 host keys do not exist, generate the host keys with the default
95 key file path, an empty passphrase, default bits for the key
96 type, and default comment. If -f has also been specified, its
97 argument is used as a prefix to the default path for the result‐
98 ing host key files. This is used by /etc/rc to generate new host
99 keys.
100
101 -a rounds
102 When saving a private key, this option specifies the number of
103 KDF (key derivation function) rounds used. Higher numbers result
104 in slower passphrase verification and increased resistance to
105 brute-force password cracking (should the keys be stolen).
106
107 When screening DH-GEX candidates (using the -T command), this
108 option specifies the number of primality tests to perform.
109
110 -B Show the bubblebabble digest of specified private or public key
111 file.
112
113 -b bits
114 Specifies the number of bits in the key to create. For RSA keys,
115 the minimum size is 1024 bits and the default is 3072 bits. Gen‐
116 erally, 3072 bits is considered sufficient. DSA keys must be
117 exactly 1024 bits as specified by FIPS 186-2. For ECDSA keys,
118 the -b flag determines the key length by selecting from one of
119 three elliptic curve sizes: 256, 384 or 521 bits. Attempting to
120 use bit lengths other than these three values for ECDSA keys will
121 fail. Ed25519 keys have a fixed length and the -b flag will be
122 ignored.
123
124 -C comment
125 Provides a new comment.
126
127 -c Requests changing the comment in the private and public key
128 files. The program will prompt for the file containing the pri‐
129 vate keys, for the passphrase if the key has one, and for the new
130 comment.
131
132 -D pkcs11
133 Download the public keys provided by the PKCS#11 shared library
134 pkcs11. When used in combination with -s, this option indicates
135 that a CA key resides in a PKCS#11 token (see the CERTIFICATES
136 section for details).
137
138 -E fingerprint_hash
139 Specifies the hash algorithm used when displaying key finger‐
140 prints. Valid options are: “md5” and “sha256”. The default is
141 “sha256”.
142
143 -e This option will read a private or public OpenSSH key file and
144 print to stdout a public key in one of the formats specified by
145 the -m option. The default export format is “RFC4716”. This
146 option allows exporting OpenSSH keys for use by other programs,
147 including several commercial SSH implementations.
148
149 -F hostname | [hostname]:port
150 Search for the specified hostname (with optional port number) in
151 a known_hosts file, listing any occurrences found. This option
152 is useful to find hashed host names or addresses and may also be
153 used in conjunction with the -H option to print found keys in a
154 hashed format.
155
156 -f filename
157 Specifies the filename of the key file.
158
159 -G output_file
160 Generate candidate primes for DH-GEX. These primes must be
161 screened for safety (using the -T option) before use.
162
163 -g Use generic DNS format when printing fingerprint resource records
164 using the -r command.
165
166 -H Hash a known_hosts file. This replaces all hostnames and
167 addresses with hashed representations within the specified file;
168 the original content is moved to a file with a .old suffix.
169 These hashes may be used normally by ssh and sshd, but they do
170 not reveal identifying information should the file's contents be
171 disclosed. This option will not modify existing hashed hostnames
172 and is therefore safe to use on files that mix hashed and non-
173 hashed names.
174
175 -h When signing a key, create a host certificate instead of a user
176 certificate. Please see the CERTIFICATES section for details.
177
178 -I certificate_identity
179 Specify the key identity when signing a public key. Please see
180 the CERTIFICATES section for details.
181
182 -i This option will read an unencrypted private (or public) key file
183 in the format specified by the -m option and print an OpenSSH
184 compatible private (or public) key to stdout. This option allows
185 importing keys from other software, including several commercial
186 SSH implementations. The default import format is “RFC4716”.
187
188 -J num_lines
189 Exit after screening the specified number of lines while perform‐
190 ing DH candidate screening using the -T option.
191
192 -j start_line
193 Start screening at the specified line number while performing DH
194 candidate screening using the -T option.
195
196 -K checkpt
197 Write the last line processed to the file checkpt while perform‐
198 ing DH candidate screening using the -T option. This will be
199 used to skip lines in the input file that have already been pro‐
200 cessed if the job is restarted.
201
202 -k Generate a KRL file. In this mode, ssh-keygen will generate a
203 KRL file at the location specified via the -f flag that revokes
204 every key or certificate presented on the command line.
205 Keys/certificates to be revoked may be specified by public key
206 file or using the format described in the KEY REVOCATION LISTS
207 section.
208
209 -L Prints the contents of one or more certificates.
210
211 -l Show fingerprint of specified public key file. For RSA and DSA
212 keys ssh-keygen tries to find the matching public key file and
213 prints its fingerprint. If combined with -v, a visual ASCII art
214 representation of the key is supplied with the fingerprint.
215
216 -M memory
217 Specify the amount of memory to use (in megabytes) when generat‐
218 ing candidate moduli for DH-GEX.
219
220 -m key_format
221 Specify a key format for key generation, the -i (import), -e
222 (export) conversion options, and the -p change passphrase opera‐
223 tion. The latter may be used to convert between OpenSSH private
224 key and PEM private key formats. The supported key formats are:
225 “RFC4716” (RFC 4716/SSH2 public or private key), “PKCS8” (PKCS8
226 public or private key) or “PEM” (PEM public key). By default
227 OpenSSH will write newly-generated private keys in its own for‐
228 mat, but when converting public keys for export the default for‐
229 mat is “RFC4716”. Setting a format of “PEM” when generating or
230 updating a supported private key type will cause the key to be
231 stored in the legacy PEM private key format.
232
233 -N new_passphrase
234 Provides the new passphrase.
235
236 -n principals
237 Specify one or more principals (user or host names) to be
238 included in a certificate when signing a key. Multiple princi‐
239 pals may be specified, separated by commas. Please see the
240 CERTIFICATES section for details.
241
242 -O option
243 Specify a certificate option when signing a key. This option may
244 be specified multiple times. See also the CERTIFICATES section
245 for further details.
246
247 At present, no standard options are valid for host keys. The
248 options that are valid for user certificates are:
249
250 clear Clear all enabled permissions. This is useful for clear‐
251 ing the default set of permissions so permissions may be
252 added individually.
253
254 critical:name[=contents]
255 extension:name[=contents]
256 Includes an arbitrary certificate critical option or
257 extension. The specified name should include a domain
258 suffix, e.g. “name@example.com”. If contents is speci‐
259 fied then it is included as the contents of the exten‐
260 sion/option encoded as a string, otherwise the exten‐
261 sion/option is created with no contents (usually indicat‐
262 ing a flag). Extensions may be ignored by a client or
263 server that does not recognise them, whereas unknown
264 critical options will cause the certificate to be
265 refused.
266
267 force-command=command
268 Forces the execution of command instead of any shell or
269 command specified by the user when the certificate is
270 used for authentication.
271
272 no-agent-forwarding
273 Disable ssh-agent(1) forwarding (permitted by default).
274
275 no-port-forwarding
276 Disable port forwarding (permitted by default).
277
278 no-pty Disable PTY allocation (permitted by default).
279
280 no-user-rc
281 Disable execution of ~/.ssh/rc by sshd(8) (permitted by
282 default).
283
284 no-x11-forwarding
285 Disable X11 forwarding (permitted by default).
286
287 permit-agent-forwarding
288 Allows ssh-agent(1) forwarding.
289
290 permit-port-forwarding
291 Allows port forwarding.
292
293 permit-pty
294 Allows PTY allocation.
295
296 permit-user-rc
297 Allows execution of ~/.ssh/rc by sshd(8).
298
299 permit-X11-forwarding
300 Allows X11 forwarding.
301
302 source-address=address_list
303 Restrict the source addresses from which the certificate
304 is considered valid. The address_list is a comma-sepa‐
305 rated list of one or more address/netmask pairs in CIDR
306 format.
307
308 -P passphrase
309 Provides the (old) passphrase.
310
311 -p Requests changing the passphrase of a private key file instead of
312 creating a new private key. The program will prompt for the file
313 containing the private key, for the old passphrase, and twice for
314 the new passphrase.
315
316 -Q Test whether keys have been revoked in a KRL.
317
318 -q Silence ssh-keygen.
319
320 -R hostname | [hostname]:port
321 Removes all keys belonging to the specified hostname (with
322 optional port number) from a known_hosts file. This option is
323 useful to delete hashed hosts (see the -H option above).
324
325 -r hostname
326 Print the SSHFP fingerprint resource record named hostname for
327 the specified public key file.
328
329 -S start
330 Specify start point (in hex) when generating candidate moduli for
331 DH-GEX.
332
333 -s ca_key
334 Certify (sign) a public key using the specified CA key. Please
335 see the CERTIFICATES section for details.
336
337 When generating a KRL, -s specifies a path to a CA public key
338 file used to revoke certificates directly by key ID or serial
339 number. See the KEY REVOCATION LISTS section for details.
340
341 -T output_file
342 Test DH group exchange candidate primes (generated using the -G
343 option) for safety.
344
345 -t dsa | ecdsa | ed25519 | rsa
346 Specifies the type of key to create. The possible values are
347 “dsa”, “ecdsa”, “ed25519”, or “rsa”.
348
349 This flag may also be used to specify the desired signature type
350 when signing certificates using an RSA CA key. The available RSA
351 signature variants are “ssh-rsa” (SHA1 signatures, not recom‐
352 mended), “rsa-sha2-256”, and “rsa-sha2-512” (the default).
353
354 -U When used in combination with -s, this option indicates that a CA
355 key resides in a ssh-agent(1). See the CERTIFICATES section for
356 more information.
357
358 -u Update a KRL. When specified with -k, keys listed via the com‐
359 mand line are added to the existing KRL rather than a new KRL
360 being created.
361
362 -V validity_interval
363 Specify a validity interval when signing a certificate. A valid‐
364 ity interval may consist of a single time, indicating that the
365 certificate is valid beginning now and expiring at that time, or
366 may consist of two times separated by a colon to indicate an
367 explicit time interval.
368
369 The start time may be specified as the string “always” to indi‐
370 cate the certificate has no specified start time, a date in
371 YYYYMMDD format, a time in YYYYMMDDHHMM[SS] format, a relative
372 time (to the current time) consisting of a minus sign followed by
373 an interval in the format described in the TIME FORMATS section
374 of sshd_config(5).
375
376 The end time may be specified as a YYYYMMDD date, a YYYYMMD‐
377 DHHMM[SS] time, a relative time starting with a plus character or
378 the string “forever” to indicate that the certificate has no
379 expirty date.
380
381 For example: “+52w1d” (valid from now to 52 weeks and one day
382 from now), “-4w:+4w” (valid from four weeks ago to four weeks
383 from now), “20100101123000:20110101123000” (valid from 12:30 PM,
384 January 1st, 2010 to 12:30 PM, January 1st, 2011), “-1d:20110101”
385 (valid from yesterday to midnight, January 1st, 2011).
386 “-1m:forever” (valid from one minute ago and never expiring).
387
388 -v Verbose mode. Causes ssh-keygen to print debugging messages
389 about its progress. This is helpful for debugging moduli genera‐
390 tion. Multiple -v options increase the verbosity. The maximum
391 is 3.
392
393 -W generator
394 Specify desired generator when testing candidate moduli for DH-
395 GEX.
396
397 -y This option will read a private OpenSSH format file and print an
398 OpenSSH public key to stdout.
399
400 -Y sign
401 Cryptographically sign a file or some data using a SSH key. When
402 signing, ssh-keygen accepts zero or more files to sign on the
403 command-line - if no files are specified then ssh-keygen will
404 sign data presented on standard input. Signatures are written to
405 the path of the input file with “.sig” appended, or to standard
406 output if the message to be signed was read from standard input.
407
408 The key used for signing is specified using the -f option and may
409 refer to either a private key, or a public key with the private
410 half available via ssh-agent(1). An additional signature names‐
411 pace, used to prevent signature confusion across different
412 domains of use (e.g. file signing vs email signing) must be pro‐
413 vided via the -n flag. Namespaces are arbitrary strings, and may
414 include: “file” for file signing, “email” for email signing. For
415 custom uses, it is recommended to use names following a NAMES‐
416 PACE@YOUR.DOMAIN pattern to generate unambiguous namespaces.
417
418 -Y verify
419 Request to verify a signature generated using ssh-keygen -Y sign
420 as described above. When verifying a signature, ssh-keygen
421 accepts a message on standard input and a signature namespace
422 using -n. A file containing the corresponding signature must
423 also be supplied using the -s flag, along with the identity of
424 the signer using -I and a list of allowed signers via the -f
425 flag. The format of the allowed signers file is documented in
426 the ALLOWED SIGNERS section below. A file containing revoked
427 keys can be passed using the -r flag. The revocation file may be
428 a KRL or a one-per-line list of public keys. Successful verifi‐
429 cation by an authorized signer is signalled by ssh-keygen
430
431 -Y check-novalidate
432 Checks that a signature generated using ssh-keygen -Y sign has a
433 valid structure. This does not validate if a signature comes
434 from an authorized signer. When testing a signature, ssh-keygen
435 accepts a message on standard input and a signature namespace
436 using -n. A file containing the corresponding signature must
437 also be supplied using the -s flag. Successful testing of the
438 signature is signalled by ssh-keygen returning a zero exit sta‐
439 tus.
440
441 -z serial_number
442 Specifies a serial number to be embedded in the certificate to
443 distinguish this certificate from others from the same CA. If
444 the serial_number is prefixed with a ‘+’ character, then the
445 serial number will be incremented for each certificate signed on
446 a single command-line. The default serial number is zero.
447
448 When generating a KRL, the -z flag is used to specify a KRL ver‐
449 sion number.
450
452 ssh-keygen may be used to generate groups for the Diffie-Hellman Group
453 Exchange (DH-GEX) protocol. Generating these groups is a two-step
454 process: first, candidate primes are generated using a fast, but memory
455 intensive process. These candidate primes are then tested for suitabil‐
456 ity (a CPU-intensive process).
457
458 Generation of primes is performed using the -G option. The desired
459 length of the primes may be specified by the -b option. For example:
460
461 # ssh-keygen -G moduli-2048.candidates -b 2048
462
463 By default, the search for primes begins at a random point in the desired
464 length range. This may be overridden using the -S option, which speci‐
465 fies a different start point (in hex).
466
467 Once a set of candidates have been generated, they must be screened for
468 suitability. This may be performed using the -T option. In this mode
469 ssh-keygen will read candidates from standard input (or a file specified
470 using the -f option). For example:
471
472 # ssh-keygen -T moduli-2048 -f moduli-2048.candidates
473
474 By default, each candidate will be subjected to 100 primality tests.
475 This may be overridden using the -a option. The DH generator value will
476 be chosen automatically for the prime under consideration. If a specific
477 generator is desired, it may be requested using the -W option. Valid
478 generator values are 2, 3, and 5.
479
480 Screened DH groups may be installed in /etc/gsissh/moduli. It is impor‐
481 tant that this file contains moduli of a range of bit lengths and that
482 both ends of a connection share common moduli.
483
485 ssh-keygen supports signing of keys to produce certificates that may be
486 used for user or host authentication. Certificates consist of a public
487 key, some identity information, zero or more principal (user or host)
488 names and a set of options that are signed by a Certification Authority
489 (CA) key. Clients or servers may then trust only the CA key and verify
490 its signature on a certificate rather than trusting many user/host keys.
491 Note that OpenSSH certificates are a different, and much simpler, format
492 to the X.509 certificates used in ssl(8).
493
494 ssh-keygen supports two types of certificates: user and host. User cer‐
495 tificates authenticate users to servers, whereas host certificates
496 authenticate server hosts to users. To generate a user certificate:
497
498 $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub
499
500 The resultant certificate will be placed in /path/to/user_key-cert.pub.
501 A host certificate requires the -h option:
502
503 $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub
504
505 The host certificate will be output to /path/to/host_key-cert.pub.
506
507 It is possible to sign using a CA key stored in a PKCS#11 token by pro‐
508 viding the token library using -D and identifying the CA key by providing
509 its public half as an argument to -s:
510
511 $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id user_key.pub
512
513 Similarly, it is possible for the CA key to be hosted in a ssh-agent(1).
514 This is indicated by the -U flag and, again, the CA key must be identi‐
515 fied by its public half.
516
517 $ ssh-keygen -Us ca_key.pub -I key_id user_key.pub
518
519 In all cases, key_id is a "key identifier" that is logged by the server
520 when the certificate is used for authentication.
521
522 Certificates may be limited to be valid for a set of principal
523 (user/host) names. By default, generated certificates are valid for all
524 users or hosts. To generate a certificate for a specified set of princi‐
525 pals:
526
527 $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub
528 $ ssh-keygen -s ca_key -I key_id -h -n host.domain host_key.pub
529
530 Additional limitations on the validity and use of user certificates may
531 be specified through certificate options. A certificate option may dis‐
532 able features of the SSH session, may be valid only when presented from
533 particular source addresses or may force the use of a specific command.
534 For a list of valid certificate options, see the documentation for the -O
535 option above.
536
537 Finally, certificates may be defined with a validity lifetime. The -V
538 option allows specification of certificate start and end times. A cer‐
539 tificate that is presented at a time outside this range will not be con‐
540 sidered valid. By default, certificates are valid from UNIX Epoch to the
541 distant future.
542
543 For certificates to be used for user or host authentication, the CA pub‐
544 lic key must be trusted by sshd(8) or ssh(1). Please refer to those man‐
545 ual pages for details.
546
548 ssh-keygen is able to manage OpenSSH format Key Revocation Lists (KRLs).
549 These binary files specify keys or certificates to be revoked using a
550 compact format, taking as little as one bit per certificate if they are
551 being revoked by serial number.
552
553 KRLs may be generated using the -k flag. This option reads one or more
554 files from the command line and generates a new KRL. The files may
555 either contain a KRL specification (see below) or public keys, listed one
556 per line. Plain public keys are revoked by listing their hash or con‐
557 tents in the KRL and certificates revoked by serial number or key ID (if
558 the serial is zero or not available).
559
560 Revoking keys using a KRL specification offers explicit control over the
561 types of record used to revoke keys and may be used to directly revoke
562 certificates by serial number or key ID without having the complete orig‐
563 inal certificate on hand. A KRL specification consists of lines contain‐
564 ing one of the following directives followed by a colon and some direc‐
565 tive-specific information.
566
567 serial: serial_number[-serial_number]
568 Revokes a certificate with the specified serial number. Serial
569 numbers are 64-bit values, not including zero and may be
570 expressed in decimal, hex or octal. If two serial numbers are
571 specified separated by a hyphen, then the range of serial numbers
572 including and between each is revoked. The CA key must have been
573 specified on the ssh-keygen command line using the -s option.
574
575 id: key_id
576 Revokes a certificate with the specified key ID string. The CA
577 key must have been specified on the ssh-keygen command line using
578 the -s option.
579
580 key: public_key
581 Revokes the specified key. If a certificate is listed, then it
582 is revoked as a plain public key.
583
584 sha1: public_key
585 Revokes the specified key by including its SHA1 hash in the KRL.
586
587 sha256: public_key
588 Revokes the specified key by including its SHA256 hash in the
589 KRL. KRLs that revoke keys by SHA256 hash are not supported by
590 OpenSSH versions prior to 7.9.
591
592 hash: fingerprint
593 Revokes a key using a fingerprint hash, as obtained from a
594 sshd(8) authentication log message or the ssh-keygen -l flag.
595 Only SHA256 fingerprints are supported here and resultant KRLs
596 are not supported by OpenSSH versions prior to 7.9.
597
598 KRLs may be updated using the -u flag in addition to -k. When this
599 option is specified, keys listed via the command line are merged into the
600 KRL, adding to those already there.
601
602 It is also possible, given a KRL, to test whether it revokes a particular
603 key (or keys). The -Q flag will query an existing KRL, testing each key
604 specified on the command line. If any key listed on the command line has
605 been revoked (or an error encountered) then ssh-keygen will exit with a
606 non-zero exit status. A zero exit status will only be returned if no key
607 was revoked.
608
610 When verifying signatures, ssh-keygen uses a simple list of identities
611 and keys to determine whether a signature comes from an authorized
612 source. This "allowed signers" file uses a format patterned after the
613 AUTHORIZED_KEYS FILE FORMAT described in sshd(8). Each line of the file
614 contains the following space-separated fields: principals, options, key‐
615 type, base64-encoded key. Empty lines and lines starting with a ‘#’ are
616 ignored as comments.
617
618 The principals field is a pattern-list (See PATTERNS in ssh_config(5))
619 consisting of one or more comma-separated USER@DOMAIN identity patterns
620 that are accepted for signing. When verifying, the identity presented
621 via the -I -option must match a principals pattern in order for the cor‐
622 responding key to be considered acceptable for verification.
623
624 The options (if present) consist of comma-separated option specifica‐
625 tions. No spaces are permitted, except within double quotes. The fol‐
626 lowing option specifications are supported (note that option keywords are
627 case-insensitive):
628
629 cert-authority
630 Indicates that this key is accepted as a certificate authority
631 (CA) and that certificates signed by this CA may be accepted for
632 verification.
633
634 namespaces="namespace-list"
635 Specifies a pattern-list of namespaces that are accepted for this
636 key. If this option is present, the signature namespace embedded
637 in the signature object and presented on the verification com‐
638 mand-line must match the specified list before the key will be
639 considered acceptable.
640
641 When verifying signatures made by certificates, the expected principal
642 name must match both the principals pattern in the allowed signers file
643 and the principals embedded in the certificate itself.
644
645 An example allowed signers file:
646
647 # Comments allowed at start of line
648 user1@example.com,user2@example.com ssh-rsa AAAAX1...
649 # A certificate authority, trusted for all principals in a domain.
650 *@example.com cert-authority ssh-ed25519 AAAB4...
651 # A key that is accepted only for file signing.
652 user2@example.com namespaces="file" ssh-ed25519 AAA41...
653
655 ~/.ssh/id_dsa
656 ~/.ssh/id_ecdsa
657 ~/.ssh/id_ed25519
658 ~/.ssh/id_rsa
659 Contains the DSA, ECDSA, Ed25519 or RSA authentication identity
660 of the user. This file should not be readable by anyone but the
661 user. It is possible to specify a passphrase when generating the
662 key; that passphrase will be used to encrypt the private part of
663 this file using 128-bit AES. This file is not automatically
664 accessed by ssh-keygen but it is offered as the default file for
665 the private key. ssh(1) will read this file when a login attempt
666 is made.
667
668 ~/.ssh/id_dsa.pub
669 ~/.ssh/id_ecdsa.pub
670 ~/.ssh/id_ed25519.pub
671 ~/.ssh/id_rsa.pub
672 Contains the DSA, ECDSA, Ed25519 or RSA public key for authenti‐
673 cation. The contents of this file should be added to
674 ~/.ssh/authorized_keys on all machines where the user wishes to
675 log in using public key authentication. There is no need to keep
676 the contents of this file secret.
677
678 /etc/gsissh/moduli
679 Contains Diffie-Hellman groups used for DH-GEX. The file format
680 is described in moduli(5).
681
683 ssh(1), ssh-add(1), ssh-agent(1), moduli(5), sshd(8)
684
685 The Secure Shell (SSH) Public Key File Format, RFC 4716, 2006.
686
688 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
689 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
690 de Raadt and Dug Song removed many bugs, re-added newer features and cre‐
691 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
692 versions 1.5 and 2.0.
693
694BSD December 31, 2019 BSD