You need to ensure your personal SSH key works on every instance in your project. You want to accomplish this as efficiently as possible. What should you do?
A.
Upload your public ssh key to the project Metadata.
B.
Upload your public ssh key to each instance Metadata.
C.
Create a custom Google Compute Engine image with your public ssh key embedded.
D.
Use gcloud compute ssh to automatically copy your public ssh key to the instance.
Correct Answer is (A)
Overview
By creating and managing SSH keys, you can let users access a Linux instance through third-party tools.
An SSH key consists of the following files:
A public SSH key file that is applied to instance-level metadata or project-wide metadata.
A private SSH key file that the user stores on their local devices.
If a user presents their private SSH key, they can use a third-party tool to connect to any instance that is configured with the matching public SSH key file, even if they aren't a member of your Google Cloud project. Therefore, you can control which instances a user can access by changing the public SSH key metadata for one or more instances.
https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#addkey
Project metadata applies to all instances in the project, so uploading your SSH public key here will automatically allow SSH access to every instance in the project without needing to modify each instance individually.
A. Upload your public SSH key to the project Metadata.
This option involves adding your SSH key to the project-level Metadata. Instances in the project can then access this Metadata to retrieve the SSH key during startup.
The question ask to ensure your ssh key can work for EVERY instance in your PROJECT...
Answer is A:
https://cloud.google.com/compute/docs/connect/add-ssh-keys#add_ssh_keys_to_project_metadata
C. Create a custom Google Compute Engine image with your public ssh key embedded. This would ensure that every instance launched from this image will have your SSH key installed, and you wouldn't need to manually upload the key to each instance or copy it over using gcloud compute ssh. This is the most efficient option as it saves time and eliminates the possibility of human error.
Option D can work, but it requires you to manually run the command for each instance, which can be tedious and error-prone if you have many instances to configure.
Option A is not the most secure option because it grants access to all instances in the project to anyone who has access to the metadata. It is better to use instance metadata to configure specific settings for individual instances.
Option B can work, but it requires you to upload your SSH key to each instance metadata, which can be time-consuming if you have many instances to configure.
You've missed the point... It asked for ssh key for EVERY instance in the PROJECT...
Answer is A
https://cloud.google.com/compute/docs/connect/add-ssh-keys#add_ssh_keys_to_instance_metadata
I also think about A, because the question doesn't mention the security issues, and it mentioned that "every instance in your project" + "efficiently". If build a custom image, i don't think it is efficient.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ESP_SAP
Highly Voted 4 years agoAzureDP900
1 year, 11 months agosaraali
Most Recent 2 months, 2 weeks agoxhilmi
10 months, 2 weeks agodidek1986
1 year, 2 months agodesertlotus1211
1 year, 5 months agodesertlotus1211
8 months, 2 weeks agoKomal697
1 year, 7 months agodesertlotus1211
1 year, 5 months agodesertlotus1211
1 year, 5 months agopk349
1 year, 9 months agoMr_MIXER007
2 years ago[Removed]
2 years, 8 months agokumarp6
2 years, 10 months agoMorgan91
3 years agoVidyasagar
3 years, 7 months agoArizonaClassics
3 years, 7 months ago[Removed]
3 years, 11 months agoGANESH1985
3 years, 10 months agoKWatHK
3 years, 9 months agomajun
3 years, 11 months agomajun
3 years, 11 months ago