Say I have two computers connected to the same Wifi network. Let's call them computer-A & computer-B.
I am using computer-A, I can ping computer-B without issues.
Now, on computer-A, I have generated a new SSH key pair (but not the default id_rsa
pair which this computer already have). Let's call the keys : newkey
and newkey.pub
.
I would like to use ssh-copy-id
command to copy the newkey.pub
to computer-B.
I get confused at this point, in order to do above thing, does computer-B need to have a previously generated public key of keypair from computer-A in order to establish a SSH connection for the ssh-copy-id
to work?
Asking in another way, if computer-B doesn't have any public key at all from computer-A, would ssh-copy-id
still work?
I checked this ssh-copy-id doc, I wonder in their example ssh-copy-id -i ~/.ssh/mykey user@host
, is that ~/.ssh/mykey
a public key or private key?