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?
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
You can copy your key (both id_rsa and id_rsa.pub) to you server B with a new name like serverA_key and serverA_key.pub to connect from serverB with this key you can give ssh the path to your new key
or add this to your .ssh/config on serverB