Fix from Thomas Henlich for bug in dead key support. I've reproduced the
[u/mdw/putty] / unix / puttygen.1
CommitLineData
532696ff 1.TH puttygen 1
2.UC
3.SH NAME
4puttygen \- public-key generator for the PuTTY tools
5.SH SYNOPSIS
6\fBputtygen\fP ( \fIkeyfile\fP | \-t \fIkeytype\fP [ \-b \fIbits\fP ] )
7 [ \-C \fInew-comment\fP ] [ \-P ]
8 [ \-O \fIoutput-type\fP | \-l | \-L | \-p ]
9 [ \-o \fIoutput-file\fP ]
10.SH DESCRIPTION
11\fBputtygen\fP is a tool to generate and manipulate SSH public and
12private key pairs. It is part of the PuTTY suite, although it can
13also interoperate with the private key formats used by some other
14SSH clients.
15
16When you run \fBputtygen\fP, it does three things. Firstly, it
17either loads an existing key file (if you specified \fIkeyfile\fP),
18or generates a new key (if you specified \fIkeytype\fP). Then, it
19optionally makes modifications to the key (changing the comment
20and/or the passphrase); finally, it outputs the key, or some
21information about the key, to a file.
22
23All three of these phases are controlled by the options described in
24the following section.
25.SH OPTIONS
26In the first phase, \fBputtygen\fP either loads or generates a key.
27The options to control this are:
28.IP "\fIkeyfile\fP"
29Specify a private key file to be loaded. This private key file can
30be in the (de facto standard) SSH1 key format, or in PuTTY's SSH2
31key format, or in either of the SSH2 private key formats used by
32OpenSSH and ssh.com's implementation.
33.IP "\fB\-t\fP \fIkeytype\fP"
34Specify a type of key to generate. The acceptable values here are
35\fBrsa\fP and \fBdsa\fP (to generate SSH2 keys), and \fBrsa1\fP (to
36generate SSH1 keys).
37.IP "\fB\-b\fP \fIbits\fP"
38Specify the size of the key to generate, in bits. Default is 1024.
39.PP
40In the second phase, \fBputtygen\fP optionally alters properties of
41the key it has loaded or generated. The options to control this are:
42.IP "\fB\-C\fP \fInew\-comment\fP"
43Specify a comment string to describe the key. This comment string
44will be used by PuTTY to identify the key to you (when asking you to
45enter the passphrase, for example, so that you know which passphrase
46to type).
47.IP "\fB\-P\fP"
48Indicate that you want to change the key's passphrase. This is
49automatic when you are generating a new key, but not when you are
50modifying an existing key.
51.PP
52In the third phase, \fBputtygen\fP saves the key or information
53about it. The options to control this are:
54.IP "\fB\-O\fP \fIoutput\-type\fP"
55Specify the type of output you want \fBputtygen\fP to produce.
56Acceptable options are:
57.RS
58.IP "\fBprivate\fP"
59Save the private key in a format usable by PuTTY. This will either
60be the standard SSH1 key format, or PuTTY's own SSH2 key format.
61.IP "\fBpublic\fP"
62Save the public key only. For SSH1 keys, the standard public key
63format will be used ("1024 37 5698745...."). For SSH2 keys, the
64public key will be output in the format specified in the IETF
65drafts, which is a multi-line text file beginning with the line
66"---- BEGIN SSH2 PUBLIC KEY ----".
67.IP "\fBpublic-openssh\fP"
68Save the public key only, in a format usable by OpenSSH. For SSH1
69keys, this output format behaves identically to \fBpublic\fP. For
70SSH2 keys, the public key will be output in the OpenSSH format,
71which is a single line ("ssh-rsa AAAAB3NzaC1yc2...").
72.IP "\fBfingerprint\fP"
73Print the fingerprint of the public key. All fingerprinting
74algorithms are believed compatible with OpenSSH.
75.IP "\fBprivate-openssh\fP"
76Save an SSH2 private key in OpenSSH's format. This option is not
77permitted for SSH1 keys.
78.IP "\fBprivate-sshcom\fP"
79Save an SSH2 private key in ssh.com's format. This option is not
80permitted for SSH1 keys.
81.RE
82.IP
83If no output type is specified, the default is \fBprivate\fP.
84.IP "\fB\-o\fP \fIoutput\-file\fP"
85Specify the file where \fBputtygen\fP should write its output. If
86this option is not specified, \fBputtygen\fP will assume you want to
87overwrite the original file if the input and output file types are
88the same (changing a comment or passphrase), and will assume you
89want to output to stdout if you are asking for a public key or
90fingerprint. Otherwise, the \fB\-o\fP option is required.
91.IP "\fB\-l\fP"
92Synonym for "\fB-O fingerprint\fP".
93.IP "\fB\-L\fP"
94Synonym for "\fB-O public-openssh\fP".
95.IP "\fB\-p\fP"
96Synonym for "\fB-O public\fP".
97.SH EXAMPLES
98To generate an SSH2 RSA key pair and save it in PuTTY's own format
99(you will be prompted for the passphrase):
100
101\fBputtygen -t rsa -C "my home key" -o mykey.ppk\fP
102
103To generate a larger (2048-bit) key:
104
105\fBputtygen -t rsa -b 2048 -C "my home key" -o mykey.ppk\fP
106
107To change the passphrase on a key (you will be prompted for the old
108and new passphrases):
109
110\fBputtygen -P mykey.ppk\fP
111
112To change the comment on a key:
113
114\fBputtygen -C "new comment" mykey.ppk\fP
115
116To convert a key into OpenSSH's private key format:
117
118\fBputtygen mykey.ppk -O private-openssh -o my-openssh-key\fP
119
120To convert a key \fIfrom\fP another format (\fBputtygen\fP will
121automatically detect the input key type):
122
123\fBputtygen my-ssh.com-key -o mykey.ppk\fP
124
125To display the fingerprint of a key (some key types require a
126passphrase to extract even this much information):
127
128\fBputtygen -l mykey.ppk\fP
129
130To add the OpenSSH-format public half of a key to your authorised
131keys file:
132
133\fBputtygen -L mykey.ppk >> $HOME/.ssh/authorized_keys\fP
134
135.SH BUGS
136There's currently no way to supply passphrases in batch mode, or
137even just to specify that you don't want a passphrase at all.