Skip to content

OpenSSH certificates

OpenSSH certificates replace the authorized_keys model with a signer that servers trust: a Certificate Authority (CA) signs your public key, and any server that trusts the CA lets you in, with no key to copy to each server. ZestSSH signs in with OpenSSH user certificates. You import a certificate your CA issued and attach it to one of your keys, on a computer or a phone, or make one in the app with a CA key you hold, on a computer. Your other devices get it with the key.

It works with certificates from HashiCorp Vault SSH, Smallstep step-ca, Teleport and plain ssh-keygen -s.

Platform Status
Windows Full support: import, generate, attach, sign in
macOS Full support: import, generate, attach, sign in
Linux Full support: import, generate, attach, sign in
Android Import and attach in the key’s editor, sign in. Generate on a large tablet
iOS Import and attach in the key’s editor, sign in. Generate on a large iPad

On a computer, and on a large tablet, which has the computer’s layout, certificates are added on the Keys page. On a phone, open the key and choose Add certificate (see On a phone). A certificate then goes with its key to your other devices, through sync and backups, and every login with that key presents it.

With plain keys, each person’s public key has to be in every server’s authorized_keys. Adding a person or replacing a key means editing files on every host. Certificates fix this with a signer everyone trusts:

  1. A Certificate Authority (CA) has a signing key pair.
  2. Each server is set to trust the CA’s public key (TrustedUserCAKeys in sshd_config).
  3. The CA signs a user’s public key. The result, a certificate, holds that public key plus who it is for (principals), when it is valid, a serial number and its permissions.
  4. When the user connects, the server accepts the certificate because the CA signed it. No authorized_keys entry is needed.

An authorized_keys entry is like a guard who keeps a photo of every face allowed through the door. A certificate is a passport: the guard only needs to recognize the seal, and the passport says who you are and when it expires.

During sign-in, ZestSSH offers the certificate in place of the bare public key (for example as ssh-ed25519-cert-v01@openssh.com). The signature is still made by your private key: the certificate changes what the server sees, not how signing works.

Certificate algorithm Underlying key
ssh-ed25519-cert-v01@openssh.com Ed25519
ssh-rsa-cert-v01@openssh.com RSA
rsa-sha2-256-cert-v01@openssh.com RSA
rsa-sha2-512-cert-v01@openssh.com RSA
ecdsa-sha2-nistp256-cert-v01@openssh.com ECDSA P-256
ecdsa-sha2-nistp384-cert-v01@openssh.com ECDSA P-384
ecdsa-sha2-nistp521-cert-v01@openssh.com ECDSA P-521

An RSA certificate signs logins with SHA-512 where the server takes it, otherwise SHA-256. The old SHA-1 kind is used only where Compatibility mode is on for that host.

ZestSSH also reads the two FIDO2 types, sk-ssh-ed25519-cert-v01@openssh.com and sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, but cannot attach them yet: a security key’s key signs in without a certificate. See FIDO2 hardware keys.

You need the key the certificate was issued for, saved in ZestSSH with its private key.

Have your CA sign the public key of that key. With OpenSSH’s own tools:

Terminal window
# ca_key is your CA's private key; id_ed25519.pub is the public key of your ZestSSH key
ssh-keygen -s ca_key -I alex@laptop -n alex,deploy -V +52w id_ed25519.pub
# produces id_ed25519-cert.pub

Vault SSH, step-ca, Teleport and other CAs that write standard OpenSSH certificates give you the same kind of id_*-cert.pub line.

  1. Open Keys in the sidebar.
  2. On the Certificates line, choose Import. (New key > Import certificate opens the same dialog.)
  3. In Import SSH certificate, paste the id_*-cert.pub line, or use Pick file….
  4. ZestSSH shows what it read: Algorithm, Key id, Serial, Principals, Valid after, Valid before and the CA fingerprint. An expired certificate is marked “Certificate has EXPIRED”. A host certificate is refused here: it names a server and cannot sign you in.
  5. Under Attach to key, pick the key. A key the certificate was not issued for (another algorithm, or the same algorithm with another public key) is shown but cannot be picked (“Algorithm or public key does not match”). A key with a passphrase can be picked too.
  6. Choose Attach certificate. ZestSSH checks that the certificate’s public key is the key’s own, and refuses it if not. Where the private key can be read (it has no passphrase, or its passphrase is saved with it), the private key is checked too.

