How to Configure Google Compute Engine SSH Certificate

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a google compute engine ssh certificate by signing user keys with a central authority key. Then you tell the target virtual machine to trust that central authority key. Teams often start by copying raw public keys to every cloud server. That manual habit breaks down fast as your server fleet grows. People leave the team, and old static keys stay on disks forever. Broad system roles also give users too much power across all servers. How a google compute engine ssh certificate works

SSH Certificates + Certificate-Based Authentication: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up a google compute engine ssh certificate by signing user keys with a central authority key. Then you tell the target virtual machine to trust that central authority key. Teams often start by copying raw public keys to every cloud server. That manual habit breaks down fast as your server fleet grows. People leave the team, and old static keys stay on disks forever. Broad system roles also give users too much power across all servers.

How a google compute engine ssh certificate works

OpenSSH added user and host certificates back in version 5.4. An OpenSSH certificate is much simpler than a standard web TLS certificate. It bundles a public key, an identity string, principal names, and options. A central Certification Authority key signs all of this data together. You use standard OpenSSH key tools to create this signed file.

First, your security team creates a dedicated authority key pair. They keep the private half safe and never put it on servers. Next, an engineer generates a normal personal SSH key pair. The authority signs the engineer public key to make a user certificate. During signing, the authority embeds a key identity string for audit logs. The authority also lists one or more principal names on the certificate. These principals match the Linux user accounts on your cloud machines. You can also set a time window so the certificate expires soon. If you skip the time window, the certificate stays valid forever.

On the Google Compute Engine side, each Linux virtual machine runs an SSH daemon. You place the public half of your authority key on each machine. Then you update the SSH daemon settings to trust that authority file. When an engineer connects, they send their signed certificate to the server. The server checks the signature against the trusted authority public key. It also checks that the time window is still valid today. If the principal matches the requested Linux user, the login succeeds. You no longer need to push individual user keys to every host.

Why you should also verify host certificates

User certificates solve half of the login trust problem. You can also sign host keys to protect your engineers from fake servers. The authority signs a server public key and marks it as a host certificate. That host certificate holds the server host names in its principal list. Engineers add the authority public key to their local known hosts file. Their client then trusts any Google Compute Engine machine with a valid signature. Nobody sees scary unknown host warnings when new cloud machines spin up.

SSH Certificates + Certificate-Based Authentication: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native SSH certificates solve and what they leave open

A google compute engine ssh certificate fixes static key sprawl across your project. You do not have to scrub old keys from dozens of virtual machines. Short validity windows help limit the risk of a stolen laptop key. The embedded key identity also writes a clear name into system login logs.

Still, certificate checks stop the moment the shell session begins. The SSH daemon only decides who can log into the Linux account. Once inside, the user has full access to that local account. If two engineers share a generic admin principal, shell history mixes their work. Standard login checks cannot inspect or block destructive shell commands in flight. Also, local tools inside the server can still print sensitive data to the screen. If an engineer queries a local file, raw emails or phone numbers appear unmodified. Certificates handle initial entry, but they do not govern live command execution.

Inspect one-shot SSH commands and file tasks

SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an inline open-source SSH listener on the host where engineers and AI agents keep their normal ssh, sftp, and scp tools. On every production command or file operation, hoop.dev decides whether to pass, mask, block, or hold it for approval.

First, hoop.dev guardrails check one-shot commands and file paths before they run, and hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.

Frequently asked questions

How does an OpenSSH certificate differ from a TLS certificate?

OpenSSH uses its own custom format that is much simpler than X.509. It holds a public key, identity text, principals, and options signed by an authority.

What happens if I do not set an expiration time when signing?

OpenSSH certificates remain valid forever unless you specify a validity window during signing. Always set a short validity window so stolen certificates stop working on their own.

Do I still need to manage individual public keys on each VM?

No, the virtual machine only needs the single public key of your signing authority. Once the SSH daemon trusts that authority, it accepts any valid certificate it signs.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.