Ssh – Copy the rsa keys from one machine to another

rsassh

Someone asked me to provide my public id_rsa key to make be able to connect to their server via ssh. I did so and it's working fine. I want to do that from my another laptop as well without having to bother them. If I just copy a public and a private keys from my first laptop to the second one, will it allow me to connect to the server? Note I already have a private and public rsa keys on my second laptop that are, of course, different from the ones from the first laptop.

What's the best way to do so – copy the keys?

Best Answer

You can manually add the public key for your second laptop to the server. Just edit the .ssh/authorized_keys file in your home directory and append your second public key.

To get this, on your second laptop, run

cat .ssh/id_rsa.pub