From then on, connecting with that key presents the certificate.

  1. Open Keys and the key the certificate was issued for. The key must be saved; a key you have just loaded and not saved yet has no Add certificate until you save it.
  2. Choose Add certificate (Replace certificate when the key already has one).
  3. Paste the id_*-cert.pub line, or use Pick file…. The key is picked for you when the certificate was issued for it.
  4. Choose Attach certificate. The same checks as on a computer apply, and the key’s editor then shows it as a key with a certificate; Save keeps it.

Making a certificate with a CA key (below) is on the Keys page of a computer or a large tablet.

If you hold a CA key, ZestSSH can sign a certificate for one of your keys.

  1. Save the CA’s private key in ZestSSH as a key, like any other key.
  2. Open Keys, and on the Certificates line choose Generate (or New key > Generate certificate).
  3. In Generate SSH certificate, pick:
    • Key to certify: the key that gets the certificate.
    • Signed by (CA key): the CA’s key.
    • Key ID: a label stamped on the certificate, which shows in the server’s log (for example alex@laptop).
    • Principals: the usernames the certificate may sign in as, separated by commas or spaces (for example root, deploy).
    • Valid for: 30 days, 90 days (the default), 1 year or Never expires.
    • CA key passphrase: asked for only when the CA key is encrypted and no passphrase is saved with it. A wrong one says “The CA key did not open with this passphrase. Type it again.”
  4. Choose Generate & attach. The certificate is attached to the key at once.

The certificate is valid from the moment it is made, and carries the same permissions ssh-keygen -s gives by default (pty, agent forwarding, port forwarding, X11 forwarding, user rc). Both keys must be software keys saved in ZestSSH: keys held by an SSH agent cannot be used here. A key to certify that has a passphrase is opened with the passphrase saved with it. Your servers must trust the CA’s public key (TrustedUserCAKeys).

  • The key’s page on the Keys screen says when its certificate runs out, from 14 days before.
  • ZestSSH sends a reminder once when a certificate runs out soon (in its last 14 days, or in the last quarter of its life for a short-lived one) and once when it has run out. The reminders follow the Security alerts notification setting (Settings > Notifications).
  • A certificate that has run out by this device’s clock is not sent at all. The connection stops with: “The certificate of the key “key name” ran out on date. Have a new one issued, then add it in the key’s editor on a phone, or on a computer’s Keys page with Import certificate or Generate certificate.”
  • The certificate is for another key. A certificate holds one specific public key. If it is not the key you picked, ZestSSH refuses to attach it. Import the certificate issued for that key, or have it issued again.
  • A certificate that cannot be used. If a key’s certificate is damaged or was made for another key, the connection stops with “The certificate of the key “key name” cannot be used”. The key is never offered without its certificate, and no password is asked for in its place.
  • A host certificate. Host certificates are for servers, not people, and cannot sign you in: the import refuses one and says so.
  • Not valid yet. ZestSSH checks only the end of the validity window. The server checks the whole window with its own clock.
  • The server does not trust the CA. A certificate only works where the server lists your CA in TrustedUserCAKeys. Compare the CA fingerprint ZestSSH shows with the CA the server trusts.
  • Principal mismatch. If the certificate’s principals do not include the username you sign in as, the server refuses it. Check Principals in the import summary.
  • No certificate on this device. If a key signs in with a certificate and this device has none for it, the connection stops and says so. One added on another device arrives with its key once this device syncs.

Certificate sign-in works on every plan, Free included. See Plans and limits.

Q: Can I import an OpenSSH certificate into ZestSSH? A: Yes. On a computer, open Keys, choose Import on the Certificates line, paste the id_*-cert.pub line or pick the file, and attach it to the matching key.

Q: Can ZestSSH act as the CA and sign certificates for me? A: Yes. Save the CA’s key in ZestSSH, then use Generate on the Certificates line of the Keys page.

Q: Does it work on my phone? A: Yes. Open the key on your phone and choose Add certificate to import one, or add it on a computer; either way it reaches your other devices with its key through sync or a backup. Making a certificate with a CA key needs a computer or a large tablet.

Q: Does ZestSSH work with HashiCorp Vault SSH? A: Yes, with Vault’s certificate signing: have Vault sign your public key, then import the certificate it returns.

Q: Are host certificates used to check servers? A: No. ZestSSH checks a server by its host key, trusting it the first time and warning you when it changes. See Host key verification.