canonical: https://jentic.com/apis/googleapis.com/oslogin

# Google Cloud OS Login API

The Cloud OS Login API manages SSH access to Google Compute Engine VMs through IAM identities rather than per-VM key files. It exposes the user's login profile (POSIX username, UID/GID, secondary aliases) and lets administrators import, delete, and update SSH public keys associated with that identity. Use it to centralise SSH access management, remove a former employee's keys across all VMs at once, or build automation that issues short-lived SSH keys to engineers. The spec exposes 6 endpoints.

## For AI agents

Manage SSH key bindings and POSIX login profiles for Google Cloud users so VM access flows through IAM rather than per-host key files.

## Scope

Does not authenticate SSH sessions, manage VM metadata, or create user accounts - use for SSH key bindings and POSIX login profile reads only.

## Capabilities

- Read a user's OS Login profile including POSIX username, UID, and home directory
- Import a new SSH public key for an authenticated Google identity
- Delete an SSH public key when an employee leaves or rotates credentials
- Update an existing SSH public key's expiry or fingerprint metadata
- List the SSH public keys currently associated with a user account
- Resolve a Google identity to its POSIX login profile across the project's VM fleet

## Use cases

### Centralised SSH key lifecycle

Replace per-VM SSH key files with IAM-driven access by importing each engineer's public key once via OS Login. The API binds the key to a Google identity, and every VM with OS Login enabled accepts it automatically. Removing a key removes access fleet-wide - a single source of truth for SSH access management.

Example prompt: Import a new SSH public key for user alice@example.com via POST /v1/{+parent}:importSshPublicKey and confirm by listing the keys on her login profile.

### Rapid revocation on offboarding

When an engineer leaves, delete their SSH public keys via OS Login to revoke access from every VM that uses OS Login at once. The alternative - pruning authorized_keys files VM by VM - is slow and error-prone. This use case turns access revocation into a single API call instead of an audit project.

Example prompt: List all SSH public keys for user bob@example.com via GET /v1/{+name}/loginProfile and DELETE /v1/{+name} for each fingerprint to revoke fleet access.

### Short-lived SSH keys for engineers

Issue short-lived SSH public keys that expire after a defined interval, and let the OS Login API enforce the expiry across the fleet. The expirationTimeUsec field on imported keys means an automation can mint a key valid for a few hours, ship it to the engineer's local agent, and never need to remember to revoke it.

Example prompt: Import an SSH public key for user alice@example.com with expirationTimeUsec set to 4 hours from now via POST /v1/{+parent}:importSshPublicKey.

### Agent-driven SSH access management via Jentic

An access agent reacting to a JIT request - for example, an engineer asking for VM access via Slack - can use Jentic to import a key with the correct expiry and reply with the VM hostname. Credentials stay in your Jentic One instance, so the agent runs under scoped admin tokens with audit trail.

Example prompt: Use Jentic to find the import-ssh-key operation, load its schema, and import a public key for the requesting user with a 60-minute expiry.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v1/{+name}/loginProfile | Get the user's OS Login profile |
| POST | /v1/{+parent}:importSshPublicKey | Import an SSH public key |
| POST | /v1/{+parent}/sshPublicKeys | Create an SSH public key entry |
| PATCH | /v1/{+name} | Update an SSH public key's metadata |
| DELETE | /v1/{+name} | Delete an SSH public key |

## Key resources

- **loginProfile** — POSIX login profile including username, UID, and SSH key bindings
- **sshPublicKeys** — SSH public keys associated with a Google identity

## Why Jentic

- **Setup:** Wiring the Cloud OS Login API by hand means configuring Google OAuth 2.0 from a service account, minting scoped tokens, and managing SSH key and login-profile resource paths against oslogin.googleapis.com yourself. Through Jentic you install once, import the Cloud OS Login API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The Cloud OS Login API puts the profile and SSH key in the URL path (/v1/{+name}/loginProfile, /v1/{+parent}:importSshPublicKey), so a rule can pin your agent to one login profile: it can read the profile and import SSH keys there and nothing else. You choose the operations it may call, so destructive ones like SSH key deletion are not included unless you add them.
- **Credential handling:** Your Google OAuth credential for the Cloud OS Login API is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'import an SSH key' or 'read a POSIX login profile', and Jentic returns the matching OS Login operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Identity and Access Management API** — IAM grants the roles that allow a user to log into a VM via OS Login
- **Compute Engine API** — Compute Engine owns the VM instances that OS Login keys grant access to
- **Cloud Identity API** — Cloud Identity manages user accounts; OS Login binds those identities to POSIX SSH access

## FAQ

### What authentication does the Cloud OS Login API use?

The API uses Google OAuth 2.0 with the cloud-platform or compute scope, plus the relevant OS Login admin or self-management role. Through Jentic, tokens come from a service account in your Jentic One instance.

### Can I delete an SSH key for a user who has left?

Yes. List the user's keys via GET /v1/{+name}/loginProfile, then DELETE /v1/{+name} for each public key fingerprint. The change propagates to every VM that uses OS Login.

### What are the rate limits for the OS Login API?

Google Cloud meters profile reads and key writes under per-project quotas. Bulk imports should batch and back off; treat key propagation to VMs as eventually consistent in the order of seconds.

### How do I import an SSH key through Jentic?

Search Jentic for import ssh public key, load the schema for POST /v1/{+parent}:importSshPublicKey, and execute it with the public key and an optional expirationTimeUsec. Jentic returns the resulting profile so the agent can confirm the binding.

### Does this API authenticate the SSH session itself?

No - actual SSH authentication happens on each VM by the OS Login PAM module, which validates the inbound key against this API's bindings. This API only stores the bindings and profile data.

### How do I find a user's POSIX username?

Call GET /v1/{+name}/loginProfile with the user resource name and read the posixAccounts field; each entry includes the username and UID assigned for OS Login.

### Can I limit what my agent is allowed to do with the Cloud OS Login API?

Yes. Because Jentic One is self-hosted, your own rules decide which operations and credentials the agent may use, and the Cloud OS Login API carries the profile and key in the URL path, so you can pin the agent to a single login profile and let it read that profile and import SSH keys there and nothing else. You choose the operations it may call, so destructive ones such as deleting an SSH public key stay out of reach unless you explicitly add them. The Google OAuth credential is stored once by your own instance and injected at execution time, never entering the agent's prompt or logs.
