
Answer-first summary for fast verification
Answer: Directly use the `gcloud compute ssh` command to connect.
The correct answer is **B** because `gcloud compute ssh` is the most straightforward and efficient method to establish an SSH connection. It automatically handles key generation and adds the key to the project's metadata for authentication. This command simplifies the process by eliminating the need for manual key management and IP address lookup, making it the quickest way to connect. For more details, refer to the GCP documentation on `gcloud compute ssh`.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You need to connect to one of your Compute Engine instances using SSH. You’ve already authenticated gcloud, but you don’t have an SSH key deployed yet. What’s the quickest method to establish an SSH connection?
A
Generate a key using the ssh-keygen command, upload it to the instance, list instances with gcloud compute instances list to find the IP, then connect using the ssh command.
B
Directly use the gcloud compute ssh command to connect.
C
First, create a key with ssh-keygen, then use gcloud compute ssh to connect.
D
List instances with gcloud compute instances list to get the IP address, then connect using the ssh command.
No comments yet.