]> andersk Git - openssh.git/blame - ssh-keygen.1
- djm@cvs.openbsd.org 2001/03/13 22:42:54
[openssh.git] / ssh-keygen.1
CommitLineData
aaf45d87 1.\" $OpenBSD: ssh-keygen.1,v 1.35 2001/03/11 22:33:23 markus Exp $
23c2a7a5 2.\"
bf740959 3.\" -*- nroff -*-
4.\"
bf740959 5.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
bf740959 6.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
7.\" All rights reserved
8.\"
bcbf86ec 9.\" As far as I am concerned, the code I have written for this software
10.\" can be used freely for any purpose. Any derived versions of this
11.\" software must be clearly marked as such, and if the derived work is
12.\" incompatible with the protocol description in the RFC file, it must be
13.\" called by a name other than "ssh" or "Secure Shell".
14.\"
15.\"
f3c7c613 16.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
17.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
18.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
bcbf86ec 19.\"
20.\" Redistribution and use in source and binary forms, with or without
21.\" modification, are permitted provided that the following conditions
22.\" are met:
23.\" 1. Redistributions of source code must retain the above copyright
24.\" notice, this list of conditions and the following disclaimer.
25.\" 2. Redistributions in binary form must reproduce the above copyright
26.\" notice, this list of conditions and the following disclaimer in the
27.\" documentation and/or other materials provided with the distribution.
bf740959 28.\"
bcbf86ec 29.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
30.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
31.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
33.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
34.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
38.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bf740959 39.\"
40.Dd September 25, 1999
41.Dt SSH-KEYGEN 1
42.Os
43.Sh NAME
44.Nm ssh-keygen
45.Nd authentication key generation
46.Sh SYNOPSIS
47.Nm ssh-keygen
fa08c86b 48.Op Fl q
bf740959 49.Op Fl b Ar bits
fa08c86b 50.Op Fl t Ar type
bf740959 51.Op Fl N Ar new_passphrase
52.Op Fl C Ar comment
7cd3766c 53.Op Fl f Ar output_keyfile
bf740959 54.Nm ssh-keygen
55.Fl p
56.Op Fl P Ar old_passphrase
57.Op Fl N Ar new_passphrase
f095fcc7 58.Op Fl f Ar keyfile
bf740959 59.Nm ssh-keygen
1d1ffb87 60.Fl x
7cd3766c 61.Op Fl f Ar input_keyfile
1d1ffb87 62.Nm ssh-keygen
63.Fl X
7cd3766c 64.Op Fl f Ar input_keyfile
1d1ffb87 65.Nm ssh-keygen
66.Fl y
7cd3766c 67.Op Fl f Ar input_keyfile
1d1ffb87 68.Nm ssh-keygen
bf740959 69.Fl c
70.Op Fl P Ar passphrase
71.Op Fl C Ar comment
f095fcc7 72.Op Fl f Ar keyfile
73.Nm ssh-keygen
74.Fl l
aaf45d87 75.Op Fl f Ar input_keyfile
76.Nm ssh-keygen
77.Fl B
7cd3766c 78.Op Fl f Ar input_keyfile
f54651ce 79.Sh DESCRIPTION
bf740959 80.Nm
f54651ce 81generates and manages authentication keys for
bf740959 82.Xr ssh 1 .
1d1ffb87 83.Nm
84defaults to generating an RSA key for use by protocols 1.3 and 1.5;
85specifying the
fa08c86b 86.Fl t
b5c334cc 87option allows you to create a key for use by protocol 2.0.
1d1ffb87 88.Pp
bf740959 89Normally each user wishing to use SSH
1d1ffb87 90with RSA or DSA authentication runs this once to create the authentication
bf740959 91key in
1d1ffb87 92.Pa $HOME/.ssh/identity
93or
94.Pa $HOME/.ssh/id_dsa .
95Additionally, the system administrator may use this to generate host keys,
96as seen in
97.Pa /etc/rc .
bf740959 98.Pp
99Normally this program generates the key and asks for a file in which
4fe2af09 100to store the private key.
101The public key is stored in a file with the same name but
bf740959 102.Dq .pub
4fe2af09 103appended.
104The program also asks for a passphrase.
105The passphrase may be empty to indicate no passphrase
b5c334cc 106(host keys must have an empty passphrase), or it may be a string of
4fe2af09 107arbitrary length.
108Good passphrases are 10-30 characters long and are
bf740959 109not simple sentences or otherwise easily guessable (English
110prose has only 1-2 bits of entropy per word, and provides very bad
4fe2af09 111passphrases).
112The passphrase can be changed later by using the
bf740959 113.Fl p
114option.
115.Pp
4fe2af09 116There is no way to recover a lost passphrase.
117If the passphrase is
bf740959 118lost or forgotten, you will have to generate a new key and copy the
119corresponding public key to other machines.
120.Pp
1d1ffb87 121For RSA, there is also a comment field in the key file that is only for
4fe2af09 122convenience to the user to help identify the key.
123The comment can tell what the key is for, or whatever is useful.
124The comment is initialized to
bf740959 125.Dq user@host
126when the key is created, but can be changed using the
127.Fl c
128option.
129.Pp
1d1ffb87 130After a key is generated, instructions below detail where the keys
131should be placed to be activated.
132.Pp
bf740959 133The options are as follows:
134.Bl -tag -width Ds
135.It Fl b Ar bits
4fe2af09 136Specifies the number of bits in the key to create.
137Minimum is 512 bits.
138Generally 1024 bits is considered sufficient, and key sizes
139above that no longer improve security but make things slower.
140The default is 1024 bits.
bf740959 141.It Fl c
142Requests changing the comment in the private and public key files.
143The program will prompt for the file containing the private keys, for
144passphrase if the key has one, and for the new comment.
f095fcc7 145.It Fl f
146Specifies the filename of the key file.
147.It Fl l
148Show fingerprint of specified private or public key file.
bf740959 149.It Fl p
150Requests changing the passphrase of a private key file instead of
4fe2af09 151creating a new private key.
152The program will prompt for the file
bf740959 153containing the private key, for the old passphrase, and twice for the
154new passphrase.
155.It Fl q
156Silence
157.Nm ssh-keygen .
158Used by
159.Pa /etc/rc
160when creating a new key.
fa08c86b 161.It Fl t Ar type
162Specifies the type of the key to create.
163The possible values are
164.Dq rsa1
165for protocol version 1 and
166.Dq rsa
167or
168.Dq dsa
169for protocol version 2.
170The default is
ed2166d8 171.Dq rsa1 .
aaf45d87 172.It Fl B
173Show the bubblebabble digest of specified private or public key file.
bf740959 174.It Fl C Ar comment
175Provides the new comment.
176.It Fl N Ar new_passphrase
177Provides the new passphrase.
178.It Fl P Ar passphrase
179Provides the (old) passphrase.
1d1ffb87 180.It Fl x
181This option will read a private
d0c832f3 182OpenSSH DSA format file and print a SSH2-compatible public key to stdout.
1d1ffb87 183.It Fl X
94ec8c6b 184This option will read a unencrypted
185SSH2-compatible private (or public) key file and
186print an OpenSSH compatible private (or public) key to stdout.
1d1ffb87 187.It Fl y
188This option will read a private
fa08c86b 189OpenSSH format file and print an OpenSSH public key to stdout.
bf740959 190.El
191.Sh FILES
192.Bl -tag -width Ds
bf740959 193.It Pa $HOME/.ssh/identity
4fe2af09 194Contains the RSA authentication identity of the user.
195This file should not be readable by anyone but the user.
196It is possible to
bf740959 197specify a passphrase when generating the key; that passphrase will be
4fe2af09 198used to encrypt the private part of this file using 3DES.
199This file is not automatically accessed by
bf740959 200.Nm
201but it is offered as the default file for the private key.
1d1ffb87 202.Xr sshd 8
203will read this file when a login attempt is made.
bf740959 204.It Pa $HOME/.ssh/identity.pub
4fe2af09 205Contains the public key for authentication.
206The contents of this file should be added to
bf740959 207.Pa $HOME/.ssh/authorized_keys
208on all machines
4fe2af09 209where you wish to log in using RSA authentication.
210There is no need to keep the contents of this file secret.
1d1ffb87 211.It Pa $HOME/.ssh/id_dsa
212Contains the DSA authentication identity of the user.
213This file should not be readable by anyone but the user.
214It is possible to
215specify a passphrase when generating the key; that passphrase will be
216used to encrypt the private part of this file using 3DES.
217This file is not automatically accessed by
218.Nm
219but it is offered as the default file for the private key.
220.Xr sshd 8
221will read this file when a login attempt is made.
222.It Pa $HOME/.ssh/id_dsa.pub
223Contains the public key for authentication.
224The contents of this file should be added to
225.Pa $HOME/.ssh/authorized_keys2
226on all machines
fa08c86b 227where you wish to log in using public key authentication.
1d1ffb87 228There is no need to keep the contents of this file secret.
089fbbd2 229.El
fa08c86b 230.Sh AUTHORS
5fb622e4 231OpenSSH is a derivative of the original and free
232ssh 1.2.12 release by Tatu Ylonen.
233Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
234Theo de Raadt and Dug Song
235removed many bugs, re-added newer features and
236created OpenSSH.
237Markus Friedl contributed the support for SSH
238protocol versions 1.5 and 2.0.
bf740959 239.Sh SEE ALSO
240.Xr ssh 1 ,
241.Xr ssh-add 1 ,
0c372277 242.Xr ssh-agent 1 ,
a5ef76f1 243.Xr sshd 8
This page took 0.132007 seconds and 5 git commands to generate.