
Answer-first summary for fast verification
Answer: Compile all keys into a properly formatted file and use the `gcloud compute project-info add-metadata` command to upload them project-wide.
The correct approach is **B** because project-wide SSH keys enable users to access all instances within a project that permit such keys. This method is efficient as it applies the keys across the entire project with a single command. If an instance blocks project-wide keys, users can still access it if their key is added to the instance's metadata. The command `gcloud compute project-info add-metadata --metadata-from-file ssh-keys=[LIST_PATH]` is used for this purpose. - **Option A** is incorrect because it only affects a single instance at a time, not the entire project. - **Option C** is incorrect as `gcloud compute ssh` is designed for connecting to instances, not for uploading SSH keys. - **Option D** is incorrect due to the inefficiency and lack of a user interface option for bulk uploading SSH keys.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your team needs to deploy all public SSH keys to every instance in a specific Google Cloud project. You've gathered all the keys. What's the most efficient method to deploy these keys with minimal steps?
A
Format the keys as required and use the gcloud compute instances add-metadata command to upload them to each instance individually.
B
Compile all keys into a properly formatted file and use the gcloud compute project-info add-metadata command to upload them project-wide.
C
Utilize the gcloud compute ssh command for uploading all the keys directly.
D
After formatting the keys appropriately, upload each one manually through the user interface.
No comments yet.