puttygen(1)
puttygen π β the public-key generator for the PuTTY tools
okay so bestie, welcome to puttygen(1) from the PuTTY tool suite β this is your section 1 manual page and honestly? it's giving β¨key wizardryβ¨.
NAME π
puttygen β public-key generator for the PuTTY tools π
SYNOPSIS π¦
puttygen ( keyfile | -t keytype [ -b bits ] [ --primes method ] [ -q ] )
[ -C new-comment ] [ -P ] [ --reencrypt ]
[ --certificate cert-file | --remove-certificate ]
[ -O output-type | -l | -L | -p | --dump | --cert-info ]
[ --ppk-param key=value,... | -E fptype ]
[ -o output-file ]
DESCRIPTION πΈ
So puttygen is a tool to generate and manipulate SSH public and private key pairs. It's part of the PuTTY suite, no cap β but it also lowkey interoperates with the key formats used by some other SSH clients. Slay π
When you run puttygen, it does three things, in this order, main character energy:
- Firstly, it either loads an existing key file (if you specified keyfile), or generates a new key (if you specified keytype).
- Then, it optionally makes modifications to the key β like changing the comment and/or the passphrase.
- Finally, it outputs the key, or some information about the key, to a file.
All three of these phases are controlled by the options described in the following section. Periodt π
β¨ OPTIONS β¨
Phase one: load or generate π₯
In the first phase, puttygen either loads or generates a key. Note that generating a key requires random data, which can cause puttygen to pause β possibly for some time if your system does not have much randomness available. π
The options to control this phase are:
keyfileβ Specify a key file to be loaded. (Use-to read a key file from standard input. π)
Usually this will be a private key, which can be in the (de facto standard) SSH-1 key format, or in PuTTY's SSH-2 key format, or in either of the SSH-2 private key formats used by OpenSSH and ssh.com's implementation.
You can also specify a file containing only a public key here. The operations you can do are limited to outputting another public key format (possibly removing an attached certificate first), or a fingerprint. Public keys can be in RFC 4716 or OpenSSH format, or the standard SSH-1 format.
-tkeytype β Specify a type of key to generate. The acceptable values here arersa,dsa,ecdsa,eddsa,ed25519, anded448(to generate SSH-2 keys), andrsa1(to generate SSH-1 keys).-bbits β Specify the size of the key to generate, in bits. Default forrsaanddsakeys is2048.--primesmethod β Method for generating prime numbers. The acceptable values here areprobable(the default),proven, andproven-even; the later methods are slower. (Various synonyms for these method names are also accepted.)
The probable primes method sounds unsafe, but it's the most commonly used prime-generation strategy. There is in theory a possibility that it might accidentally generate a number that isn't prime, but the software does enough checking to make that probability vanishingly small (less than 1 in 2^80, or 1 in 10^24). So, in practice, nobody worries about it very much. π
The other methods cause PuTTYgen to use numbers that it is sure are prime, because it generates the output number together with a proof of its primality. This takes more effort, but it eliminates that theoretical risk in the probabilistic method. No cap.
You might choose to switch from probable to proven primes if you have a local security standard that demands it, or if you don't trust the probabilistic argument for the safety of the usual method. π«Ά
--strong-rsaβ When generating an RSA key, make sure the prime factors of the key modulus arestrong primes. A strong prime is a prime number chosen to have a particular structure that makes certain factoring algorithms more difficult to apply, so some security standards recommend their use. However, the most modern factoring algorithms are unaffected, so this option is probably not worth turning on unless you have a local standard that recommends it.-qβ Suppress the progress display when generating a new key. π€«--old-passphrasefile β Specify a file name; the first line will be read from this file (removing any trailing newline) and used as the old passphrase.
CAUTION: If the passphrase is important, the file should be stored on a temporary filesystem or else securely erased after use. π¨
--random-devicedevice β Specify device to read entropy from. By default,puttygenuses/dev/urandom, falling back to/dev/randomif it has to.
Phase two: alter the key's properties π
In the second phase, puttygen optionally alters properties of the key it has loaded or generated. The options to control this are:
-Cnew-comment β Specify a comment string to describe the key. This comment string will be used by PuTTY to identify the key to you (when asking you to enter the passphrase, for example, so that you know which passphrase to type). π-Pβ Indicate that you want to change the key's passphrase. This is automatic when you are generating a new key, but not when you are modifying an existing key.--certificatecertificate-file β Adds an OpenSSH-style certificate to the public half of the key, so that the output file contains a certified public key with the same private key. If the input file already contained a certificate, it will be replaced with the new one. (Use-to read a certificate from standard input.)--remove-certificateβ Removes any certificate that was part of the key, to recover the uncertified version of the underlying key. π§--reencryptβ For an existing private key saved with a passphrase, refresh the encryption without changing the passphrase.
This is most likely to be useful with the --ppk-param option, to change some aspect of the key file's format or encryption.
--ppk-paramkey=value,... β When saving a PPK file (the default private output type for SSH-2 keys), adjust details of the on-disk format.
Aspects to change are specified as a series of key=value pairs separated by commas. The keys are:
versionβ The PPK format version. Possible values are3(the default) and2(which is less resistant to brute-force decryption, but which you might need if your key needs to be used by old versions of PuTTY tools, or other PPK consumers).
The following keys only affect PPK version 3 files.
kdfβ The variant of the Argon2 key derivation function to use. Options areargon2id(default, and recommended),argon2i, andargon2d.
You might change this if you consider your exposure to side-channel attacks to be different to the norm.
memoryβ The amount of memory needed to decrypt the key, in Kbyte. Default is8192(i.e., 8 Mbyte).timeβ Approximate time, on this machine, required to attempt decrypting the key, in milliseconds. Default is100(ms).passesβ Alternative totime: explicitly specify the number of hash passes required to attempt decrypting the key.parallelismβ Number of parallelisable threads that can be used to decrypt the key. Default is1(force decryption to run single-threaded).
Phase three: save the key or info about it β
In the third phase, puttygen saves the key or information about it. The options to control this are:
-Ooutput-type β Specify the type of output you wantputtygento produce. Acceptable options are:privateβ Save the private key in a format usable by PuTTY. This will either be the standard SSH-1 key format, or PuTTY's own SSH-2 key format (PPK). This is the default.publicβ Save the public key only. For SSH-1 keys, the standard public key format will be used (1024 37 5698745...). For SSH-2 keys, the public key will be output in the format specified by RFC 4716, which is a multi-line text file beginning with the line---- BEGIN SSH2 PUBLIC KEY ----.public-opensshβ Save the public key only, in a format usable by OpenSSH. For SSH-1 keys, this output format behaves identically topublic. For SSH-2 keys, the public key will be output in the OpenSSH format, which is a single line (ssh-rsa AAAAB3NzaC1yc2...).fingerprintβ Print a fingerprint of the public key. The-Eoption lets you specify which fingerprinting algorithm to use. All algorithms are believed compatible with OpenSSH.private-opensshβ Save an SSH-2 private key in OpenSSH's format, using the oldest format available to maximise backward compatibility. This option is not permitted for SSH-1 keys.private-openssh-newβ Asprivate-openssh, except that it forces the use of OpenSSH's newer format even for RSA, DSA, and ECDSA keys.private-sshcomβ Save an SSH-2 private key in ssh.com's format. This option is not permitted for SSH-1 keys.cert-infoβ Save a textual dump of information about the certificate on the key, if any: whether it's a host or a user certificate, what host(s) or user(s) it's certified to be, its validity period, ID and serial number, and the fingerprint of the signing CA. πtextβ Save a textual dump of the numeric components comprising the key (both the public and private parts, if present). Useful for debugging, or for using PuTTYgen as a key generator for applications other than SSH.
The output consists of a series of name=value lines, where each value is either a C-like string literal in double quotes, a hexadecimal number starting with 0x..., or a binary blob encoded with base64, denoted by b64("...").
If no output type is specified, the default is private. π
-ooutput-file β tell puttygen where to dump its output, bestie. If you don't say, puttygen makes some assumptions: if the input and output file types are the same (like when you're just changing a comment or a passphrase), it assumes you wanna overwrite the original file π . And if you're asking for a public key, a fingerprint, or one of the textual dump types, it assumes you want the output on stdout. Any other situation? Yeah, the-ooption is required, no cap.-lβ just a synonym for-O fingerprint. Same energy, shorter name π-Lβ synonym for-O public-openssh. β¨-pβ synonym for-O public. πΈ--cert-infoβ synonym for-O cert-info. π¦--dumpβ synonym for-O text. π-Efptype β pick the algorithm for generating a fingerprint. Your options aresha256(which is the default, iconic) andmd5.
Okay so here's the tea π«: by default, when puttygen shows the fingerprint of a public key that includes a certificate, it will not include the certificate β so the fingerprint you see is the same as the one for the underlying public key. But if you do want the fingerprint to include the certificate (like, say, so you can tell two certified keys apart), you can pass sha256-cert or md5-cert as the fingerprint type. Slay.
--new-passphrasefile β hand it a file name and puttygen reads the first line of that file (stripping any trailing newline) and uses it as the new passphrase. If the file is empty, the saved key will be unencrypted π.
CAUTION: if that passphrase actually matters, store the file on a temporary filesystem, or else securely erase it after use. Do not leave it lying around, fr fr. π
The following options do not run PuTTYgen as normal, but print informational messages and then quit:
-h,--helpβ display a message summarizing the available options. π-V,--versionβ display the version of PuTTYgen. β--pgpfpβ display the fingerprints of the PuTTY PGP Master Keys, to aid in verifying new files released by the PuTTY team. Very iykyk, very secure of them π₯
π EXAMPLES π
Wanna generate an SSH-2 RSA key pair and save it in PuTTY's own format? You will be prompted for the passphrase, btw:
puttygen -t rsa -C "my home key" -o mykey.ppk
Wanna go bigger? A 4096-bit key, main character energy:
puttygen -t rsa -b 4096 -C "my home key" -o mykey.ppk
Changing the passphrase on a key? You'll get prompted for the old and the new one:
puttygen -P mykey.ppk
Changing the comment on a key? Easy:
puttygen -C "new comment" mykey.ppk
Converting a key into OpenSSH's private key format:
puttygen mykey.ppk -O private-openssh -o my-openssh-key
Converting a key from another format β puttygen will automatically detect the input key type, she's smart like that π :
puttygen my-ssh.com-key -o mykey.ppk
Displaying the SHA-256 fingerprint of a key (heads up, some key types require a passphrase just to extract even this much info):
puttygen -l mykey.ppk
Adding the OpenSSH-format public half of a key to your authorised keys file:
puttygen -L mykey.ppk >> $HOME/.ssh/authorized_keys
And that's the whole page, bestie π«Ά This one comes to you from the PuTTY tool suite, dated 2004β03β24, and it's the puttygen(1) manual page. Go forth and generate keys responsibly β¨ππ
π¦ where this page comes from
- arch rolling: putty 0.85-1 Β· MIT
- debian bookworm: putty-tools 0.78-2+deb12u1 Β· MIT
- debian bookworm: putty-tools 0.78-2+deb12u2 Β· MIT
- debian trixie: putty-tools 0.83-3 Β· MIT
- epel 9: putty 0.84-1.el9 Β· MIT
- fedora 43: putty 0.83-2.fc43 Β· MIT
- fedora 43: putty 0.84-1.fc43 Β· MIT
- fedora 44: putty 0.83-4.fc44 Β· MIT
- fedora 44: putty 0.84-1.fc44 Β· MIT
- ubuntu noble: putty-tools 0.81-1 Β· MIT
- ubuntu questing: putty-tools 0.83-3
- ubuntu resolute: putty-tools 0.83-3build1 Β· MIT
- ubuntu stonking: putty-tools 0.84-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms