October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Create an SSH Certificate Authority for Hosts and Clients

A practical, end-to-end guide to building an OpenSSH certificate authority for user and host authentication, including key generation, signing commands, principal policy, trust configuration, verification and rotation.
Length12 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An OpenSSH certificate authority (CA) lets you authenticate many users and hosts through a small set of trusted CA public keys instead of copying every individual key into authorized_keys and known_hosts. The CA signs ordinary SSH public keys, adding principals, validity dates, a key identifier and policy extensions. Servers trust a user CA with TrustedUserCAKeys; clients trust a host CA with an @cert-authority entry; and servers present host certificates through HostCertificate.

Create separate CA key pairs for users and hosts, keep each private CA key offline or in a tightly controlled signing system, and distribute only the public CA keys. The procedures below use standard OpenSSH tools and show the complete trust path in both directions.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What an OpenSSH CA actually does

An OpenSSH certificate is a signed wrapper around an existing public key. It does not replace the corresponding private key and it is not an X.509 certificate. The certificate contains the public key, the CA signature, a key identifier, one or more principals, validity times, and signed options or extensions.

A relying party needs only the CA public key and a local policy. It verifies that the certificate was signed by that CA, that the embedded public key is being used by its matching private key, that the certificate is currently valid, and that its principals and options satisfy policy. This compresses trust: a server can trust one user CA instead of hundreds of user keys, while clients can trust one host CA instead of maintaining a key entry for every server.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

OpenSSH has two certificate roles:

  • User (client) certificates: authenticate a person or service to an SSH server.
  • Host certificates: authenticate an SSH server to a client.

Ubuntu’s ssh-keygen manual describes the distinction directly: user certificates authenticate users to servers, whereas host certificates authenticate server hosts to users. A certificate created for one role should not be used as the other role.

Design the CA hierarchy before generating keys

Use separate host and user CAs

Generate one CA key pair for user certificates and another for host certificates, for example ca_user and ca_host. ANSSI OpenSSH guidance recommends distinct CAs when their roles differ. Separating them limits the effect of a compromise and lets you rotate one trust domain without replacing the other.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OpenSSH does not support a certification chain in which a root CA delegates to subordinate CAs. Each relying party must trust the CA that signs the certificates it accepts. If you need organizational separation, use separate CA keys and configure the appropriate public key at each server or client rather than trying to build an X.509-style hierarchy.

Protect the CA private keys

The CA private key can sign arbitrary certificates for its role, so it is more sensitive than any individual host or user key. Store it away from ordinary production servers where practical, restrict file ownership and permissions, and protect it with a unique, robust passphrase. Keep an issuance record for every certificate, including its owner, asset, principal, validity interval and identifier.

The signer can be a file on a controlled administrative system. OpenSSH also documents optional integrations with a PKCS#11 token using ssh-keygen -D and an ssh-agent using ssh-keygen -U. These mechanisms can keep the private key from being directly exposed to the signing command, but neither is required for a basic deployment.

Choose names and policy fields consistently

Use a unique -I key identifier that includes an issuance date, ticket or asset reference. OpenSSH logs this identifier when the certificate is used, making it valuable during audits. Principals must be narrow: a user certificate should name only the account or service identity it is allowed to assume, and a host certificate should list every DNS name or address clients are expected to use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Generate the two CA key pairs

Run the following on a protected signing system. The umask prevents newly created private-key files from being world-readable.

umask 077
ssh-keygen -t ed25519 -f ca_user -C 'OpenSSH user CA'
ssh-keygen -t ed25519 -f ca_host -C 'OpenSSH host CA'

ssh-keygen prompts for a passphrase for each private key. The exact algorithm and file permissions should follow the OpenSSH versions and cryptographic policy used in your environment. The public files are ca_user.pub and ca_host.pub; distribute those files, never the private files.

Issue a user certificate for a client key

Start with an ordinary user public key. The private key remains on the user’s workstation or in its normal agent. The following example signs id_ed25519.pub for the account principal alice:

ssh-keygen -s ./ca_user 
  -I alice-laptop-2026-10 
  -V +52w 
  -n alice 
  ./id_ed25519.pub

The options have specific meanings:

  • -s ./ca_user selects the user CA private key.
  • -I alice-laptop-2026-10 sets the certificate key identifier recorded in logs.
  • -V +52w sets a validity interval beginning at the current time and ending 52 weeks later. Choose a lifetime that matches your local threat model and reissuance capability; OpenSSH documentation does not mandate one universal lifetime.
  • -n alice restricts the certificate’s principals to alice.
  • The final argument is the public key being certified.

The command writes id_ed25519-cert.pub beside the input public key. It does not alter id_ed25519, and possession of the certificate alone is useless without the matching private key.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Offer the certificate from the SSH client

Tell the client to use the private key and offer its certificate alongside it:

