ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 210 - Associate Cloud Engineer discussion

Report
Export

You have a number of compute instances belonging to an unmanaged instances group. You need to SSH to one of the Compute Engine instances to run an ad hoc script. You've already authenticated gcloud, however, you don't have an SSH key deployed yet. In the fewest steps possible, what's the easiest way to SSH to the instance?

A.
Run gcloud compute instances list to get the IP address of the instance, then use the ssh command.
Answers
A.
Run gcloud compute instances list to get the IP address of the instance, then use the ssh command.
B.
Use the gcloud compute ssh command.
Answers
B.
Use the gcloud compute ssh command.
C.
Create a key with the ssh-keygen command. Then use the gcloud compute ssh command.
Answers
C.
Create a key with the ssh-keygen command. Then use the gcloud compute ssh command.
D.
Create a key with the ssh-keygen command. Upload the key to the instance. Run gcloud compute instances list to get the IP address of the instance, then use the ssh command.
Answers
D.
Create a key with the ssh-keygen command. Upload the key to the instance. Run gcloud compute instances list to get the IP address of the instance, then use the ssh command.
Suggested answer: B

Explanation:

gcloud compute ssh ensures that the user's public SSH key is present in the project's metadata. If the user does not have a public SSH key, one is generated using ssh-keygen and added to the project's metadata. This is similar to the other option where we copy the key explicitly to the project's metadata but here it is done automatically for us. There are also security benefits with this approach. When we use gcloud compute ssh to connect to Linux instances, we are adding a layer of security by storing your host keys as guest attributes. Storing SSH host keys as guest attributes improve the security of your connections by helping to protect against vulnerabilities such as man-in-the-middle (MITM) attacks. On the initial boot of a VM instance, if guest attributes are enabled, Compute Engine stores your generated host keys as guest attributes.

Compute Engine then uses these host keys that were stored during the initial boot to verify all subsequent connections to the VM instance.

Ref:https://cloud.google.com/compute/docs/instances/connecting-to-instance Ref:https://cloud.google.com/sdk/gcloud/reference/compute/ssh

asked 18/09/2024
Hassene SAADI
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first