I just recently started to use Google Cloud Platform and I'm using SSH for several purposes. As security is highly important in this project, I'm trying to figure out how the SSH authentication works (specifically with GCP). I'm following Google's instructions of how to generate and upload the RSA key to the instance in the cloud:
- I'm generating a public/private keys using PuTTyGen
- I'm uploading the public key to the instance
- The SSH connection is opened by loading the private key file in the client.
My confusion comes from the fact that I was sure that the server uses its private key for the key exchange but what is uploaded actually is the generated public key.
Can anyone please share his/her knowledge or a link to an article explaining how the key exchange works?