Skip to main content

Security

Zero Trust SSH Access: Short-Lived Certificates vs Static Key Pairs

Static SSH keys that live on developer laptops for years are the silent security debt of modern infrastructure. Short-lived certificates eliminate implicit trust but require a certificate authority infrastructure. This article explains both models and the operational tradeoffs.

4 minute read

The Problem with Static SSH Key Pairs

A static SSH private key created in 2019 and still authorized on a production server in 2026 represents seven years of accumulated implicit trust. During that period, the laptop holding the key may have been replaced, the engineer may have left the organization, the key may have been backed up to insecure locations, or the authorized_keys file may have grown to include keys no one can audit.

Key rotation is operationally difficult because there is no centralized registry of where a given public key has been authorized. Revoking a compromised key requires SSHing into every server that might have it in authorized_keys — a manual process that scales poorly across fleets of hundreds or thousands of hosts.

Zero Trust access principles require treating every access request as potentially hostile regardless of network location. Static keys fundamentally violate this principle because a stolen key can be used indefinitely until manually revoked across every server that trusts it.

How Short-Lived SSH Certificates Work

SSH certificates extend the public key authentication model by adding a validity window, a list of permitted principals (usernames), and an optional set of extensions and critical options — all signed by a Certificate Authority (CA) whose public key is trusted by the server.

A certificate issued at login time with a 4-hour TTL provides access only during that window. After expiry, the certificate is cryptographically invalid and cannot be reused. An attacker who obtains a certificate during an incident has at most the remaining TTL to act before the certificate becomes useless.

Adding `TrustedUserCAKeys /etc/ssh/ca.pub` to sshd_config on each server and distributing the CA public key is the only server-side configuration change required. Individual engineer keys no longer need to be distributed to each server — only the CA public key.

When Static Keys Are Still Appropriate

For service-to-service authentication (e.g., a CI/CD pipeline deploying to a server), static keys with tightly scoped `command=` and `from=` restrictions in authorized_keys remain a pragmatic choice. The key is held by a secrets manager, rotated on a schedule, and its authorized_keys entry constrains the command it can run.

In environments where a certificate authority is not yet operational, ShellMate provides a pragmatic middle path: zero-knowledge client-side AES-256-GCM encryption of static keys, combined with team RBAC that controls which team members can decrypt and use each identity. This eliminates the plaintext key distribution problem while deferring CA infrastructure.

Related ShellMate resources

Questions about Zero Trust SSH Access

What is an SSH certificate and how is it different from an SSH key?

An SSH key pair is a permanent credential. An SSH certificate is a public key signed by a Certificate Authority (CA) with a validity window, list of permitted usernames, and optional extensions. Certificates expire automatically, making them safer than static keys for human user access.

How short should SSH certificate TTLs be?

For human user access, TTLs between 8 and 24 hours are common — long enough to span a working day without requiring re-authentication mid-task, short enough to limit exposure from a stolen certificate. Service accounts may use longer TTLs with tighter `principals` restrictions.

Does ShellMate support SSH certificate authentication?

Yes. ShellMate supports SSH certificate-based authentication natively. You can configure your CA-signed certificate as the identity for a host in the credential vault, and ShellMate will use it for the connection lifetime.

Put the guide into practice

Organize hosts, choose a deliberate credential path, and keep SSH work visible in a focused desktop workspace.