1*6888a9beSDag-Erling Smørgrav.\" $OpenBSD: ssh-keygen.1,v 1.115 2013/01/19 07:13:25 jmc Exp $ 2cce7d346SDag-Erling Smørgrav.\" $FreeBSD$ 31e8db6e2SBrian Feldman.\" 4511b41d2SMark Murray.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 5511b41d2SMark Murray.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 6511b41d2SMark Murray.\" All rights reserved 7511b41d2SMark Murray.\" 8b66f2d16SKris Kennaway.\" As far as I am concerned, the code I have written for this software 9b66f2d16SKris Kennaway.\" can be used freely for any purpose. Any derived versions of this 10b66f2d16SKris Kennaway.\" software must be clearly marked as such, and if the derived work is 11b66f2d16SKris Kennaway.\" incompatible with the protocol description in the RFC file, it must be 12b66f2d16SKris Kennaway.\" called by a name other than "ssh" or "Secure Shell". 13511b41d2SMark Murray.\" 14b66f2d16SKris Kennaway.\" 15b66f2d16SKris Kennaway.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved. 16b66f2d16SKris Kennaway.\" Copyright (c) 1999 Aaron Campbell. All rights reserved. 17b66f2d16SKris Kennaway.\" Copyright (c) 1999 Theo de Raadt. All rights reserved. 18b66f2d16SKris Kennaway.\" 19b66f2d16SKris Kennaway.\" Redistribution and use in source and binary forms, with or without 20b66f2d16SKris Kennaway.\" modification, are permitted provided that the following conditions 21b66f2d16SKris Kennaway.\" are met: 22b66f2d16SKris Kennaway.\" 1. Redistributions of source code must retain the above copyright 23b66f2d16SKris Kennaway.\" notice, this list of conditions and the following disclaimer. 24b66f2d16SKris Kennaway.\" 2. Redistributions in binary form must reproduce the above copyright 25b66f2d16SKris Kennaway.\" notice, this list of conditions and the following disclaimer in the 26b66f2d16SKris Kennaway.\" documentation and/or other materials provided with the distribution. 27b66f2d16SKris Kennaway.\" 28b66f2d16SKris Kennaway.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 29b66f2d16SKris Kennaway.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 30b66f2d16SKris Kennaway.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 31b66f2d16SKris Kennaway.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 32b66f2d16SKris Kennaway.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 33b66f2d16SKris Kennaway.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34b66f2d16SKris Kennaway.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35b66f2d16SKris Kennaway.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36b66f2d16SKris Kennaway.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 37b66f2d16SKris Kennaway.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38511b41d2SMark Murray.\" 39*6888a9beSDag-Erling Smørgrav.Dd January 19, 2013 40511b41d2SMark Murray.Dt SSH-KEYGEN 1 41511b41d2SMark Murray.Os 42511b41d2SMark Murray.Sh NAME 43511b41d2SMark Murray.Nm ssh-keygen 441e8db6e2SBrian Feldman.Nd authentication key generation, management and conversion 45511b41d2SMark Murray.Sh SYNOPSIS 46d0c8c0bcSDag-Erling Smørgrav.Bk -words 47e2f6069cSDag-Erling Smørgrav.Nm ssh-keygen 481e8db6e2SBrian Feldman.Op Fl q 49511b41d2SMark Murray.Op Fl b Ar bits 50ae1f160dSDag-Erling Smørgrav.Fl t Ar type 51511b41d2SMark Murray.Op Fl N Ar new_passphrase 52511b41d2SMark Murray.Op Fl C Ar comment 53b66f2d16SKris Kennaway.Op Fl f Ar output_keyfile 54511b41d2SMark Murray.Nm ssh-keygen 55511b41d2SMark Murray.Fl p 56511b41d2SMark Murray.Op Fl P Ar old_passphrase 57511b41d2SMark Murray.Op Fl N Ar new_passphrase 58511b41d2SMark Murray.Op Fl f Ar keyfile 59511b41d2SMark Murray.Nm ssh-keygen 601e8db6e2SBrian Feldman.Fl i 61e2f6069cSDag-Erling Smørgrav.Op Fl m Ar key_format 62b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile 63a04a10f8SKris Kennaway.Nm ssh-keygen 641e8db6e2SBrian Feldman.Fl e 65e2f6069cSDag-Erling Smørgrav.Op Fl m Ar key_format 66b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile 67a04a10f8SKris Kennaway.Nm ssh-keygen 68a04a10f8SKris Kennaway.Fl y 69b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile 70a04a10f8SKris Kennaway.Nm ssh-keygen 71511b41d2SMark Murray.Fl c 72511b41d2SMark Murray.Op Fl P Ar passphrase 73511b41d2SMark Murray.Op Fl C Ar comment 74511b41d2SMark Murray.Op Fl f Ar keyfile 75511b41d2SMark Murray.Nm ssh-keygen 76511b41d2SMark Murray.Fl l 77b66f2d16SKris Kennaway.Op Fl f Ar input_keyfile 78a04a10f8SKris Kennaway.Nm ssh-keygen 791e8db6e2SBrian Feldman.Fl B 801e8db6e2SBrian Feldman.Op Fl f Ar input_keyfile 81ae1f160dSDag-Erling Smørgrav.Nm ssh-keygen 82b15c8340SDag-Erling Smørgrav.Fl D Ar pkcs11 83ae1f160dSDag-Erling Smørgrav.Nm ssh-keygen 845e8dbd04SDag-Erling Smørgrav.Fl F Ar hostname 855e8dbd04SDag-Erling Smørgrav.Op Fl f Ar known_hosts_file 86cce7d346SDag-Erling Smørgrav.Op Fl l 875e8dbd04SDag-Erling Smørgrav.Nm ssh-keygen 885e8dbd04SDag-Erling Smørgrav.Fl H 895e8dbd04SDag-Erling Smørgrav.Op Fl f Ar known_hosts_file 905e8dbd04SDag-Erling Smørgrav.Nm ssh-keygen 915e8dbd04SDag-Erling Smørgrav.Fl R Ar hostname 925e8dbd04SDag-Erling Smørgrav.Op Fl f Ar known_hosts_file 935e8dbd04SDag-Erling Smørgrav.Nm ssh-keygen 94d95e11bfSDag-Erling Smørgrav.Fl r Ar hostname 95d95e11bfSDag-Erling Smørgrav.Op Fl f Ar input_keyfile 96d95e11bfSDag-Erling Smørgrav.Op Fl g 97d95e11bfSDag-Erling Smørgrav.Nm ssh-keygen 98d95e11bfSDag-Erling Smørgrav.Fl G Ar output_file 99efcad6b7SDag-Erling Smørgrav.Op Fl v 100d95e11bfSDag-Erling Smørgrav.Op Fl b Ar bits 101d95e11bfSDag-Erling Smørgrav.Op Fl M Ar memory 102d95e11bfSDag-Erling Smørgrav.Op Fl S Ar start_point 103d95e11bfSDag-Erling Smørgrav.Nm ssh-keygen 104d95e11bfSDag-Erling Smørgrav.Fl T Ar output_file 105d95e11bfSDag-Erling Smørgrav.Fl f Ar input_file 106efcad6b7SDag-Erling Smørgrav.Op Fl v 107d95e11bfSDag-Erling Smørgrav.Op Fl a Ar num_trials 108462c32cbSDag-Erling Smørgrav.Op Fl J Ar num_lines 109462c32cbSDag-Erling Smørgrav.Op Fl j Ar start_line 110462c32cbSDag-Erling Smørgrav.Op Fl K Ar checkpt 111d95e11bfSDag-Erling Smørgrav.Op Fl W Ar generator 112b15c8340SDag-Erling Smørgrav.Nm ssh-keygen 113b15c8340SDag-Erling Smørgrav.Fl s Ar ca_key 114b15c8340SDag-Erling Smørgrav.Fl I Ar certificate_identity 115b15c8340SDag-Erling Smørgrav.Op Fl h 116b15c8340SDag-Erling Smørgrav.Op Fl n Ar principals 117e2f6069cSDag-Erling Smørgrav.Op Fl O Ar option 118b15c8340SDag-Erling Smørgrav.Op Fl V Ar validity_interval 119e2f6069cSDag-Erling Smørgrav.Op Fl z Ar serial_number 120b15c8340SDag-Erling Smørgrav.Ar 121b15c8340SDag-Erling Smørgrav.Nm ssh-keygen 122b15c8340SDag-Erling Smørgrav.Fl L 123b15c8340SDag-Erling Smørgrav.Op Fl f Ar input_keyfile 124e146993eSDag-Erling Smørgrav.Nm ssh-keygen 125e146993eSDag-Erling Smørgrav.Fl A 126*6888a9beSDag-Erling Smørgrav.Nm ssh-keygen 127*6888a9beSDag-Erling Smørgrav.Fl k 128*6888a9beSDag-Erling Smørgrav.Fl f Ar krl_file 129*6888a9beSDag-Erling Smørgrav.Op Fl u 130*6888a9beSDag-Erling Smørgrav.Op Fl s Ar ca_public 131*6888a9beSDag-Erling Smørgrav.Op Fl z Ar version_number 132*6888a9beSDag-Erling Smørgrav.Ar 133*6888a9beSDag-Erling Smørgrav.Nm ssh-keygen 134*6888a9beSDag-Erling Smørgrav.Fl Q 135*6888a9beSDag-Erling Smørgrav.Fl f Ar krl_file 136*6888a9beSDag-Erling Smørgrav.Ar 137b15c8340SDag-Erling Smørgrav.Ek 138511b41d2SMark Murray.Sh DESCRIPTION 139511b41d2SMark Murray.Nm 1401e8db6e2SBrian Feldmangenerates, manages and converts authentication keys for 141511b41d2SMark Murray.Xr ssh 1 . 142a04a10f8SKris Kennaway.Nm 1434a421b63SDag-Erling Smørgravcan create RSA keys for use by SSH protocol version 1 and DSA, ECDSA or RSA 144d95e11bfSDag-Erling Smørgravkeys for use by SSH protocol version 2. 145d95e11bfSDag-Erling SmørgravThe type of key to be generated is specified with the 1461e8db6e2SBrian Feldman.Fl t 147ae1f160dSDag-Erling Smørgravoption. 148021d409fSDag-Erling SmørgravIf invoked without any arguments, 149021d409fSDag-Erling Smørgrav.Nm 150021d409fSDag-Erling Smørgravwill generate an RSA key for use in SSH protocol 2 connections. 151a04a10f8SKris Kennaway.Pp 152d95e11bfSDag-Erling Smørgrav.Nm 153d95e11bfSDag-Erling Smørgravis also used to generate groups for use in Diffie-Hellman group 154d95e11bfSDag-Erling Smørgravexchange (DH-GEX). 155d95e11bfSDag-Erling SmørgravSee the 156d95e11bfSDag-Erling Smørgrav.Sx MODULI GENERATION 157d95e11bfSDag-Erling Smørgravsection for details. 158d95e11bfSDag-Erling Smørgrav.Pp 159*6888a9beSDag-Erling SmørgravFinally, 160*6888a9beSDag-Erling Smørgrav.Nm 161*6888a9beSDag-Erling Smørgravcan be used to generate and update Key Revocation Lists, and to test whether 162*6888a9beSDag-Erling Smørgravgiven keys have been revoked by one. 163*6888a9beSDag-Erling SmørgravSee the 164*6888a9beSDag-Erling Smørgrav.Sx KEY REVOCATION LISTS 165*6888a9beSDag-Erling Smørgravsection for details. 166*6888a9beSDag-Erling Smørgrav.Pp 167511b41d2SMark MurrayNormally each user wishing to use SSH 1684a421b63SDag-Erling Smørgravwith public key authentication runs this once to create the authentication 169511b41d2SMark Murraykey in 170043840dfSDag-Erling Smørgrav.Pa ~/.ssh/identity , 1714a421b63SDag-Erling Smørgrav.Pa ~/.ssh/id_ecdsa , 172043840dfSDag-Erling Smørgrav.Pa ~/.ssh/id_dsa 173a04a10f8SKris Kennawayor 174043840dfSDag-Erling Smørgrav.Pa ~/.ssh/id_rsa . 175a04a10f8SKris KennawayAdditionally, the system administrator may use this to generate host keys, 176a04a10f8SKris Kennawayas seen in 177a04a10f8SKris Kennaway.Pa /etc/rc . 178511b41d2SMark Murray.Pp 179511b41d2SMark MurrayNormally this program generates the key and asks for a file in which 180a8f6863aSKris Kennawayto store the private key. 181a8f6863aSKris KennawayThe public key is stored in a file with the same name but 182511b41d2SMark Murray.Dq .pub 183a8f6863aSKris Kennawayappended. 184a8f6863aSKris KennawayThe program also asks for a passphrase. 185a8f6863aSKris KennawayThe passphrase may be empty to indicate no passphrase 1861e8db6e2SBrian Feldman(host keys must have an empty passphrase), or it may be a string of 187a8f6863aSKris Kennawayarbitrary length. 188ae1f160dSDag-Erling SmørgravA passphrase is similar to a password, except it can be a phrase with a 189ae1f160dSDag-Erling Smørgravseries of words, punctuation, numbers, whitespace, or any string of 190ae1f160dSDag-Erling Smørgravcharacters you want. 191ae1f160dSDag-Erling SmørgravGood passphrases are 10-30 characters long, are 192511b41d2SMark Murraynot simple sentences or otherwise easily guessable (English 193ae1f160dSDag-Erling Smørgravprose has only 1-2 bits of entropy per character, and provides very bad 194ae1f160dSDag-Erling Smørgravpassphrases), and contain a mix of upper and lowercase letters, 195ae1f160dSDag-Erling Smørgravnumbers, and non-alphanumeric characters. 196a8f6863aSKris KennawayThe passphrase can be changed later by using the 197511b41d2SMark Murray.Fl p 198511b41d2SMark Murrayoption. 199511b41d2SMark Murray.Pp 200a8f6863aSKris KennawayThere is no way to recover a lost passphrase. 201e146993eSDag-Erling SmørgravIf the passphrase is lost or forgotten, a new key must be generated 202e146993eSDag-Erling Smørgravand the corresponding public key copied to other machines. 203511b41d2SMark Murray.Pp 2041e8db6e2SBrian FeldmanFor RSA1 keys, 2051e8db6e2SBrian Feldmanthere is also a comment field in the key file that is only for 206a8f6863aSKris Kennawayconvenience to the user to help identify the key. 207a8f6863aSKris KennawayThe comment can tell what the key is for, or whatever is useful. 208a8f6863aSKris KennawayThe comment is initialized to 209511b41d2SMark Murray.Dq user@host 210511b41d2SMark Murraywhen the key is created, but can be changed using the 211511b41d2SMark Murray.Fl c 212511b41d2SMark Murrayoption. 213511b41d2SMark Murray.Pp 214a04a10f8SKris KennawayAfter a key is generated, instructions below detail where the keys 215a04a10f8SKris Kennawayshould be placed to be activated. 216a04a10f8SKris Kennaway.Pp 217511b41d2SMark MurrayThe options are as follows: 218511b41d2SMark Murray.Bl -tag -width Ds 219e146993eSDag-Erling Smørgrav.It Fl A 220e146993eSDag-Erling SmørgravFor each of the key types (rsa1, rsa, dsa and ecdsa) for which host keys 221e146993eSDag-Erling Smørgravdo not exist, generate the host keys with the default key file path, 222e146993eSDag-Erling Smørgravan empty passphrase, default bits for the key type, and default comment. 223e146993eSDag-Erling SmørgravThis is used by 224e146993eSDag-Erling Smørgrav.Pa /etc/rc 225e146993eSDag-Erling Smørgravto generate new host keys. 226d95e11bfSDag-Erling Smørgrav.It Fl a Ar trials 227d95e11bfSDag-Erling SmørgravSpecifies the number of primality tests to perform when screening DH-GEX 228d95e11bfSDag-Erling Smørgravcandidates using the 229d95e11bfSDag-Erling Smørgrav.Fl T 230d95e11bfSDag-Erling Smørgravcommand. 2315e8dbd04SDag-Erling Smørgrav.It Fl B 2325e8dbd04SDag-Erling SmørgravShow the bubblebabble digest of specified private or public key file. 233511b41d2SMark Murray.It Fl b Ar bits 234a8f6863aSKris KennawaySpecifies the number of bits in the key to create. 235021d409fSDag-Erling SmørgravFor RSA keys, the minimum size is 768 bits and the default is 2048 bits. 236043840dfSDag-Erling SmørgravGenerally, 2048 bits is considered sufficient. 237021d409fSDag-Erling SmørgravDSA keys must be exactly 1024 bits as specified by FIPS 186-2. 238e146993eSDag-Erling SmørgravFor ECDSA keys, the 239e146993eSDag-Erling Smørgrav.Fl b 240462c32cbSDag-Erling Smørgravflag determines the key length by selecting from one of three elliptic 241e146993eSDag-Erling Smørgravcurve sizes: 256, 384 or 521 bits. 242e146993eSDag-Erling SmørgravAttempting to use bit lengths other than these three values for ECDSA keys 243e146993eSDag-Erling Smørgravwill fail. 2445e8dbd04SDag-Erling Smørgrav.It Fl C Ar comment 2455e8dbd04SDag-Erling SmørgravProvides a new comment. 246511b41d2SMark Murray.It Fl c 247511b41d2SMark MurrayRequests changing the comment in the private and public key files. 248ae1f160dSDag-Erling SmørgravThis operation is only supported for RSA1 keys. 249511b41d2SMark MurrayThe program will prompt for the file containing the private keys, for 250ae1f160dSDag-Erling Smørgravthe passphrase if the key has one, and for the new comment. 251b15c8340SDag-Erling Smørgrav.It Fl D Ar pkcs11 252b15c8340SDag-Erling SmørgravDownload the RSA public keys provided by the PKCS#11 shared library 253b15c8340SDag-Erling Smørgrav.Ar pkcs11 . 254e2f6069cSDag-Erling SmørgravWhen used in combination with 255e2f6069cSDag-Erling Smørgrav.Fl s , 256e2f6069cSDag-Erling Smørgravthis option indicates that a CA key resides in a PKCS#11 token (see the 257e2f6069cSDag-Erling Smørgrav.Sx CERTIFICATES 258e2f6069cSDag-Erling Smørgravsection for details). 2591e8db6e2SBrian Feldman.It Fl e 2601e8db6e2SBrian FeldmanThis option will read a private or public OpenSSH key file and 261e2f6069cSDag-Erling Smørgravprint to stdout the key in one of the formats specified by the 262e2f6069cSDag-Erling Smørgrav.Fl m 263e2f6069cSDag-Erling Smørgravoption. 264e2f6069cSDag-Erling SmørgravThe default export format is 265e2f6069cSDag-Erling Smørgrav.Dq RFC4716 . 266e2f6069cSDag-Erling SmørgravThis option allows exporting OpenSSH keys for use by other programs, including 267e2f6069cSDag-Erling Smørgravseveral commercial SSH implementations. 2685e8dbd04SDag-Erling Smørgrav.It Fl F Ar hostname 2695e8dbd04SDag-Erling SmørgravSearch for the specified 2705e8dbd04SDag-Erling Smørgrav.Ar hostname 2715e8dbd04SDag-Erling Smørgravin a 2725e8dbd04SDag-Erling Smørgrav.Pa known_hosts 2735e8dbd04SDag-Erling Smørgravfile, listing any occurrences found. 2745e8dbd04SDag-Erling SmørgravThis option is useful to find hashed host names or addresses and may also be 2755e8dbd04SDag-Erling Smørgravused in conjunction with the 2765e8dbd04SDag-Erling Smørgrav.Fl H 2775e8dbd04SDag-Erling Smørgravoption to print found keys in a hashed format. 2785e8dbd04SDag-Erling Smørgrav.It Fl f Ar filename 2795e8dbd04SDag-Erling SmørgravSpecifies the filename of the key file. 2805e8dbd04SDag-Erling Smørgrav.It Fl G Ar output_file 2815e8dbd04SDag-Erling SmørgravGenerate candidate primes for DH-GEX. 2825e8dbd04SDag-Erling SmørgravThese primes must be screened for 2835e8dbd04SDag-Erling Smørgravsafety (using the 2845e8dbd04SDag-Erling Smørgrav.Fl T 2855e8dbd04SDag-Erling Smørgravoption) before use. 286d95e11bfSDag-Erling Smørgrav.It Fl g 287d74d50a8SDag-Erling SmørgravUse generic DNS format when printing fingerprint resource records using the 288d74d50a8SDag-Erling Smørgrav.Fl r 289d74d50a8SDag-Erling Smørgravcommand. 2905e8dbd04SDag-Erling Smørgrav.It Fl H 2915e8dbd04SDag-Erling SmørgravHash a 2925e8dbd04SDag-Erling Smørgrav.Pa known_hosts 2934518870cSDag-Erling Smørgravfile. 2944518870cSDag-Erling SmørgravThis replaces all hostnames and addresses with hashed representations 2954518870cSDag-Erling Smørgravwithin the specified file; the original content is moved to a file with 2964518870cSDag-Erling Smørgrava .old suffix. 2975e8dbd04SDag-Erling SmørgravThese hashes may be used normally by 2985e8dbd04SDag-Erling Smørgrav.Nm ssh 2995e8dbd04SDag-Erling Smørgravand 3005e8dbd04SDag-Erling Smørgrav.Nm sshd , 3015e8dbd04SDag-Erling Smørgravbut they do not reveal identifying information should the file's contents 3025e8dbd04SDag-Erling Smørgravbe disclosed. 3035e8dbd04SDag-Erling SmørgravThis option will not modify existing hashed hostnames and is therefore safe 3045e8dbd04SDag-Erling Smørgravto use on files that mix hashed and non-hashed names. 305b15c8340SDag-Erling Smørgrav.It Fl h 306b15c8340SDag-Erling SmørgravWhen signing a key, create a host certificate instead of a user 307b15c8340SDag-Erling Smørgravcertificate. 308b15c8340SDag-Erling SmørgravPlease see the 309b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES 310b15c8340SDag-Erling Smørgravsection for details. 311b15c8340SDag-Erling Smørgrav.It Fl I Ar certificate_identity 312b15c8340SDag-Erling SmørgravSpecify the key identity when signing a public key. 313b15c8340SDag-Erling SmørgravPlease see the 314b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES 315b15c8340SDag-Erling Smørgravsection for details. 3161e8db6e2SBrian Feldman.It Fl i 3171e8db6e2SBrian FeldmanThis option will read an unencrypted private (or public) key file 318e2f6069cSDag-Erling Smørgravin the format specified by the 319e2f6069cSDag-Erling Smørgrav.Fl m 320e2f6069cSDag-Erling Smørgravoption and print an OpenSSH compatible private 3211e8db6e2SBrian Feldman(or public) key to stdout. 322462c32cbSDag-Erling Smørgrav.It Fl J Ar num_lines 323462c32cbSDag-Erling SmørgravExit after screening the specified number of lines 324462c32cbSDag-Erling Smørgravwhile performing DH candidate screening using the 325462c32cbSDag-Erling Smørgrav.Fl T 326462c32cbSDag-Erling Smørgravoption. 327462c32cbSDag-Erling Smørgrav.It Fl j Ar start_line 328462c32cbSDag-Erling SmørgravStart screening at the specified line number 329462c32cbSDag-Erling Smørgravwhile performing DH candidate screening using the 330462c32cbSDag-Erling Smørgrav.Fl T 331462c32cbSDag-Erling Smørgravoption. 332462c32cbSDag-Erling Smørgrav.It Fl K Ar checkpt 333462c32cbSDag-Erling SmørgravWrite the last line processed to the file 334462c32cbSDag-Erling Smørgrav.Ar checkpt 335462c32cbSDag-Erling Smørgravwhile performing DH candidate screening using the 336462c32cbSDag-Erling Smørgrav.Fl T 337462c32cbSDag-Erling Smørgravoption. 338462c32cbSDag-Erling SmørgravThis will be used to skip lines in the input file that have already been 339462c32cbSDag-Erling Smørgravprocessed if the job is restarted. 340e2f6069cSDag-Erling SmørgravThis option allows importing keys from other software, including several 341e2f6069cSDag-Erling Smørgravcommercial SSH implementations. 342e2f6069cSDag-Erling SmørgravThe default import format is 343e2f6069cSDag-Erling Smørgrav.Dq RFC4716 . 344*6888a9beSDag-Erling Smørgrav.It Fl k 345*6888a9beSDag-Erling SmørgravGenerate a KRL file. 346*6888a9beSDag-Erling SmørgravIn this mode, 347*6888a9beSDag-Erling Smørgrav.Nm 348*6888a9beSDag-Erling Smørgravwill generate a KRL file at the location specified via the 349*6888a9beSDag-Erling Smørgrav.Fl f 350*6888a9beSDag-Erling Smørgravflag that revokes every key or certificate presented on the command line. 351*6888a9beSDag-Erling SmørgravKeys/certificates to be revoked may be specified by public key file or 352*6888a9beSDag-Erling Smørgravusing the format described in the 353*6888a9beSDag-Erling Smørgrav.Sx KEY REVOCATION LISTS 354*6888a9beSDag-Erling Smørgravsection. 355b15c8340SDag-Erling Smørgrav.It Fl L 356b15c8340SDag-Erling SmørgravPrints the contents of a certificate. 357511b41d2SMark Murray.It Fl l 358ae1f160dSDag-Erling SmørgravShow fingerprint of specified public key file. 359ae1f160dSDag-Erling SmørgravPrivate RSA1 keys are also supported. 360ae1f160dSDag-Erling SmørgravFor RSA and DSA keys 361ae1f160dSDag-Erling Smørgrav.Nm 362ae1f160dSDag-Erling Smørgravtries to find the matching public key file and prints its fingerprint. 363d4af9e69SDag-Erling SmørgravIf combined with 364d4af9e69SDag-Erling Smørgrav.Fl v , 365d4af9e69SDag-Erling Smørgravan ASCII art representation of the key is supplied with the fingerprint. 3665e8dbd04SDag-Erling Smørgrav.It Fl M Ar memory 3675e8dbd04SDag-Erling SmørgravSpecify the amount of memory to use (in megabytes) when generating 3685e8dbd04SDag-Erling Smørgravcandidate moduli for DH-GEX. 369e2f6069cSDag-Erling Smørgrav.It Fl m Ar key_format 370e2f6069cSDag-Erling SmørgravSpecify a key format for the 371e2f6069cSDag-Erling Smørgrav.Fl i 372e2f6069cSDag-Erling Smørgrav(import) or 373e2f6069cSDag-Erling Smørgrav.Fl e 374e2f6069cSDag-Erling Smørgrav(export) conversion options. 375e2f6069cSDag-Erling SmørgravThe supported key formats are: 376e2f6069cSDag-Erling Smørgrav.Dq RFC4716 377e2f6069cSDag-Erling Smørgrav(RFC 4716/SSH2 public or private key), 378e2f6069cSDag-Erling Smørgrav.Dq PKCS8 379e2f6069cSDag-Erling Smørgrav(PEM PKCS8 public key) 380e2f6069cSDag-Erling Smørgravor 381e2f6069cSDag-Erling Smørgrav.Dq PEM 382e2f6069cSDag-Erling Smørgrav(PEM public key). 383e2f6069cSDag-Erling SmørgravThe default conversion format is 384e2f6069cSDag-Erling Smørgrav.Dq RFC4716 . 3855e8dbd04SDag-Erling Smørgrav.It Fl N Ar new_passphrase 3865e8dbd04SDag-Erling SmørgravProvides the new passphrase. 387b15c8340SDag-Erling Smørgrav.It Fl n Ar principals 388b15c8340SDag-Erling SmørgravSpecify one or more principals (user or host names) to be included in 389b15c8340SDag-Erling Smørgrava certificate when signing a key. 390b15c8340SDag-Erling SmørgravMultiple principals may be specified, separated by commas. 391b15c8340SDag-Erling SmørgravPlease see the 392b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES 393b15c8340SDag-Erling Smørgravsection for details. 394e2f6069cSDag-Erling Smørgrav.It Fl O Ar option 395e2f6069cSDag-Erling SmørgravSpecify a certificate option when signing a key. 396b15c8340SDag-Erling SmørgravThis option may be specified multiple times. 397b15c8340SDag-Erling SmørgravPlease see the 398b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES 399b15c8340SDag-Erling Smørgravsection for details. 400e2f6069cSDag-Erling SmørgravThe options that are valid for user certificates are: 401b15c8340SDag-Erling Smørgrav.Bl -tag -width Ds 4028ad9b54aSDag-Erling Smørgrav.It Ic clear 4038ad9b54aSDag-Erling SmørgravClear all enabled permissions. 4048ad9b54aSDag-Erling SmørgravThis is useful for clearing the default set of permissions so permissions may 4058ad9b54aSDag-Erling Smørgravbe added individually. 4068ad9b54aSDag-Erling Smørgrav.It Ic force-command Ns = Ns Ar command 4078ad9b54aSDag-Erling SmørgravForces the execution of 4088ad9b54aSDag-Erling Smørgrav.Ar command 4098ad9b54aSDag-Erling Smørgravinstead of any shell or command specified by the user when 4108ad9b54aSDag-Erling Smørgravthe certificate is used for authentication. 411b15c8340SDag-Erling Smørgrav.It Ic no-agent-forwarding 412b15c8340SDag-Erling SmørgravDisable 413b15c8340SDag-Erling Smørgrav.Xr ssh-agent 1 414b15c8340SDag-Erling Smørgravforwarding (permitted by default). 415b15c8340SDag-Erling Smørgrav.It Ic no-port-forwarding 416b15c8340SDag-Erling SmørgravDisable port forwarding (permitted by default). 417b15c8340SDag-Erling Smørgrav.It Ic no-pty 418b15c8340SDag-Erling SmørgravDisable PTY allocation (permitted by default). 419b15c8340SDag-Erling Smørgrav.It Ic no-user-rc 420b15c8340SDag-Erling SmørgravDisable execution of 421b15c8340SDag-Erling Smørgrav.Pa ~/.ssh/rc 422b15c8340SDag-Erling Smørgravby 423b15c8340SDag-Erling Smørgrav.Xr sshd 8 424b15c8340SDag-Erling Smørgrav(permitted by default). 4258ad9b54aSDag-Erling Smørgrav.It Ic no-x11-forwarding 4268ad9b54aSDag-Erling SmørgravDisable X11 forwarding (permitted by default). 427b15c8340SDag-Erling Smørgrav.It Ic permit-agent-forwarding 428b15c8340SDag-Erling SmørgravAllows 429b15c8340SDag-Erling Smørgrav.Xr ssh-agent 1 430b15c8340SDag-Erling Smørgravforwarding. 431b15c8340SDag-Erling Smørgrav.It Ic permit-port-forwarding 432b15c8340SDag-Erling SmørgravAllows port forwarding. 433b15c8340SDag-Erling Smørgrav.It Ic permit-pty 434b15c8340SDag-Erling SmørgravAllows PTY allocation. 435b15c8340SDag-Erling Smørgrav.It Ic permit-user-rc 436b15c8340SDag-Erling SmørgravAllows execution of 437b15c8340SDag-Erling Smørgrav.Pa ~/.ssh/rc 438b15c8340SDag-Erling Smørgravby 439b15c8340SDag-Erling Smørgrav.Xr sshd 8 . 4408ad9b54aSDag-Erling Smørgrav.It Ic permit-x11-forwarding 4418ad9b54aSDag-Erling SmørgravAllows X11 forwarding. 4428ad9b54aSDag-Erling Smørgrav.It Ic source-address Ns = Ns Ar address_list 4438ad9b54aSDag-Erling SmørgravRestrict the source addresses from which the certificate is considered valid. 444b15c8340SDag-Erling SmørgravThe 445b15c8340SDag-Erling Smørgrav.Ar address_list 446b15c8340SDag-Erling Smørgravis a comma-separated list of one or more address/netmask pairs in CIDR 447b15c8340SDag-Erling Smørgravformat. 448b15c8340SDag-Erling Smørgrav.El 449b15c8340SDag-Erling Smørgrav.Pp 450e2f6069cSDag-Erling SmørgravAt present, no options are valid for host keys. 4515e8dbd04SDag-Erling Smørgrav.It Fl P Ar passphrase 4525e8dbd04SDag-Erling SmørgravProvides the (old) passphrase. 453511b41d2SMark Murray.It Fl p 454511b41d2SMark MurrayRequests changing the passphrase of a private key file instead of 455a8f6863aSKris Kennawaycreating a new private key. 456a8f6863aSKris KennawayThe program will prompt for the file 457511b41d2SMark Murraycontaining the private key, for the old passphrase, and twice for the 458511b41d2SMark Murraynew passphrase. 459*6888a9beSDag-Erling Smørgrav.It Fl Q 460*6888a9beSDag-Erling SmørgravTest whether keys have been revoked in a KRL. 461511b41d2SMark Murray.It Fl q 462511b41d2SMark MurraySilence 463511b41d2SMark Murray.Nm ssh-keygen . 4645e8dbd04SDag-Erling Smørgrav.It Fl R Ar hostname 4655e8dbd04SDag-Erling SmørgravRemoves all keys belonging to 4665e8dbd04SDag-Erling Smørgrav.Ar hostname 4675e8dbd04SDag-Erling Smørgravfrom a 4685e8dbd04SDag-Erling Smørgrav.Pa known_hosts 4695e8dbd04SDag-Erling Smørgravfile. 4705e8dbd04SDag-Erling SmørgravThis option is useful to delete hashed hosts (see the 4715e8dbd04SDag-Erling Smørgrav.Fl H 4725e8dbd04SDag-Erling Smørgravoption above). 4735e8dbd04SDag-Erling Smørgrav.It Fl r Ar hostname 4745e8dbd04SDag-Erling SmørgravPrint the SSHFP fingerprint resource record named 4755e8dbd04SDag-Erling Smørgrav.Ar hostname 4765e8dbd04SDag-Erling Smørgravfor the specified public key file. 4775e8dbd04SDag-Erling Smørgrav.It Fl S Ar start 4785e8dbd04SDag-Erling SmørgravSpecify start point (in hex) when generating candidate moduli for DH-GEX. 479b15c8340SDag-Erling Smørgrav.It Fl s Ar ca_key 480b15c8340SDag-Erling SmørgravCertify (sign) a public key using the specified CA key. 481b15c8340SDag-Erling SmørgravPlease see the 482b15c8340SDag-Erling Smørgrav.Sx CERTIFICATES 483b15c8340SDag-Erling Smørgravsection for details. 484*6888a9beSDag-Erling Smørgrav.Pp 485*6888a9beSDag-Erling SmørgravWhen generating a KRL, 486*6888a9beSDag-Erling Smørgrav.Fl s 487*6888a9beSDag-Erling Smørgravspecifies a path to a CA public key file used to revoke certificates directly 488*6888a9beSDag-Erling Smørgravby key ID or serial number. 489*6888a9beSDag-Erling SmørgravSee the 490*6888a9beSDag-Erling Smørgrav.Sx KEY REVOCATION LISTS 491*6888a9beSDag-Erling Smørgravsection for details. 4925e8dbd04SDag-Erling Smørgrav.It Fl T Ar output_file 4935e8dbd04SDag-Erling SmørgravTest DH group exchange candidate primes (generated using the 4945e8dbd04SDag-Erling Smørgrav.Fl G 4955e8dbd04SDag-Erling Smørgravoption) for safety. 4961e8db6e2SBrian Feldman.It Fl t Ar type 4975e8dbd04SDag-Erling SmørgravSpecifies the type of key to create. 4981e8db6e2SBrian FeldmanThe possible values are 4991e8db6e2SBrian Feldman.Dq rsa1 5001e8db6e2SBrian Feldmanfor protocol version 1 and 5014a421b63SDag-Erling Smørgrav.Dq dsa , 5024a421b63SDag-Erling Smørgrav.Dq ecdsa 5031e8db6e2SBrian Feldmanor 5044a421b63SDag-Erling Smørgrav.Dq rsa 5051e8db6e2SBrian Feldmanfor protocol version 2. 506*6888a9beSDag-Erling Smørgrav.It Fl u 507*6888a9beSDag-Erling SmørgravUpdate a KRL. 508*6888a9beSDag-Erling SmørgravWhen specified with 509*6888a9beSDag-Erling Smørgrav.Fl k , 510*6888a9beSDag-Erling Smørgravkeys listed via the command line are added to the existing KRL rather than 511*6888a9beSDag-Erling Smørgrava new KRL being created. 512b15c8340SDag-Erling Smørgrav.It Fl V Ar validity_interval 513b15c8340SDag-Erling SmørgravSpecify a validity interval when signing a certificate. 514b15c8340SDag-Erling SmørgravA validity interval may consist of a single time, indicating that the 515b15c8340SDag-Erling Smørgravcertificate is valid beginning now and expiring at that time, or may consist 516b15c8340SDag-Erling Smørgravof two times separated by a colon to indicate an explicit time interval. 517b15c8340SDag-Erling SmørgravThe start time may be specified as a date in YYYYMMDD format, a time 518b15c8340SDag-Erling Smørgravin YYYYMMDDHHMMSS format or a relative time (to the current time) consisting 519b15c8340SDag-Erling Smørgravof a minus sign followed by a relative time in the format described in the 520b15c8340SDag-Erling Smørgrav.Sx TIME FORMATS 521b15c8340SDag-Erling Smørgravsection of 5228ad9b54aSDag-Erling Smørgrav.Xr sshd_config 5 . 523b15c8340SDag-Erling SmørgravThe end time may be specified as a YYYYMMDD date, a YYYYMMDDHHMMSS time or 524b15c8340SDag-Erling Smørgrava relative time starting with a plus character. 525b15c8340SDag-Erling Smørgrav.Pp 526b15c8340SDag-Erling SmørgravFor example: 527b15c8340SDag-Erling Smørgrav.Dq +52w1d 528b15c8340SDag-Erling Smørgrav(valid from now to 52 weeks and one day from now), 529b15c8340SDag-Erling Smørgrav.Dq -4w:+4w 530b15c8340SDag-Erling Smørgrav(valid from four weeks ago to four weeks from now), 531b15c8340SDag-Erling Smørgrav.Dq 20100101123000:20110101123000 532b15c8340SDag-Erling Smørgrav(valid from 12:30 PM, January 1st, 2010 to 12:30 PM, January 1st, 2011), 533b15c8340SDag-Erling Smørgrav.Dq -1d:20110101 534b15c8340SDag-Erling Smørgrav(valid from yesterday to midnight, January 1st, 2011). 535efcad6b7SDag-Erling Smørgrav.It Fl v 536efcad6b7SDag-Erling SmørgravVerbose mode. 537efcad6b7SDag-Erling SmørgravCauses 538efcad6b7SDag-Erling Smørgrav.Nm 539efcad6b7SDag-Erling Smørgravto print debugging messages about its progress. 540efcad6b7SDag-Erling SmørgravThis is helpful for debugging moduli generation. 541efcad6b7SDag-Erling SmørgravMultiple 542efcad6b7SDag-Erling Smørgrav.Fl v 543efcad6b7SDag-Erling Smørgravoptions increase the verbosity. 544efcad6b7SDag-Erling SmørgravThe maximum is 3. 5455e8dbd04SDag-Erling Smørgrav.It Fl W Ar generator 5465e8dbd04SDag-Erling SmørgravSpecify desired generator when testing candidate moduli for DH-GEX. 5475e8dbd04SDag-Erling Smørgrav.It Fl y 5485e8dbd04SDag-Erling SmørgravThis option will read a private 5495e8dbd04SDag-Erling SmørgravOpenSSH format file and print an OpenSSH public key to stdout. 550e2f6069cSDag-Erling Smørgrav.It Fl z Ar serial_number 551e2f6069cSDag-Erling SmørgravSpecifies a serial number to be embedded in the certificate to distinguish 552e2f6069cSDag-Erling Smørgravthis certificate from others from the same CA. 553e2f6069cSDag-Erling SmørgravThe default serial number is zero. 554*6888a9beSDag-Erling Smørgrav.Pp 555*6888a9beSDag-Erling SmørgravWhen generating a KRL, the 556*6888a9beSDag-Erling Smørgrav.Fl z 557*6888a9beSDag-Erling Smørgravflag is used to specify a KRL version number. 558511b41d2SMark Murray.El 559d95e11bfSDag-Erling Smørgrav.Sh MODULI GENERATION 560d95e11bfSDag-Erling Smørgrav.Nm 561d95e11bfSDag-Erling Smørgravmay be used to generate groups for the Diffie-Hellman Group Exchange 562d95e11bfSDag-Erling Smørgrav(DH-GEX) protocol. 563d95e11bfSDag-Erling SmørgravGenerating these groups is a two-step process: first, candidate 564d95e11bfSDag-Erling Smørgravprimes are generated using a fast, but memory intensive process. 565d95e11bfSDag-Erling SmørgravThese candidate primes are then tested for suitability (a CPU-intensive 566d95e11bfSDag-Erling Smørgravprocess). 567d95e11bfSDag-Erling Smørgrav.Pp 568d95e11bfSDag-Erling SmørgravGeneration of primes is performed using the 569d95e11bfSDag-Erling Smørgrav.Fl G 570d95e11bfSDag-Erling Smørgravoption. 571d95e11bfSDag-Erling SmørgravThe desired length of the primes may be specified by the 572d95e11bfSDag-Erling Smørgrav.Fl b 573d95e11bfSDag-Erling Smørgravoption. 574d95e11bfSDag-Erling SmørgravFor example: 575d95e11bfSDag-Erling Smørgrav.Pp 5765e8dbd04SDag-Erling Smørgrav.Dl # ssh-keygen -G moduli-2048.candidates -b 2048 577d95e11bfSDag-Erling Smørgrav.Pp 578d95e11bfSDag-Erling SmørgravBy default, the search for primes begins at a random point in the 579d95e11bfSDag-Erling Smørgravdesired length range. 580d95e11bfSDag-Erling SmørgravThis may be overridden using the 581d95e11bfSDag-Erling Smørgrav.Fl S 582d95e11bfSDag-Erling Smørgravoption, which specifies a different start point (in hex). 583d95e11bfSDag-Erling Smørgrav.Pp 584462c32cbSDag-Erling SmørgravOnce a set of candidates have been generated, they must be screened for 585d95e11bfSDag-Erling Smørgravsuitability. 586d95e11bfSDag-Erling SmørgravThis may be performed using the 587d95e11bfSDag-Erling Smørgrav.Fl T 588d95e11bfSDag-Erling Smørgravoption. 589d95e11bfSDag-Erling SmørgravIn this mode 590d95e11bfSDag-Erling Smørgrav.Nm 591d95e11bfSDag-Erling Smørgravwill read candidates from standard input (or a file specified using the 592d95e11bfSDag-Erling Smørgrav.Fl f 593d95e11bfSDag-Erling Smørgravoption). 594d95e11bfSDag-Erling SmørgravFor example: 595d95e11bfSDag-Erling Smørgrav.Pp 5965e8dbd04SDag-Erling Smørgrav.Dl # ssh-keygen -T moduli-2048 -f moduli-2048.candidates 597d95e11bfSDag-Erling Smørgrav.Pp 598d95e11bfSDag-Erling SmørgravBy default, each candidate will be subjected to 100 primality tests. 599d95e11bfSDag-Erling SmørgravThis may be overridden using the 600d95e11bfSDag-Erling Smørgrav.Fl a 601d95e11bfSDag-Erling Smørgravoption. 602d95e11bfSDag-Erling SmørgravThe DH generator value will be chosen automatically for the 603d95e11bfSDag-Erling Smørgravprime under consideration. 604d95e11bfSDag-Erling SmørgravIf a specific generator is desired, it may be requested using the 605d95e11bfSDag-Erling Smørgrav.Fl W 606d95e11bfSDag-Erling Smørgravoption. 6075e8dbd04SDag-Erling SmørgravValid generator values are 2, 3, and 5. 608d95e11bfSDag-Erling Smørgrav.Pp 609d95e11bfSDag-Erling SmørgravScreened DH groups may be installed in 610d95e11bfSDag-Erling Smørgrav.Pa /etc/moduli . 611d95e11bfSDag-Erling SmørgravIt is important that this file contains moduli of a range of bit lengths and 612d95e11bfSDag-Erling Smørgravthat both ends of a connection share common moduli. 613b15c8340SDag-Erling Smørgrav.Sh CERTIFICATES 614b15c8340SDag-Erling Smørgrav.Nm 615b15c8340SDag-Erling Smørgravsupports signing of keys to produce certificates that may be used for 616b15c8340SDag-Erling Smørgravuser or host authentication. 617b15c8340SDag-Erling SmørgravCertificates consist of a public key, some identity information, zero or 618e2f6069cSDag-Erling Smørgravmore principal (user or host) names and a set of options that 619b15c8340SDag-Erling Smørgravare signed by a Certification Authority (CA) key. 620b15c8340SDag-Erling SmørgravClients or servers may then trust only the CA key and verify its signature 621b15c8340SDag-Erling Smørgravon a certificate rather than trusting many user/host keys. 622b15c8340SDag-Erling SmørgravNote that OpenSSH certificates are a different, and much simpler, format to 623b15c8340SDag-Erling Smørgravthe X.509 certificates used in 624b15c8340SDag-Erling Smørgrav.Xr ssl 8 . 625b15c8340SDag-Erling Smørgrav.Pp 626b15c8340SDag-Erling Smørgrav.Nm 627b15c8340SDag-Erling Smørgravsupports two types of certificates: user and host. 628b15c8340SDag-Erling SmørgravUser certificates authenticate users to servers, whereas host certificates 629b15c8340SDag-Erling Smørgravauthenticate server hosts to users. 630b15c8340SDag-Erling SmørgravTo generate a user certificate: 631b15c8340SDag-Erling Smørgrav.Pp 632b15c8340SDag-Erling Smørgrav.Dl $ ssh-keygen -s /path/to/ca_key -I key_id /path/to/user_key.pub 633b15c8340SDag-Erling Smørgrav.Pp 634b15c8340SDag-Erling SmørgravThe resultant certificate will be placed in 6358ad9b54aSDag-Erling Smørgrav.Pa /path/to/user_key-cert.pub . 636b15c8340SDag-Erling SmørgravA host certificate requires the 637b15c8340SDag-Erling Smørgrav.Fl h 638b15c8340SDag-Erling Smørgravoption: 639b15c8340SDag-Erling Smørgrav.Pp 640b15c8340SDag-Erling Smørgrav.Dl $ ssh-keygen -s /path/to/ca_key -I key_id -h /path/to/host_key.pub 641b15c8340SDag-Erling Smørgrav.Pp 642b15c8340SDag-Erling SmørgravThe host certificate will be output to 6438ad9b54aSDag-Erling Smørgrav.Pa /path/to/host_key-cert.pub . 644e2f6069cSDag-Erling Smørgrav.Pp 645e2f6069cSDag-Erling SmørgravIt is possible to sign using a CA key stored in a PKCS#11 token by 646e2f6069cSDag-Erling Smørgravproviding the token library using 647e2f6069cSDag-Erling Smørgrav.Fl D 648e2f6069cSDag-Erling Smørgravand identifying the CA key by providing its public half as an argument 649e2f6069cSDag-Erling Smørgravto 650e2f6069cSDag-Erling Smørgrav.Fl s : 651e2f6069cSDag-Erling Smørgrav.Pp 652e2f6069cSDag-Erling Smørgrav.Dl $ ssh-keygen -s ca_key.pub -D libpkcs11.so -I key_id host_key.pub 653e2f6069cSDag-Erling Smørgrav.Pp 654e2f6069cSDag-Erling SmørgravIn all cases, 655b15c8340SDag-Erling Smørgrav.Ar key_id 656b15c8340SDag-Erling Smørgravis a "key identifier" that is logged by the server when the certificate 657b15c8340SDag-Erling Smørgravis used for authentication. 658b15c8340SDag-Erling Smørgrav.Pp 659b15c8340SDag-Erling SmørgravCertificates may be limited to be valid for a set of principal (user/host) 660b15c8340SDag-Erling Smørgravnames. 661b15c8340SDag-Erling SmørgravBy default, generated certificates are valid for all users or hosts. 662b15c8340SDag-Erling SmørgravTo generate a certificate for a specified set of principals: 663b15c8340SDag-Erling Smørgrav.Pp 664b15c8340SDag-Erling Smørgrav.Dl $ ssh-keygen -s ca_key -I key_id -n user1,user2 user_key.pub 6658ad9b54aSDag-Erling Smørgrav.Dl "$ ssh-keygen -s ca_key -I key_id -h -n host.domain user_key.pub" 666b15c8340SDag-Erling Smørgrav.Pp 667b15c8340SDag-Erling SmørgravAdditional limitations on the validity and use of user certificates may 668e2f6069cSDag-Erling Smørgravbe specified through certificate options. 669e2f6069cSDag-Erling SmørgravA certificate option may disable features of the SSH session, may be 670b15c8340SDag-Erling Smørgravvalid only when presented from particular source addresses or may 671b15c8340SDag-Erling Smørgravforce the use of a specific command. 672e2f6069cSDag-Erling SmørgravFor a list of valid certificate options, see the documentation for the 673b15c8340SDag-Erling Smørgrav.Fl O 674b15c8340SDag-Erling Smørgravoption above. 675b15c8340SDag-Erling Smørgrav.Pp 676b15c8340SDag-Erling SmørgravFinally, certificates may be defined with a validity lifetime. 677b15c8340SDag-Erling SmørgravThe 678b15c8340SDag-Erling Smørgrav.Fl V 679b15c8340SDag-Erling Smørgravoption allows specification of certificate start and end times. 680b15c8340SDag-Erling SmørgravA certificate that is presented at a time outside this range will not be 681b15c8340SDag-Erling Smørgravconsidered valid. 682*6888a9beSDag-Erling SmørgravBy default, certificates are valid from 683*6888a9beSDag-Erling Smørgrav.Ux 684*6888a9beSDag-Erling SmørgravEpoch to the distant future. 685b15c8340SDag-Erling Smørgrav.Pp 686b15c8340SDag-Erling SmørgravFor certificates to be used for user or host authentication, the CA 687b15c8340SDag-Erling Smørgravpublic key must be trusted by 688b15c8340SDag-Erling Smørgrav.Xr sshd 8 689b15c8340SDag-Erling Smørgravor 690b15c8340SDag-Erling Smørgrav.Xr ssh 1 . 691b15c8340SDag-Erling SmørgravPlease refer to those manual pages for details. 692*6888a9beSDag-Erling Smørgrav.Sh KEY REVOCATION LISTS 693*6888a9beSDag-Erling Smørgrav.Nm 694*6888a9beSDag-Erling Smørgravis able to manage OpenSSH format Key Revocation Lists (KRLs). 695*6888a9beSDag-Erling SmørgravThese binary files specify keys or certificates to be revoked using a 696*6888a9beSDag-Erling Smørgravcompact format, taking as little a one bit per certificate if they are being 697*6888a9beSDag-Erling Smørgravrevoked by serial number. 698*6888a9beSDag-Erling Smørgrav.Pp 699*6888a9beSDag-Erling SmørgravKRLs may be generated using the 700*6888a9beSDag-Erling Smørgrav.Fl k 701*6888a9beSDag-Erling Smørgravflag. 702*6888a9beSDag-Erling SmørgravThis option reads one or more files from the command line and generates a new 703*6888a9beSDag-Erling SmørgravKRL. 704*6888a9beSDag-Erling SmørgravThe files may either contain a KRL specification (see below) or public keys, 705*6888a9beSDag-Erling Smørgravlisted one per line. 706*6888a9beSDag-Erling SmørgravPlain public keys are revoked by listing their hash or contents in the KRL and 707*6888a9beSDag-Erling Smørgravcertificates revoked by serial number or key ID (if the serial is zero or 708*6888a9beSDag-Erling Smørgravnot available). 709*6888a9beSDag-Erling Smørgrav.Pp 710*6888a9beSDag-Erling SmørgravRevoking keys using a KRL specification offers explicit control over the 711*6888a9beSDag-Erling Smørgravtypes of record used to revoke keys and may be used to directly revoke 712*6888a9beSDag-Erling Smørgravcertificates by serial number or key ID without having the complete original 713*6888a9beSDag-Erling Smørgravcertificate on hand. 714*6888a9beSDag-Erling SmørgravA KRL specification consists of lines containing one of the following directives 715*6888a9beSDag-Erling Smørgravfollowed by a colon and some directive-specific information. 716*6888a9beSDag-Erling Smørgrav.Bl -tag -width Ds 717*6888a9beSDag-Erling Smørgrav.It Cm serial : Ar serial_number Ns Op - Ns Ar serial_number 718*6888a9beSDag-Erling SmørgravRevokes a certificate with the specified serial number. 719*6888a9beSDag-Erling SmørgravSerial numbers are 64-bit values, not including zero and may be expressed 720*6888a9beSDag-Erling Smørgravin decimal, hex or octal. 721*6888a9beSDag-Erling SmørgravIf two serial numbers are specified separated by a hyphen, then the range 722*6888a9beSDag-Erling Smørgravof serial numbers including and between each is revoked. 723*6888a9beSDag-Erling SmørgravThe CA key must have been specified on the 724*6888a9beSDag-Erling Smørgrav.Nm 725*6888a9beSDag-Erling Smørgravcommand line using the 726*6888a9beSDag-Erling Smørgrav.Fl s 727*6888a9beSDag-Erling Smørgravoption. 728*6888a9beSDag-Erling Smørgrav.It Cm id : Ar key_id 729*6888a9beSDag-Erling SmørgravRevokes a certificate with the specified key ID string. 730*6888a9beSDag-Erling SmørgravThe CA key must have been specified on the 731*6888a9beSDag-Erling Smørgrav.Nm 732*6888a9beSDag-Erling Smørgravcommand line using the 733*6888a9beSDag-Erling Smørgrav.Fl s 734*6888a9beSDag-Erling Smørgravoption. 735*6888a9beSDag-Erling Smørgrav.It Cm key : Ar public_key 736*6888a9beSDag-Erling SmørgravRevokes the specified key. 737*6888a9beSDag-Erling SmørgravIf a certificate is listed, then it is revoked as a plain public key. 738*6888a9beSDag-Erling Smørgrav.It Cm sha1 : Ar public_key 739*6888a9beSDag-Erling SmørgravRevokes the specified key by its SHA1 hash. 740*6888a9beSDag-Erling Smørgrav.El 741*6888a9beSDag-Erling Smørgrav.Pp 742*6888a9beSDag-Erling SmørgravKRLs may be updated using the 743*6888a9beSDag-Erling Smørgrav.Fl u 744*6888a9beSDag-Erling Smørgravflag in addition to 745*6888a9beSDag-Erling Smørgrav.Fl k . 746*6888a9beSDag-Erling SmørgravWhen this option is specified, keys listed via the command line are merged into 747*6888a9beSDag-Erling Smørgravthe KRL, adding to those already there. 748*6888a9beSDag-Erling Smørgrav.Pp 749*6888a9beSDag-Erling SmørgravIt is also possible, given a KRL, to test whether it revokes a particular key 750*6888a9beSDag-Erling Smørgrav(or keys). 751*6888a9beSDag-Erling SmørgravThe 752*6888a9beSDag-Erling Smørgrav.Fl Q 753*6888a9beSDag-Erling Smørgravflag will query an existing KRL, testing each key specified on the commandline. 754*6888a9beSDag-Erling SmørgravIf any key listed on the command line has been revoked (or an error encountered) 755*6888a9beSDag-Erling Smørgravthen 756*6888a9beSDag-Erling Smørgrav.Nm 757*6888a9beSDag-Erling Smørgravwill exit with a non-zero exit status. 758*6888a9beSDag-Erling SmørgravA zero exit status will only be returned if no key was revoked. 759511b41d2SMark Murray.Sh FILES 7604a421b63SDag-Erling Smørgrav.Bl -tag -width Ds -compact 761043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/identity 7621e8db6e2SBrian FeldmanContains the protocol version 1 RSA authentication identity of the user. 763a8f6863aSKris KennawayThis file should not be readable by anyone but the user. 764a8f6863aSKris KennawayIt is possible to 765511b41d2SMark Murrayspecify a passphrase when generating the key; that passphrase will be 7664a421b63SDag-Erling Smørgravused to encrypt the private part of this file using 3DES. 767a8f6863aSKris KennawayThis file is not automatically accessed by 768511b41d2SMark Murray.Nm 769511b41d2SMark Murraybut it is offered as the default file for the private key. 770ae1f160dSDag-Erling Smørgrav.Xr ssh 1 771a04a10f8SKris Kennawaywill read this file when a login attempt is made. 7724a421b63SDag-Erling Smørgrav.Pp 773043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/identity.pub 7741e8db6e2SBrian FeldmanContains the protocol version 1 RSA public key for authentication. 775a8f6863aSKris KennawayThe contents of this file should be added to 776043840dfSDag-Erling Smørgrav.Pa ~/.ssh/authorized_keys 777511b41d2SMark Murrayon all machines 778ae1f160dSDag-Erling Smørgravwhere the user wishes to log in using RSA authentication. 779a8f6863aSKris KennawayThere is no need to keep the contents of this file secret. 7804a421b63SDag-Erling Smørgrav.Pp 781043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/id_dsa 7824a421b63SDag-Erling Smørgrav.It Pa ~/.ssh/id_ecdsa 783043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/id_rsa 7844a421b63SDag-Erling SmørgravContains the protocol version 2 DSA, ECDSA or RSA authentication identity of the user. 7851e8db6e2SBrian FeldmanThis file should not be readable by anyone but the user. 7861e8db6e2SBrian FeldmanIt is possible to 7871e8db6e2SBrian Feldmanspecify a passphrase when generating the key; that passphrase will be 788b15c8340SDag-Erling Smørgravused to encrypt the private part of this file using 128-bit AES. 7891e8db6e2SBrian FeldmanThis file is not automatically accessed by 7901e8db6e2SBrian Feldman.Nm 7911e8db6e2SBrian Feldmanbut it is offered as the default file for the private key. 792ae1f160dSDag-Erling Smørgrav.Xr ssh 1 7931e8db6e2SBrian Feldmanwill read this file when a login attempt is made. 7944a421b63SDag-Erling Smørgrav.Pp 7954a421b63SDag-Erling Smørgrav.It Pa ~/.ssh/id_dsa.pub 7964a421b63SDag-Erling Smørgrav.It Pa ~/.ssh/id_ecdsa.pub 797043840dfSDag-Erling Smørgrav.It Pa ~/.ssh/id_rsa.pub 7984a421b63SDag-Erling SmørgravContains the protocol version 2 DSA, ECDSA or RSA public key for authentication. 7991e8db6e2SBrian FeldmanThe contents of this file should be added to 800043840dfSDag-Erling Smørgrav.Pa ~/.ssh/authorized_keys 8011e8db6e2SBrian Feldmanon all machines 802ae1f160dSDag-Erling Smørgravwhere the user wishes to log in using public key authentication. 803a04a10f8SKris KennawayThere is no need to keep the contents of this file secret. 8044a421b63SDag-Erling Smørgrav.Pp 805d95e11bfSDag-Erling Smørgrav.It Pa /etc/moduli 806d95e11bfSDag-Erling SmørgravContains Diffie-Hellman groups used for DH-GEX. 807d95e11bfSDag-Erling SmørgravThe file format is described in 808d95e11bfSDag-Erling Smørgrav.Xr moduli 5 . 809b66f2d16SKris Kennaway.El 810511b41d2SMark Murray.Sh SEE ALSO 811511b41d2SMark Murray.Xr ssh 1 , 812511b41d2SMark Murray.Xr ssh-add 1 , 813511b41d2SMark Murray.Xr ssh-agent 1 , 814d95e11bfSDag-Erling Smørgrav.Xr moduli 5 , 8151e8db6e2SBrian Feldman.Xr sshd 8 8161e8db6e2SBrian Feldman.Rs 817d4af9e69SDag-Erling Smørgrav.%R RFC 4716 818d4af9e69SDag-Erling Smørgrav.%T "The Secure Shell (SSH) Public Key File Format" 819d4af9e69SDag-Erling Smørgrav.%D 2006 8201e8db6e2SBrian Feldman.Re 821d95e11bfSDag-Erling Smørgrav.Sh AUTHORS 822d95e11bfSDag-Erling SmørgravOpenSSH is a derivative of the original and free 823d95e11bfSDag-Erling Smørgravssh 1.2.12 release by Tatu Ylonen. 824d95e11bfSDag-Erling SmørgravAaron Campbell, Bob Beck, Markus Friedl, Niels Provos, 825d95e11bfSDag-Erling SmørgravTheo de Raadt and Dug Song 826d95e11bfSDag-Erling Smørgravremoved many bugs, re-added newer features and 827d95e11bfSDag-Erling Smørgravcreated OpenSSH. 828d95e11bfSDag-Erling SmørgravMarkus Friedl contributed the support for SSH 829d95e11bfSDag-Erling Smørgravprotocol versions 1.5 and 2.0. 830