Easy way to transfer a private key to another machine?

5

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?

update

Don't do this! (see answer)

John Bachir

Posted 2011-09-26T21:52:23.053

Reputation: 1 169

+1 for reminding me to use ssh-copy-id to copy a public key – rymo – 2011-10-17T01:57:59.077

Answers

6

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).

Greg Hewgill

Posted 2011-09-26T21:52:23.053

Reputation: 5 099

ah okay, true :) – John Bachir – 2011-09-27T17:28:18.120