i am logging onto ssh server from my laptop and i have my private key there but i would like to logon also from my desktop at home, so how can i copy the key?
OS: ubuntu
i am logging onto ssh server from my laptop and i have my private key there but i would like to logon also from my desktop at home, so how can i copy the key?
OS: ubuntu
You should generate and use a separate key on each client.
Although it's written in regards to using the ssh keys for scp in batch mode, this article is the one I always refer back to to refresh my memory about ssh keys. It's very clear and very short.
as SuperJames said, the best answer is
ssh-copy-id
; but note that it doesn't do what you're asking, it does what you should do: use a different key pair and install both on the server.that way, if your laptop gets compromised, you just have to delete that public key from the server(s).
ssh private keys should never be shared, not even with yourself.
If you already have a public/private key pair generated, then use the "ssh-copy-id" command. I believe that it comes with OpenSSH.
see "man ssh-copy-id" for more information.