# Require OS Login

Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.

Require OS Login is a Google Cloud guardrail written in organization Policy Service. Enables OS Login on all newly created projects and blocks metadata updates that disable OS Login at the project or instance level. No documented way to test it before enforcement was found on 10 Nov 2026.

```text
constraints/compute.requireOsLogin
This boolean constraint, when enforced, enables OS Login on all newly created Projects. All VM instances created in new projects will have OS Login enabled. On new and existing projects, this constraint prevents metadata updates that disable OS Login at the project or instance level.
By default, the OS Login feature is disabled on Compute Engine projects.
```

- **Blocks:** Enables OS Login on all newly created projects and blocks metadata updates that disable OS Login at the project or instance level. (legacy managed constraint, boolean.)
- **Breaks:** Google documents that setting OS Login metadata deletes the VM authorized_keys files and VMs no longer accept SSH keys stored in project or instance metadata. ([source](https://cloud.google.com/compute/docs/oslogin/set-up-oslogin))
- **Test before applying:** As for every Organization Policy Service guardrail: [how to test before enforcing](/mechanisms/org-policy/)
- **Mechanism:** [Organization Policy Service (managed and legacy constraints)](/mechanisms/org-policy/): Resources in the organization, folder or project where the policy is set and its descendants; Google says application of new policies is usually not retroactive.
- **Taken from:** [provider documentation](https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints), provider documentation

## What the source says

"This boolean constraint, when enforced, enables OS Login on all newly created Projects." (read 10 Nov 2026).

On what it breaks: "When you set OS Login metadata, Compute Engine deletes the VM's authorized_keys files and no longer accepts connections from SSH keys that are stored in project or instance metadata."

## Related guardrails

- [Prevent root credentials management in member accounts](/guardrails/aws-scp-deny-member-root-credentials/): AWS, Service control policies (SCPs), identity and privilege
- [Deny the root user except for S3 bucket policy changes](/guardrails/aws-scp-deny-root-except-s3-bucket-policy/): AWS, Service control policies (SCPs), identity and privilege
- [Deny critical IAM user actions](/guardrails/aws-scp-deny-critical-iam-user-actions/): AWS, Service control policies (SCPs), identity and privilege
- [Disable service account key creation](/guardrails/gcp-orgpolicy-disable-sa-key-creation/): Google Cloud, Organization Policy Service (managed and legacy constraints), identity and privilege
- [Disable automatic IAM grants for default service accounts](/guardrails/gcp-orgpolicy-no-auto-iam-grants-default-sa/): Google Cloud, Organization Policy Service (managed and legacy constraints), identity and privilege
- [Deny service account key create and delete to a group on one project](/guardrails/gcp-deny-service-account-key-admin/): Google Cloud, IAM deny policies, identity and privilege

## Related pages

- [Deny service account key create and delete to a group on one project (Google Cloud IAM deny policies)](/guardrails/gcp-deny-service-account-key-admin/)
- [Domain restricted sharing (Google Cloud Organization Policy Service)](/guardrails/gcp-orgpolicy-domain-restricted-sharing/)
- [Service perimeter around managed services (Google Cloud VPC Service Controls)](/guardrails/gcp-vpcsc-service-perimeter/)

## Sources

- Require OS Login: https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints (read 10 Nov 2026)
- What it breaks: https://cloud.google.com/compute/docs/oslogin/set-up-oslogin (read 10 Nov 2026)
- How to test it first: https://cloud.google.com/resource-manager/docs/organization-policy/dry-run-policy (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/guardrails/gcp-orgpolicy-require-os-login/
