Ssh public and private key generation
- 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 under Linux
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:
Key conversion using Putty
With Putty Key Generator,
puttygen.exe, you can load either Putty keys or OpenSSH ones.
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.