SSH certificate authorities

Let servers trust one CA key instead of adding every user's key to authorized_keys, with short-lived certificates signed at connect time.

A certificate authority (CA) is a key in a vault that vouches for other keys. A server that trusts the CA lets in any key it has signed, for the usernames written in the certificate, until the certificate runs out. Nothing has to be added to each server’s authorized_keys.

Create a CA

  1. Open Keychain and, under Certificate authorities, click New certificate authority.
  2. Choose the Vault and give it a Label (for example “Team CA”).
  3. Under Signs for these identities, pick the identities it should sign for. Each identity needs an SSH key, because a certificate is for a key; Duo22 warns you if one has none.
  4. Set Each certificate lasts (minutes). The default is 10 and the most is 1440. A certificate only needs to last long enough to sign in, because a fresh one is made for every connection.
  5. Optionally add Also valid for these usernames (extra principals beyond each identity’s own username).
  6. To reuse a CA you already have, turn on Use an existing CA key instead of making a new one and paste the CA private key and Its passphrase (if any).
  7. Click Create.

Each time one of those identities connects, Duo22 signs a certificate for its key there and then, and offers it first. Servers that don’t trust the CA still get the plain key. To set up identities and keys, see SSH keys and identities.

Make a server trust the CA

  1. In the CA’s row, click the Set up a server to trust it button.
  2. Click Copy commands and run them on each server (Linux with OpenSSH) as a user with sudo.

The commands save the CA’s public key, add it to sshd’s TrustedUserCAKeys, check the config and reload sshd. Keys already in authorized_keys keep working. If you only need the key, use Copy just the public key.

Sign a key for plain OpenSSH

To give a colleague (or yourself) a certificate for use outside Duo22:

  1. Click the Sign a public key button in the CA’s row.
  2. Pick One of your keys, or paste a Public key.
  3. Add the usernames under Valid for these usernames.
  4. Choose how long it is Valid for: 1 hour, 1 day, 7 days or 30 days.
  5. Click Sign, then Copy certificate.
  6. Save it next to the private key with -cert.pub on the end, for example ~/.ssh/id_ed25519-cert.pub. OpenSSH then offers it on its own.

Who can sign

Everyone who can open the vault can sign with its CA. Keep CAs in vaults shared only with people who should grant access. Removing an identity from the CA’s list, or removing someone from the vault, stops their next certificate.

Deleting a CA removes its key on every device, and its identities go back to connecting with their plain keys. Remove it from TrustedUserCAKeys on servers that trusted it.

Still stuck? Check the FAQ, or browse thehelp centre.