Host bastion.example.com
    IdentityFile ~/.ssh/id_ed25519
    CertificateFile ~/.ssh/id_ed25519-cert.pub

IdentityFile points to the private key. CertificateFile points to the signed public certificate. The certificate file is safe to install with the private key because it contains public material, but keep normal restrictive permissions on the entire ~/.ssh directory.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Configure servers to trust user certificates

Copy ca_user.pub to each destination server through a controlled channel. Store it as a root-owned file that unprivileged users cannot modify, for example /etc/ssh/ca_user.pub. Add this directive to sshd_config:

TrustedUserCAKeys /etc/ssh/ca_user.pub

With only TrustedUserCAKeys configured, the login username must appear in the certificate’s principal list. In the example, a connection as alice succeeds only when the certificate contains the alice principal and the client proves possession of the matching private key.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use an explicit principals policy when names and accounts differ

If certificates use role names, employee IDs or service identities rather than Unix account names, add an AuthorizedPrincipalsFile policy:

TrustedUserCAKeys /etc/ssh/ca_user.pub
AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u

For an account named alice, create /etc/ssh/auth_principals/alice with one accepted principal per line, for example:

alice
engineering-admin

The principal in the certificate must match one of the lines in the file. This lets an account accept a controlled role without allowing every certificate that names an unrelated principal. Make the directory and files root-owned and non-writable by ordinary users.

Validate and reload safely

  1. Check the complete daemon configuration before changing the running service: sshd -t.
  2. Correct ownership, permissions or path errors reported by the test.
  3. Reload the SSH service using the service manager appropriate to the host. A reload preserves existing sessions while applying the new configuration.
  4. Keep an existing administrative session open and test a new connection with verbose output before closing it.

Issue a host certificate

Use each server’s existing host public key as the certificate subject. This example signs an Ed25519 host key and includes both a DNS name and an address:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
ssh-keygen -s ./ca_host 
  -I web-01-2026-10 
  -V +52w 
  -h 
  -n web-01.example.com,10.0.2.15 
  /etc/ssh/ssh_host_ed25519_key.pub

Here, -h marks the certificate as a host certificate, while -n lists the host principals. Include every name clients will actually use: a short hostname, fully qualified DNS name and address are different principals. The output is /etc/ssh/ssh_host_ed25519_key-cert.pub.

The private host key is not replaced. The certificate must match the public key derived from the private key named in the server configuration. If you sign a different host key, sshd will not be able to use the certificate with that HostKey.

Configure sshd to present the host certificate

Install the certificate with root ownership and restrictive permissions, then pair it explicitly with its private host key:

HostKey /etc/ssh/ssh_host_ed25519_key
HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub

OpenSSH does not load host certificates automatically merely because a file has the expected suffix. The HostCertificate directive is required, and the certificate public key must correspond to a configured HostKey. Run sshd -t, reload the daemon, and test a fresh connection after installing it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make clients trust the host CA

Distribute ca_host.pub to client machines through configuration management or another authenticated administrative channel. Add an @cert-authority line to a user’s ~/.ssh/known_hosts or to the system-wide ssh_known_hosts file:

@cert-authority *.example.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... host-ca

The host pattern limits where this CA is trusted. Choose a pattern that covers the names you actually operate without unnecessarily extending trust to unrelated domains. ANSSI guidance identifies the @cert-authority marker as the client-side declaration that a CA may sign host certificates.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Verify the CA fingerprint through an authenticated channel before distributing it. A CA public key is not self-authenticating; an attacker who substitutes a different public key could make a client trust a fraudulent host certificate. After the CA key is trusted, the host certificate still needs a principal matching the name or address used in the SSH command. If a client connects to web-01.example.com, that exact name must be among the certificate principals; a certificate containing only 10.0.2.15 will not satisfy the hostname check.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Inspect every certificate before deployment

Use ssh-keygen -L to display the signer, serial information, principals, validity interval and extensions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh-keygen -L -f id_ed25519-cert.pub
ssh-keygen -L -f /etc/ssh/ssh_host_ed25519_key-cert.pub

Check each item before placing a certificate into production:

  • The CA fingerprint is the expected fingerprint for the role.
  • The certificate key type and embedded public key match the intended private key.
  • User principals contain only the required account or role names.
  • Host principals contain every DNS name or address clients will use, and no unnecessary names.
  • Validity start and end times match the issuance record and the clocks on the participating systems.
  • The user principal maps to the login name or to an entry in AuthorizedPrincipalsFile.
  • The identifier from -I identifies the person, device or asset that received the certificate.
  • Server configuration passes sshd -t.
  • A test connection succeeds with verbose client logging before broad rollout.

Control principals, extensions and lifetime

Do not rely on broad defaults. Specify principals with -n and set an explicit validity interval with -V. A certificate that names every possible user or host defeats the policy benefit of a CA. Keep each role’s options and extensions no broader than necessary, and review them with ssh-keygen -L.

