Ssh public and private key generation

From Wiki Adele Team
Jump to: navigation, search


  • Under Windows, you may use Putty to generate and use ssh keys.
  • Under Linux, it's Open SSH

The problem is that the files generated using Putty and Open SSH are not the same... but it's possible to convert on format to another!

Key Generation

Key generation under Linux

Use the ssh-keygen command. A typical command is ssh-keygen -b 1024 -t rsa to generate a 1024 bytes keys with ssh2-rsa type.

Of cource, you can do much more with this command. Run man ssh-keygen to learn everything!

Key generation under Windows

Very easy, just use the Putty Key Generator: puttygen.exe!

Key convertion

Key conversion using Putty

With Putty Key Generator, puttygen.exe, you can load either Putty keys or OpenSSH ones.

  • Select conversions > Import key
  • Type pass phrase

Then, you just need to save your key!

  • Click on Save public key or Save private Key to save keys using Putty format;
  • Copy the content of the text area to save your public key using OpenSSH format.

Key conversion under Linux

ssh-keygen -i -f KEYFILE This command dectects the KEYFILE format, and outputs the OpenSSH key on the standard output.

See Also