It may be better to generate the key on the client system(s). You may end up with a larger authorized_keys file, but it is easier to disable a compromised system. If you migrate the server's private key, you will need to regenerate and migrate the key to all the client systems. Each client should have it's own key.
Putty uses puttygen
to generate the key. puttygen
will also provide the public key in the correct format for pasting into the client system. It is best to protect the key with a passphrase if it is being used for login access. Pageant
or ssh-agent
can be used to hold the unprotected key in memory so that the passphrase does not need to be reentered on each connection.
Once you have added one key and set the protection, you can add additional keys with needing to reset the permissions. I usually upload the public key from the system with a name like example.pub
where example is the name of the system the key belongs to.
Many implementations have returned to using authorized_keys
as the key file. This file can be used to restrict the system the key will be accepted from, force a command to be run, limit access, and other things. View the man
page for more details.
In some cases, it may be useful to have multiple keys on client system. This can be done to support batch processes which run with keys which don't have a password.