Questions about ssh

Lets say a brand new user types:

ssh-keygen

then:

ssh-copy-id -i remoteServerLocation.com

What all happens on the server side? For instance, obviously the id_rsa.pub key is copied to the servers "authorized_keys" file but what else happens?
Is anything added to the servers "known_hosts" file?

My account on the server side has 4 files @ ~/.ssh: "authorized_keys", "id_rsa", "id_rsa.pub" and "known_hosts". Why does it have id_rsa and id_rsa.pub? Were those
generated when I ran the ssh-copy-id command or were they generated when someone from it ran ssh-cop-id on the server side?

known_hosts is for the client side ssh-copy-id will not change the servers known_hosts file

id_rsa and id_rsa.pub are generated by ssh-keygen on the server side, these would be used to another servers by sharing id_rsa.pub with this other machine. They are not touched by clients running ssh-copy-id

1 Like