Topic 1 Question 7
All the instances in your project are configured with the custom metadata enable-oslogin value set to FALSE and to block project-wide SSH keys. None of the instances are set with any SSH key, and no project-wide SSH keys have been configured. Firewall rules are set up to allow SSH sessions from any IP address range. You want to SSH into one instance. What should you do?
Open the Cloud Shell SSH into the instance using gcloud compute ssh.
Set the custom metadata enable-oslogin to TRUE, and SSH into the instance using a third-party tool like putty or ssh.
Generate a new SSH key pair. Verify the format of the private key and add it to the instance. SSH into the instance using a third-party tool like putty or ssh.
Generate a new SSH key pair. Verify the format of the public key and add it to the project. SSH into the instance using a third-party tool like putty or ssh.
ユーザの投票
コメント(17)
Correct answer A . D is incorrect - it mentions that you are adding the ssh key to the project, but the question says "block project-wide SSH keys." therefore that ssh key will not be added to the instance.
👍 16iloveme2020/10/07A is worked, I have tested as below
- Created VM
- Set enable-oslogin FALSE ( in compute engine metadata) as well in VM's metadata
- None of the instances are set with any SSH key, and no project-wide SSH keys have been configured (set block project wide ssh key on VM)
- firewall allow for tcp:22
- Try to ssh from cloud shell and web console, worked able to ssh into VM
👍 12aa_desh2021/09/08I think its A. The key inference here is you want to access one instance temporarily and we are assuming you are a gcloud or console user with instance admin permissions. Using cloud shell or cloud ssh a temporary private key is generated on-demand and held in the browser. The corresponding public key is created and added to project wide or instance specific metadata. The public key has additional information associated with it, including an expiry timestamp, which renders it invalid after a few minutes. The public key is set on the project's metadata unless the instance to which you're connecting via SSH has the "block project wide SSH keys" attribute set; in that case, the public key is set on the instance's metadata.
D is wrong as you would allow access to all instances. C would work but it requires the user to manage the key pairs
- When you SSH using the gcloud tool (for example, gcloud compute ssh) [4], you have to be authenticated to the gcloud tool as a compute instance admin
👍 3JoeShmoe2021/05/28
シャッフルモード