Short-lived certificates reduce the period in which a stolen private key or certificate remains useful, but they increase issuance and renewal work. Long-lived certificates reduce operational overhead but leave more time for misuse. The appropriate interval depends on how quickly your organization can reissue certificates, revoke trust and respond to a compromise; OpenSSH itself does not prescribe a universal value or revocation schedule.

CA deployment compared with individual key files

Operational concern Per-host keys and known_hosts entries OpenSSH CA
Trust entries Every user public key must be authorized on each server, and every host key must be distributed to clients. Servers trust a user CA public key; clients trust a host CA public key. Individual certificates carry the changing identities.
Issuance and rotation Adding, replacing or removing an identity requires editing many files and distributing each new key. Issue or renew certificates from the signer while the trust anchor remains stable; rotate the CA itself when necessary.
Principal policy Account and host names are implicit in file placement or known-hosts patterns. Principals and validity are explicit certificate fields, optionally checked against AuthorizedPrincipalsFile.
Auditability Individual key comments can help, but there is no certificate-use identifier by default. The -I key identifier is logged when a certificate is used and can carry an issuance or asset reference.
Compromise impact A stolen individual key generally affects the accounts or hosts that trust that key. A compromised CA private key can authorize many identities in its role, so it requires stronger protection and an incident plan.
Compatibility Works with virtually every SSH implementation that supports public keys. Requires OpenSSH certificate support and correct configuration on both sides; ordinary OpenSSH clients and servers support these mechanisms.

Rotation and compromise response

Routine certificate renewal

Reissue certificates before their validity ends, preserving the same principal policy and assigning a new identifier that points to the new issuance record. Install the replacement certificate alongside the existing private key, test it, and remove the expired file when the transition is complete.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Rotating a CA key

Because clients and servers trust CA public keys directly, CA rotation is a trust-anchor change. Introduce the new public key at every relying party, issue replacement certificates from the new private key, verify them, and remove the old public key only after certificates signed by it are no longer needed. Keep the old CA private key disabled and protected for the duration required by your incident and audit policy.

Responding to a compromised CA

  1. Stop issuing certificates from the compromised private key.
  2. Remove or replace that CA public key from every server or client that trusts it.
  3. Generate a replacement CA key pair with a distinct protected private key.
  4. Distribute the replacement public key through an authenticated channel.
  5. Reissue affected user or host certificates and test both trust directions.
  6. Review logs using certificate identifiers to determine which identities may have been exposed.

OpenSSH’s certificate format makes short-lived credentials and CA-key rotation practical, but it does not provide one universal revocation protocol. Your local policy must define how quickly trust anchors are removed and certificates are reissued.

Troubleshooting common failures

The server rejects a valid-looking user certificate

  • Confirm the client is offering both the private key and its CertificateFile; a certificate without its matching private key cannot authenticate.
  • Check that TrustedUserCAKeys points to the intended, readable CA public key.
  • Verify the certificate principal. Without AuthorizedPrincipalsFile, it must match the requested login username exactly.
  • If an principals file is configured, confirm the file path expands to the correct account and contains the principal on its own line.
  • Inspect validity times and system clocks with ssh-keygen -L.
  • Run the client with verbose logging and inspect the server authentication log for the certificate identifier.

The client reports host-key verification failure

  • Confirm the host CA public key is in the effective known_hosts file and is preceded by @cert-authority.
  • Check that the host pattern matches the name used in the SSH command.
  • Inspect the host certificate and ensure that same name appears as a principal.
  • Verify the distributed CA fingerprint through your authenticated administrative channel.
  • Ensure the server is actually presenting the certificate through a matching HostKey and HostCertificate pair.

sshd refuses to start after installation

Run sshd -t before restarting. Typical causes are a misspelled path, incorrect permissions, a certificate signed for a different host public key, or a directive placed in a configuration file that is not being included. Keep an existing session open until a new session has authenticated successfully.

Final implementation checklist

  1. Create independent, passphrase-protected user and host CA keys.
  2. Store private CA keys away from ordinary servers whenever practical.
  3. Sign user public keys with narrow account or role principals and explicit validity intervals.
  4. Configure clients with the matching private key and CertificateFile.
  5. Install the user CA public key and configure TrustedUserCAKeys on every destination server.
  6. Use AuthorizedPrincipalsFile when certificate roles should not equal Unix account names.
  7. Sign each server host public key with the host CA, including every client-facing DNS name and address.
  8. Configure the matching HostKey and HostCertificate directives.
  9. Install the host CA public key with an @cert-authority entry in client known-hosts policy.
  10. Inspect certificates, validate with sshd -t, test verbose connections, and record each -I identifier.
  11. Document renewal, CA rotation and compromise procedures before relying on the CA for production access.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.