ssh-copy-id makes it easy to transfer a public key to a remote machine.

Is there any equivalent tool for moving a private key?


Don't do this! (see answer)

  • +1 for reminding me to use ssh-copy-id to copy a public key
    – rymo
    Oct 17, 2011 at 1:57

1 Answer 1


Good practice says that you shouldn't copy private keys from one machine to another. When you need access from a new client machine, create a new key on that machine, and set up the corresponding public key in your ~/.ssh/authorized_keys file on the server.

Doing this allows you to disable access from one client machine at a time, if you need to (suppose a laptop was stolen, for example).

  • ah okay, true :) Sep 27, 2011 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.