I remember there is a command to send public key to the remote host that I want. I want to use that feature to send one of my public keys to the other host. How can I do that?
You are looking for ssh-copy-id
. All this command does is create .ssh
and .ssh/authorized_keys
and set their permissions appropriately if they don't exist. Then it appends your public key to the end of .ssh/authorized_keys
.