Review VM instance OS Login settings

Check effective OS Login settings together with SSH access permissions.

Description

VM metadata enable-oslogin: "false" overrides the project’s OS Login default for that instance. Omitting the VM value allows the project setting to apply.

Potential impact

Separately managed keys and local accounts can delay revocation. Switching authentication before administrators have the right roles can also lock them out.

Remediation

For a supported Linux VM, first grant the required OS Login roles and permission to use any attached service account. Set the VM metadata value to "true", or remove its false override if the project already enables OS Login. Test a new administrator connection through OS Login because metadata SSH keys no longer apply.

Examples

These historical Deployment Manager excerpts show only the metadata strings. Standard support has ended. Apply the setting with a supported tool and supply the remaining VM requirements, including a compatible image and network.

Before

yaml
resources:
  - name: vm
    type: compute.v1.instance
    properties:
      metadata:
        items:
          - key: enable-oslogin
            value: "false"

After

yaml
resources:
  - name: vm
    type: compute.v1.instance
    properties:
      metadata:
        items:
          - key: enable-oslogin
            value: "true"

References