# SSH certificates

> Sign in to a cluster that wants an SSH user certificate: add it to the key's card, read what the card shows, and know when it must be added again.

Source: https://hiveboard.dev/docs/keys/certificates · Section: Keys and sign-in · HiveBoard 0.1.7 · Updated 2026-10-19

## In short

- Some clusters take a key only together with a certificate that the site's authority issued for it, a file usually ending in -cert.pub.
- Add it with Add certificate… on the key's card in the keychain; the card then shows until when it is valid, which account it signs in as, and who signed it.
- HiveBoard offers a certificate only for the key it was issued for, only for signing in, and only while it is valid.
- A certificate your site issues every day has to be added again each time.

Some clusters do not take a key by itself. An authority at the site signs your public key, and the server lets in whoever shows that signature together with the key. The signed file is an *SSH user certificate*, usually named like the key with `-cert.pub` at the end — `id_ed25519-cert.pub` beside `id_ed25519`.

HiveBoard keeps the certificate beside the key in its keychain and shows it to the server with the key when it signs in. A certificate is not secret: it is your public key plus the authority's signature.

## Adding a certificate

1. Open **Connections**, then **Keychain**.
2. On the card of the key the certificate was issued for, press **Add certificate…**.
3. Paste the certificate into the **Certificate** box — one line that starts with something like `ssh-ed25519-cert-v01@openssh.com` — or press **Choose a file…** and pick the `-cert.pub` file.
4. Press **Add certificate**.

The sheet shows the key's fingerprint: the certificate has to be the one issued for that key.

### What is refused

| You gave | HiveBoard says |
|---|---|
| Another key's certificate | it was issued for a different key |
| A server's (host) certificate | that is a HOST certificate |
| A plain public key | that is a plain public key |
| A private key | that is a PRIVATE key |
| Something else | that doesn't look like an SSH certificate |

## What the key's card shows

A card with a certificate carries a **Certificate** line:

- **until when it is valid** — "valid until" a date, "ran out" a date, "not valid before" a date, or "does not run out";
- **as whom it signs in** — "signs in as `zoe`" (the accounts written in it), or "for any account";
- **who signed it** — "signed by" the authority's `SHA256:` fingerprint.

The chip turns into a warning when the certificate has run out or is not valid yet. **Replace…** puts a new one in its place; **Remove** takes it away and leaves the key. In a server's **Key** list the key is marked "with certificate", "certificate ran out" or "certificate not valid yet".

## How it is used

- Only for the key it was issued for, and only for signing in.
- Only while it is valid. One that has run out is never sent; the refusal then says "the certificate for this key ran out on …" instead of a bare "permission denied".
- Before the bare key, as OpenSSH does.

Adding or replacing a certificate lets a server whose sign-in was refused be tried again — see [A refused sign-in](/docs/help/sign-in-refused).

> [!WARNING]
> If your site issues a new certificate every day (or every few hours), add the new one each time. HiveBoard reads the copy in its keychain, not the file your site's tool writes.

## Certificates already in ~/.ssh

A key imported from `~/.ssh` brings the certificate beside it. A server reached through a host in `~/.ssh/config` uses the certificate beside its `IdentityFile`.

Certificates for *servers* — host certificates, which vouch for a cluster's identity — are a different thing; see [Trusting a server's identity](/docs/connections/server-identity).

> [!BUILD]
> The Python build's SSH library offers the bare key before the certificate, which costs one refused offer more on a cluster that takes certificates only.

## Check yourself

1. Your site gives you a new certificate every morning, written by its own tool next to your key. What must you do in HiveBoard?
   - Nothing: HiveBoard reads the tool's file each time
   - Add the new certificate to the key's card each time ← the answer
   - Create a new key each day
   Why: HiveBoard reads the copy in its own keychain, not the file the tool writes, so a reissued certificate has to be added again.

2. Your certificate ran out yesterday. What does HiveBoard do when it signs in?
   - Sends it anyway and lets the server decide
   - Does not send it, and a refusal says the certificate ran out ← the answer
   - Renews it from the site's authority
   Why: A certificate that has run out is never sent; the refusal then says "the certificate for this key ran out on …".

## Try it in the app

- In the keychain, look at a key's card and find **Add certificate…** (it is there only when the key has none).
- If your cluster uses certificates, add yours and read the line on the card that says until when it is valid and as whom it signs in.

## Related

- [The keychain](https://hiveboard.dev/docs/keys/keychain.md)
- [A refused sign-in](https://hiveboard.dev/docs/help/sign-in-refused.md)
- [Trusting a server's identity](https://hiveboard.dev/docs/connections/server-identity.md)
- [Sign-in methods](https://hiveboard.dev/docs/connections/sign-in-methods.md)
