How to Configure Amazon Linux SSH Certificate

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up an amazon linux ssh certificate, sign user keys with a Certification Authority key. Then configure the server daemon on your Linux hosts to trust that authority public key. Many engineering teams start with static public keys spread across dozens of servers. Rotating those scattered keys when an engineer leaves the company takes hours of manual work. Broad system accounts also give every user full shell control once they log in. How an amazon linux ssh certificate works OpenSSH adde

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.

To set up an amazon linux ssh certificate, sign user keys with a Certification Authority key. Then configure the server daemon on your Linux hosts to trust that authority public key. Many engineering teams start with static public keys spread across dozens of servers. Rotating those scattered keys when an engineer leaves the company takes hours of manual work. Broad system accounts also give every user full shell control once they log in.

How an amazon linux ssh certificate works

OpenSSH added support for user and host certificates back in version 5.4. Unlike standard TLS files, OpenSSH uses a much simpler custom format for its certificates. A key generation tool signs a public key with a Certification Authority key. The resulting file holds a public key, an identity string, and principal names. It also holds a set of options signed by the central authority key.

To set this up on Amazon Linux, you first create a dedicated authority key pair. Keep the private authority key on a secure signing server, away from daily workloads. Copy the public authority key to each Amazon Linux instance in your fleet. Next, tell the OpenSSH server daemon on each host to trust that public file. You do this by editing the main daemon settings file and restarting the service.

When an engineer needs to log in, they generate a standard personal key pair. The admin signs the engineer's public key using the private authority key. During signing, the admin attaches a key identity string for server log tracking. They also attach one or more principal names that match local Linux usernames. The admin sets a validity window so the signed file expires after a short period. Without an explicit time window, the signed file stays valid forever by default.

How principal mapping and host trust operate

When the engineer connects, the Amazon Linux host checks the signature on the file. If the signature matches the trusted authority key, the server checks the validity dates. Next, the server checks if the listed principal matches the requested login account. The server never needs a copy of the engineer's raw public key in advance. This removes the need to push public keys to every single machine.

You can also sign host keys to stop false warnings during the first login. In that workflow, the admin signs the server's public key as a host certificate. Users add the public authority key to their local known hosts file on their laptops. Their client then trusts any Amazon Linux server signed by that same authority.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native certificates solve and what keeps the session active

Signed keys solve key sprawl and stop static files from sitting on servers forever. Short validity windows reduce the risk of stolen keys sitting on developer laptops. The key identity string also writes a clear name into the system auth log. You can see which user signed in, even when people share a default system account.

Still, an OpenSSH certificate only controls the initial login check at the door. Once the session starts, the Linux kernel takes over based on the local user account. If three engineers map to the same admin principal, they get identical shell rights. The certificate cannot inspect individual shell commands or block dangerous flags in flight. It also cannot rewrite sensitive values like emails, phone numbers, or card numbers in command output. Teams that need command-level controls or data masking must look beyond native OpenSSH files.

Add command and file guardrails to SSH access

Host firewalls and certificate principals control who opens an SSH session. Yet an allowed user or agent can still run a bad one-shot command or pull sensitive files over sftp. In practice, hoop.dev sits inline on the host as an open-source SSH server with guardrails that uses OpenSSH certificates. For every one-shot command or sftp task an agent or human runs in production, hoop.dev decides to pass, mask, block, or escalate it for review.

Using hoop.dev SSH controls, guardrails check one-shot commands, env variable names, and sftp or scp paths before they run. Port forwards default to deny unless the target is listed. Because interactive shells have no statement boundary and carry no guardrails, teams can turn them off so every command is checked and logged. Check out the MIT-licensed project on GitHub.

Frequently asked questions

How is an OpenSSH certificate different from an X.509 certificate?

OpenSSH uses its own compact format rather than the complex X.509 standard used in TLS. It stores only a public key, an identity, principals, options, and a signature.

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

If you skip the validity period during signing, the certificate remains valid forever. Always set a short time window so access ends on its own without manual cleanup.

Can one signed certificate allow login to multiple Linux user accounts?

Yes, you can list several principal names separated by commas when signing the user key. The server allows login to any local account that matches one of those principals.

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.