PROFESSIONAL-CLOUD-NETWORK-ENGINEER · Question #61
All the instances in your project are configured with the custom metadata enable-oslogin value set to FALSE and to block project-wide SSH keys. None of the instances are set with any SSH key, and no p
The correct answer is A. Open the Cloud Shell SSH into the instance using gcloud compute ssh.. The command gcloud compute ssh (run from Cloud Shell or any authenticated environment) works by temporarily injecting your public SSH key into the instance's metadata at the instance level, then connecting. Even though project-wide SSH keys are blocked, gcloud compute ssh injects
Question
Options
- AOpen the Cloud Shell SSH into the instance using gcloud compute ssh.
- BSet the custom metadata enable-oslogin to TRUE, and SSH into the instance using a third-party
- CGenerate a new SSH key pair. Verify the format of the private key and add it to the instance.
- DGenerate a new SSH key pair. Verify the format of the public key and add it to the project.
How the community answered
(35 responses)- A83% (29)
- B9% (3)
- C3% (1)
- D6% (2)
Explanation
The command gcloud compute ssh (run from Cloud Shell or any authenticated environment) works by temporarily injecting your public SSH key into the instance's metadata at the instance level, then connecting. Even though project-wide SSH keys are blocked, gcloud compute ssh injects keys at the instance metadata level, which is still permitted. OS Login being FALSE is fine - gcloud works with the legacy metadata-based SSH mechanism. Option C is wrong because you add the PUBLIC key to instance metadata, not the private key. Option D fails because project-wide SSH keys are explicitly blocked. Option B would work but requires changing the OS Login configuration, adding unnecessary operational steps.
Topics
Community Discussion
No community discussion yet for this question.