Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1 | .\" -*- nroff -*- |
| 2 | .\" |
| 3 | .\" ssh-keygen.1 |
| 4 | .\" |
| 5 | .\" Author: Tatu Ylonen <ylo@cs.hut.fi> |
| 6 | .\" |
| 7 | .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 8 | .\" All rights reserved |
| 9 | .\" |
| 10 | .\" Created: Sat Apr 22 23:55:14 1995 ylo |
| 11 | .\" |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 12 | .\" $Id: ssh-keygen.1,v 1.11 2000/04/13 02:26:37 damien Exp $ |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 13 | .\" |
| 14 | .Dd September 25, 1999 |
| 15 | .Dt SSH-KEYGEN 1 |
| 16 | .Os |
| 17 | .Sh NAME |
| 18 | .Nm ssh-keygen |
| 19 | .Nd authentication key generation |
| 20 | .Sh SYNOPSIS |
| 21 | .Nm ssh-keygen |
| 22 | .Op Fl q |
| 23 | .Op Fl b Ar bits |
| 24 | .Op Fl N Ar new_passphrase |
| 25 | .Op Fl C Ar comment |
Damien Miller | 10f6f6b | 1999-11-17 17:29:08 +1100 | [diff] [blame] | 26 | .Op Fl f Ar keyfile |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 27 | .Nm ssh-keygen |
| 28 | .Fl p |
| 29 | .Op Fl P Ar old_passphrase |
| 30 | .Op Fl N Ar new_passphrase |
Damien Miller | 10f6f6b | 1999-11-17 17:29:08 +1100 | [diff] [blame] | 31 | .Op Fl f Ar keyfile |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 32 | .Nm ssh-keygen |
| 33 | .Fl c |
| 34 | .Op Fl P Ar passphrase |
| 35 | .Op Fl C Ar comment |
Damien Miller | 10f6f6b | 1999-11-17 17:29:08 +1100 | [diff] [blame] | 36 | .Op Fl f Ar keyfile |
| 37 | .Nm ssh-keygen |
| 38 | .Fl l |
| 39 | .Op Fl f Ar keyfile |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 40 | .Sh DESCRIPTION |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 41 | .Nm |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 42 | generates and manages authentication keys for |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 43 | .Xr ssh 1 . |
| 44 | Normally each user wishing to use SSH |
| 45 | with RSA authentication runs this once to create the authentication |
| 46 | key in |
| 47 | .Pa $HOME/.ssh/identity . |
| 48 | Additionally, the system administrator may use this to generate host keys. |
| 49 | .Pp |
| 50 | Normally this program generates the key and asks for a file in which |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 51 | to store the private key. |
| 52 | The public key is stored in a file with the same name but |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 53 | .Dq .pub |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 54 | appended. |
| 55 | The program also asks for a passphrase. |
| 56 | The passphrase may be empty to indicate no passphrase |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 57 | (host keys must have empty passphrase), or it may be a string of |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 58 | arbitrary length. |
| 59 | Good passphrases are 10-30 characters long and are |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 60 | not simple sentences or otherwise easily guessable (English |
| 61 | prose has only 1-2 bits of entropy per word, and provides very bad |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 62 | passphrases). |
| 63 | The passphrase can be changed later by using the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 64 | .Fl p |
| 65 | option. |
| 66 | .Pp |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 67 | There is no way to recover a lost passphrase. |
| 68 | If the passphrase is |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 69 | lost or forgotten, you will have to generate a new key and copy the |
| 70 | corresponding public key to other machines. |
| 71 | .Pp |
| 72 | There is also a comment field in the key file that is only for |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 73 | convenience to the user to help identify the key. |
| 74 | The comment can tell what the key is for, or whatever is useful. |
| 75 | The comment is initialized to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 76 | .Dq user@host |
| 77 | when the key is created, but can be changed using the |
| 78 | .Fl c |
| 79 | option. |
| 80 | .Pp |
| 81 | The options are as follows: |
| 82 | .Bl -tag -width Ds |
| 83 | .It Fl b Ar bits |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 84 | Specifies the number of bits in the key to create. |
| 85 | Minimum is 512 bits. |
| 86 | Generally 1024 bits is considered sufficient, and key sizes |
| 87 | above that no longer improve security but make things slower. |
| 88 | The default is 1024 bits. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 89 | .It Fl c |
| 90 | Requests changing the comment in the private and public key files. |
| 91 | The program will prompt for the file containing the private keys, for |
| 92 | passphrase if the key has one, and for the new comment. |
Damien Miller | 10f6f6b | 1999-11-17 17:29:08 +1100 | [diff] [blame] | 93 | .It Fl f |
| 94 | Specifies the filename of the key file. |
| 95 | .It Fl l |
| 96 | Show fingerprint of specified private or public key file. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 97 | .It Fl p |
| 98 | Requests changing the passphrase of a private key file instead of |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 99 | creating a new private key. |
| 100 | The program will prompt for the file |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 101 | containing the private key, for the old passphrase, and twice for the |
| 102 | new passphrase. |
| 103 | .It Fl q |
| 104 | Silence |
| 105 | .Nm ssh-keygen . |
| 106 | Used by |
| 107 | .Pa /etc/rc |
| 108 | when creating a new key. |
| 109 | .It Fl C Ar comment |
| 110 | Provides the new comment. |
| 111 | .It Fl N Ar new_passphrase |
| 112 | Provides the new passphrase. |
| 113 | .It Fl P Ar passphrase |
| 114 | Provides the (old) passphrase. |
| 115 | .El |
| 116 | .Sh FILES |
| 117 | .Bl -tag -width Ds |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 118 | .It Pa $HOME/.ssh/identity |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 119 | Contains the RSA authentication identity of the user. |
| 120 | This file should not be readable by anyone but the user. |
| 121 | It is possible to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 122 | specify a passphrase when generating the key; that passphrase will be |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 123 | used to encrypt the private part of this file using 3DES. |
| 124 | This file is not automatically accessed by |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 125 | .Nm |
| 126 | but it is offered as the default file for the private key. |
| 127 | .It Pa $HOME/.ssh/identity.pub |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 128 | Contains the public key for authentication. |
| 129 | The contents of this file should be added to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 130 | .Pa $HOME/.ssh/authorized_keys |
| 131 | on all machines |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 132 | where you wish to log in using RSA authentication. |
| 133 | There is no need to keep the contents of this file secret. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 134 | .Sh AUTHOR |
| 135 | Tatu Ylonen <ylo@cs.hut.fi> |
| 136 | .Pp |
| 137 | OpenSSH |
| 138 | is a derivative of the original (free) ssh 1.2.12 release, but with bugs |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 139 | removed and newer features re-added. |
| 140 | Rapidly after the 1.2.12 release, |
| 141 | newer versions bore successively more restrictive licenses. |
| 142 | This version of OpenSSH |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 143 | .Bl -bullet |
| 144 | .It |
Damien Miller | 1453785 | 2000-01-22 19:57:40 +1100 | [diff] [blame] | 145 | has all components of a restrictive nature (i.e., patents, see |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 146 | .Xr ssl 8 ) |
| 147 | directly removed from the source code; any licensed or patented components |
| 148 | are chosen from |
| 149 | external libraries. |
| 150 | .It |
| 151 | has been updated to support ssh protocol 1.5. |
| 152 | .It |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 153 | contains added support for |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 154 | .Xr kerberos 8 |
| 155 | authentication and ticket passing. |
| 156 | .It |
| 157 | supports one-time password authentication with |
| 158 | .Xr skey 1 . |
| 159 | .El |
| 160 | .Pp |
| 161 | The libraries described in |
| 162 | .Xr ssl 8 |
| 163 | are required for proper operation. |
| 164 | .Sh SEE ALSO |
| 165 | .Xr ssh 1 , |
| 166 | .Xr ssh-add 1 , |
Damien Miller | 2e8b1c8 | 1999-11-15 23:33:56 +1100 | [diff] [blame] | 167 | .Xr ssh-agent 1 , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 168 | .Xr sshd 8 , |
| 169 | .Xr ssl 8 |