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