Allow only users in the dev1 group SSH access to a single Compute Engine instance in a project. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Set metadata enable-oslogin=true on the instance, grant the dev1 group the compute.osLogin role, and direct them to use Cloud Shell to ssh to the instance..
Why this is the answer
The correct option leverages OS Login, which integrates Compute Engine SSH access with IAM. By setting enable-oslogin=true on the instance, you enable OS Login. Granting the compute.osLogin role to the dev1 group allows its members to SSH into the instance. Cloud Shell provides a convenient, pre-authenticated environment for users to connect. The other options are incorrect because: Setting the service account to "no service account" doesn't manage user SSH access. Generating and distributing SSH keys manually is less secure and scalable than OS Login, and it doesn't directly integrate with IAM groups for access control. While block project-wide keys is a good security practice, it doesn't solve the problem of granting group-based access efficiently.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed