blob: 8474e8f9dc601de845c449405879a558c0d1d8a3 [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.\"
Damien Miller450a7a12000-03-26 13:04:51 +100012.\" $Id: ssh-keygen.1,v 1.10 2000/03/26 03:04:53 damien Exp $
Damien Miller32aa1441999-10-29 09:15:49 +100013.\"
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 Miller10f6f6b1999-11-17 17:29:08 +110026.Op Fl f Ar keyfile
Damien Miller32aa1441999-10-29 09:15:49 +100027.Nm ssh-keygen
28.Fl p
29.Op Fl P Ar old_passphrase
30.Op Fl N Ar new_passphrase
Damien Miller10f6f6b1999-11-17 17:29:08 +110031.Op Fl f Ar keyfile
Damien Miller32aa1441999-10-29 09:15:49 +100032.Nm ssh-keygen
33.Fl c
34.Op Fl P Ar passphrase
35.Op Fl C Ar comment
Damien Miller10f6f6b1999-11-17 17:29:08 +110036.Op Fl f Ar keyfile
37.Nm ssh-keygen
38.Fl l
39.Op Fl f Ar keyfile
Damien Miller32aa1441999-10-29 09:15:49 +100040.Sh DESCRIPTION
41.Nm
42generates and manages authentication keys for
43.Xr ssh 1 .
44Normally each user wishing to use SSH
45with RSA authentication runs this once to create the authentication
46key in
47.Pa $HOME/.ssh/identity .
48Additionally, the system administrator may use this to generate host keys.
49.Pp
50Normally this program generates the key and asks for a file in which
Damien Miller450a7a12000-03-26 13:04:51 +100051to store the private key.
52The public key is stored in a file with the same name but
Damien Miller32aa1441999-10-29 09:15:49 +100053.Dq .pub
Damien Miller450a7a12000-03-26 13:04:51 +100054appended.
55The program also asks for a passphrase.
56The passphrase may be empty to indicate no passphrase
Damien Miller32aa1441999-10-29 09:15:49 +100057(host keys must have empty passphrase), or it may be a string of
Damien Miller450a7a12000-03-26 13:04:51 +100058arbitrary length.
59Good passphrases are 10-30 characters long and are
Damien Miller32aa1441999-10-29 09:15:49 +100060not simple sentences or otherwise easily guessable (English
61prose has only 1-2 bits of entropy per word, and provides very bad
Damien Miller450a7a12000-03-26 13:04:51 +100062passphrases).
63The passphrase can be changed later by using the
Damien Miller32aa1441999-10-29 09:15:49 +100064.Fl p
65option.
66.Pp
Damien Miller450a7a12000-03-26 13:04:51 +100067There is no way to recover a lost passphrase.
68If the passphrase is
Damien Miller32aa1441999-10-29 09:15:49 +100069lost or forgotten, you will have to generate a new key and copy the
70corresponding public key to other machines.
71.Pp
72There is also a comment field in the key file that is only for
Damien Miller450a7a12000-03-26 13:04:51 +100073convenience to the user to help identify the key.
74The comment can tell what the key is for, or whatever is useful.
75The comment is initialized to
Damien Miller32aa1441999-10-29 09:15:49 +100076.Dq user@host
77when the key is created, but can be changed using the
78.Fl c
79option.
80.Pp
81The options are as follows:
82.Bl -tag -width Ds
83.It Fl b Ar bits
Damien Miller450a7a12000-03-26 13:04:51 +100084Specifies the number of bits in the key to create.
85Minimum is 512 bits.
86Generally 1024 bits is considered sufficient, and key sizes
87above that no longer improve security but make things slower.
88The default is 1024 bits.
Damien Miller32aa1441999-10-29 09:15:49 +100089.It Fl c
90Requests changing the comment in the private and public key files.
91The program will prompt for the file containing the private keys, for
92passphrase if the key has one, and for the new comment.
Damien Miller10f6f6b1999-11-17 17:29:08 +110093.It Fl f
94Specifies the filename of the key file.
95.It Fl l
96Show fingerprint of specified private or public key file.
Damien Miller32aa1441999-10-29 09:15:49 +100097.It Fl p
98Requests changing the passphrase of a private key file instead of
Damien Miller450a7a12000-03-26 13:04:51 +100099creating a new private key.
100The program will prompt for the file
Damien Miller32aa1441999-10-29 09:15:49 +1000101containing the private key, for the old passphrase, and twice for the
102new passphrase.
103.It Fl q
104Silence
105.Nm ssh-keygen .
106Used by
107.Pa /etc/rc
108when creating a new key.
109.It Fl C Ar comment
110Provides the new comment.
111.It Fl N Ar new_passphrase
112Provides the new passphrase.
113.It Fl P Ar passphrase
114Provides the (old) passphrase.
115.El
116.Sh FILES
117.Bl -tag -width Ds
Damien Miller32aa1441999-10-29 09:15:49 +1000118.It Pa $HOME/.ssh/identity
Damien Miller450a7a12000-03-26 13:04:51 +1000119Contains the RSA authentication identity of the user.
120This file should not be readable by anyone but the user.
121It is possible to
Damien Miller32aa1441999-10-29 09:15:49 +1000122specify a passphrase when generating the key; that passphrase will be
Damien Miller450a7a12000-03-26 13:04:51 +1000123used to encrypt the private part of this file using 3DES.
124This file is not automatically accessed by
Damien Miller32aa1441999-10-29 09:15:49 +1000125.Nm
126but it is offered as the default file for the private key.
127.It Pa $HOME/.ssh/identity.pub
Damien Miller450a7a12000-03-26 13:04:51 +1000128Contains the public key for authentication.
129The contents of this file should be added to
Damien Miller32aa1441999-10-29 09:15:49 +1000130.Pa $HOME/.ssh/authorized_keys
131on all machines
Damien Miller450a7a12000-03-26 13:04:51 +1000132where you wish to log in using RSA authentication.
133There is no need to keep the contents of this file secret.
Damien Miller32aa1441999-10-29 09:15:49 +1000134.Sh AUTHOR
135Tatu Ylonen <ylo@cs.hut.fi>
136.Pp
137OpenSSH
138is a derivative of the original (free) ssh 1.2.12 release, but with bugs
Damien Miller450a7a12000-03-26 13:04:51 +1000139removed and newer features re-added.
140Rapidly after the 1.2.12 release,
141newer versions bore successively more restrictive licenses.
142This version of OpenSSH
Damien Miller32aa1441999-10-29 09:15:49 +1000143.Bl -bullet
144.It
Damien Miller14537852000-01-22 19:57:40 +1100145has all components of a restrictive nature (i.e., patents, see
Damien Miller32aa1441999-10-29 09:15:49 +1000146.Xr ssl 8 )
147directly removed from the source code; any licensed or patented components
148are chosen from
149external libraries.
150.It
151has been updated to support ssh protocol 1.5.
152.It
153contains added support for
154.Xr kerberos 8
155authentication and ticket passing.
156.It
157supports one-time password authentication with
158.Xr skey 1 .
159.El
160.Pp
161The libraries described in
162.Xr ssl 8
163are required for proper operation.
164.Sh SEE ALSO
165.Xr ssh 1 ,
166.Xr ssh-add 1 ,
Damien Miller2e8b1c81999-11-15 23:33:56 +1100167.Xr ssh-agent 1 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000168.Xr sshd 8 ,
169.Xr ssl 8