I've generated key pairs using PuTTYgen and been logging in using Pageant, so that I have to enter my pass-phrase only once when my system boots.
How do I achieve this in Linux? I've heard of keychain
but I hear that it uses a different key pair format - I don't want to change my Windows keys and it would be nice if I could seamlessly connect in the same manner in both Windows and Linux.
If all you have is a public key from a user in PuTTY-style format, you can convert it to standard openssh format like so:
References
http://www.treslervania.com/node/408Copy of article
This will automatically install the puttygen tool.
Now to convert the PPK file to be used with SSH command execute the following in terminal
Then, you can connect via SSH with:
http://www.graphicmist.in/use-your-putty-ppk-file-to-ssh-remote-server-in-ubuntu/#comment-28603
It's probably easier to create your keys under linux and use PuTTYgen to convert the keys to PuTTY format.
PuTTY Faq: A.2.2
I think what TCSgrad was trying to ask (a few years ago) was how to make Linux behave like his Windows machine does. That is, there is an agent (pageant) which holds a decrypted copy of a private key so that the passphrase only needs to be put in once. Then, the ssh client, putty, can log in to machines where his public key is listed as "authorized" without a password prompt.
The analog for this is that Linux, acting as an ssh client, has an agent holding a decrypted private key so that when TCSgrad types "ssh host" the ssh command will get his private key and go without being prompted for a password. host would, of course, have to be holding the public key in ~/.ssh/authorized_keys.
The Linux analog to this scenario is accomplished using ssh-agent (the pageant analog) and ssh-add (the analog to adding a private key to pageant).
The method that worked for me was to use: $ ssh-agent $SHELL That $SHELL was the magic trick I needed to make the agent run and stay running. I found that somewhere on the 'net and it ended a few hours of beating my head against the wall.
Now we have the analog of pageant running, an agent with no keys loaded.
Typing $ ssh-add by itself will add (by default) the private keys listed in the default identity files in ~/.ssh .
A web article with a lot more details can be found here
Newer versions of PuTTYgen (mine is 0.64) are able to show the OpenSSH public key to be pasted in the linux system in the
.ssh/authorized_keys
file, as shown in the following image:puttygen
supports exporting your private key to an OpenSSH compatible format. You can then use OpenSSH tools to recreate the public key.Conversions->Export OpenSSH
and export your private key~/.ssh/id_dsa
(orid_rsa
).Create the RFC 4716 version of the public key using
ssh-keygen
Convert the RFC 4716 version of the public key to the OpenSSH format:
See this and this for more information.