1 Answers
You asked, is it due to the fact that we did not create any credentials for the compute instances as a result public and private keys is not created?
and the answer is Yes
. 🙂
The gcloud compute ssh
command that we ran in the lab is not doing anything entirely special, but it is conveniently doing a number of important steps that we would have had to do manually, ourselves, otherwise. It did the following:
Generated the public/private key pair;
Set the public key in the metadata, so that the instance would accept it; and then
Ran the normal
ssh
command with the right options–namely the public IP address of the instance (just like we had done before) and the private key file (which didn’t exist when we ranssh
directly, ourselves).
Does this help clarify? It might be useful to both rewatch and redo the lab. Oh, and also, when you get to the Basic Services Challenge Lab Data Flow lecture, I describe in a bit more detail how the SSH public key data flows to the instance.
Anyway, now that you’ve gone through the lab, go ahead and try to run the ssh
command manually with the right options. Note that you’ll need to pay attention to a few extra options (like the user name), too, but I think you’ll find it to be an enlightening challenge. And if you get stuck, try to research the issue, first–and then if you’re still stuck, ask here on the forum with a description of the problem and what you’ve tried.
Cheers!
Mattias