{
  "id": 19436198,
  "title": "SSH Certificate Authentication with ssh-keygen (2026)",
  "url": "https://urgent.news/2026/11/11/ssh-certificate-authentication-with-ssh-keygen-2026",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-11T03:20:48.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/masitings/ssh-certificate-authentication-with-ssh-keygen-2026-2mo0"
  },
  "original_language": "en",
  "account": "SSH certificate authentication simplifies the process of managing shell access across multiple devices and servers. Instead of copying public keys to each server, you sign the user's key pair with a Certificate Authority (CA) key, resulting in a certificate file (id_ed25519-cert.pub) that contains the user's public key and metadata.\n\nWhen a user connects with a certificate, the server verifies three things: the CA signature's validity, the certificate's validity window, and one of its principals (account or role names) allowed for the account being logged into. This method eliminates the need for an authorized_keys file and the \"are you sure you want to continue connecting?\" prompt.\n\nThere are two types of certificates: user certificates and host certificates. User certificates are signed by a user CA, while host certificates are signed by a host CA. The server only needs the CA's public key to trust the certificates. Both certificates are in a simplified format, not X.509, and do not require OpenSSL, a PKI team, or a CRL server.\n\nTo create SSH certificate authority keys, generate two Ed25519 keys, one for users and one for hosts, using ssh-keygen. Keep the private keys secure and treat them like a root password. A naming plan for principals (roles) is essential, such as fleet-ops, deploy, and readonly. Each server should define which roles can log into which account.\n\nTo sign a user certificate with ssh-keygen -s, generate a key pair and send only the .pub file to the CA. Use the -s flag to specify the user CA, -I for the key ID, -n for the principals, -V for the validity window, and -z for a serial number. The resulting certificate (ops_key-cert.pub) can be inspected with ssh-keygen -L.\n\nRestricting a certificate's permissions is possible with -O flags, such as -O clear to remove default permissions and -O permit-pty for a specific use case, like a backup job. The certificate's validity, principals, and other options can be managed effectively using these flags.",
  "summary": "You have forty devices in the field, three people who need shell access, and an authorized_keys file on every one of them. Someone leaves, and you get to touch forty files. Someone gets a new laptop, and you get to touch forty files again. A device gets reflashed, and everyone's terminal shouts that the host key changed. SSH certificate authentication fixes both directions of that problem with…",
  "key_points": [
    "SSH certificate authentication simplifies managing shell access across devices",
    "User and host certificates signed by user and host CAs, respectively",
    "Server verifies CA signature, validity window, and principals during login"
  ],
  "editors_take": "Adopting certificate-based authentication replaces manual key management with a centralized authority system that streamlines access control and eliminates the need for individual authorizedkeys files across server fleets.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}