Google Associate Cloud Engineer Question 101
Select 2Google Cloud PlatformYou are managing a Google Cloud project, and you want to ensure that all VM instances use OS Login for better security and centralized access management. What steps should you take to enable OS Login for the VM instances in your project?
- A
A. Enable the 'Enable OS Login' metadata key at the project level.
- B
B. Set the 'Enable OS Login' metadata key at the instance level for each VM.
- C
C. Grant the 'roles/compute.osLogin' IAM role to users who need SSH access.
- D
D. Enable the 'Enable OS Login' feature in the VM instance's network settings.
Show answer and explanation
Correct answers: A, C
Explanation
To enable OS Login across all VM instances in a Google Cloud project, you should enable it at the project level using the metadata key 'Enable OS Login'. This ensures a consistent configuration across all instances. Additionally, you must assign the appropriate IAM roles to users to allow them access via OS Login. This provides a centralized way to manage SSH access and enhances security by tying access to IAM identities.
- A. Correct.
A. Correct. Enabling the 'Enable OS Login' metadata key at the project level applies OS Login to all instances within the project.
- B. Incorrect.
B. Incorrect. Setting the metadata key at the instance level is not necessary if it is already set at the project level. It's redundant for enabling OS Login for all instances.
- C. Correct.
C. Correct. Granting the 'roles/compute.osLogin' IAM role to users allows them to use OS Login for SSH access.
- D. Incorrect.
D. Incorrect. OS Login is not enabled through network settings of the VM instance; it's managed via IAM roles and metadata.