
Answer-first summary for fast verification
Answer: Format all keys into a file according to the required specifications and use the `gcloud compute instances add-metadata` command to upload the keys to each instance.
The most efficient method is to format all SSH keys into a single file according to Google Cloud's metadata requirements and then use the `gcloud compute instances add-metadata` command to upload them to the specific Bastion host instance. This approach allows for the deployment of multiple keys in a single operation, ensuring they are securely stored and accessible to the VM without manual intervention for each key. Here’s a brief overview of the steps: 1. **Create a Metadata File**: Prepare a text file (e.g., `metadata.txt`) formatted with the SSH keys according to Google Cloud’s specifications, including the key type and the public key itself. 2. **Upload the Metadata**: Execute the `gcloud compute instances add-metadata` command to upload the metadata file to the designated instance, thereby adding the SSH keys to the instance’s metadata for VM access.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You’ve been tasked with deploying all of your team’s public SSH keys to a specific Bastion host instance in a particular Google Cloud project. You’ve collected all the keys. What is the simplest method to deploy these keys with the fewest steps?
A
Format all keys into a file according to the required specifications and use the gcloud compute project-info add-metadata command to upload the keys.
B
Format all keys into a file according to the required specifications and use the gcloud compute instances add-metadata command to upload the keys to each instance.
C
Use the gcloud compute ssh command to upload all the keys directly.
D
Manually format each key as needed and upload them one at a time through the Google Cloud Console interface.