1 This document describes a simple public-key certificate authentication
7 The SSH protocol currently supports a simple public key authentication
8 mechanism. Unlike other public key implementations, SSH eschews the use
9 of X.509 certificates and uses raw keys. This approach has some benefits
10 relating to simplicity of configuration and minimisation of attack
11 surface, but it does not support the important use-cases of centrally
12 managed, passwordless authentication and centrally certified host keys.
14 These protocol extensions build on the simple public key authentication
15 system already in SSH to allow certificate-based authentication. The
16 certificates used are not traditional X.509 certificates, with numerous
17 options and complex encoding rules, but something rather more minimal: a
18 key, some identity information and usage options that have been signed
19 with some other trusted key.
21 A sshd server may be configured to allow authentication via certified
22 keys, by extending the existing ~/.ssh/authorized_keys mechanism to
23 allow specification of certification authority keys in addition to
24 raw user keys. The ssh client will support automatic verification of
25 acceptance of certified host keys, by adding a similar ability to
26 specify CA keys in ~/.ssh/known_hosts.
28 Certified keys are represented using new key types:
30 ssh-rsa-cert-v01@openssh.com
31 ssh-dss-cert-v01@openssh.com
32 ecdsa-sha2-nistp256-cert-v01@openssh.com
33 ecdsa-sha2-nistp384-cert-v01@openssh.com
34 ecdsa-sha2-nistp521-cert-v01@openssh.com
36 These include certification information along with the public key
37 that is used to sign challenges. ssh-keygen performs the CA signing
43 The SSH wire protocol includes several extensibility mechanisms.
44 These modifications shall take advantage of namespaced public key
45 algorithm names to add support for certificate authentication without
46 breaking the protocol - implementations that do not support the
47 extensions will simply ignore them.
49 Authentication using the new key formats described below proceeds
50 using the existing SSH "publickey" authentication method described
53 New public key formats
54 ----------------------
56 The certificate key types take a similar high-level format (note: data
57 types and encoding are as per RFC4251 section 5). The serialised wire
58 encoding of these certificates is also used for storing them on disk.
60 #define SSH_CERT_TYPE_USER 1
61 #define SSH_CERT_TYPE_HOST 2
65 string "ssh-rsa-cert-v01@openssh.com"
72 string valid principals
75 string critical options
83 string "ssh-dss-cert-v01@openssh.com"
92 string valid principals
95 string critical options
103 string "ecdsa-sha2-nistp256@openssh.com" |
104 "ecdsa-sha2-nistp384@openssh.com" |
105 "ecdsa-sha2-nistp521@openssh.com"
112 string valid principals
115 string critical options
121 The nonce field is a CA-provided random bitstring of arbitrary length
122 (but typically 16 or 32 bytes) included to make attacks that depend on
123 inducing collisions in the signature hash infeasible.
125 e and n are the RSA exponent and public modulus respectively.
127 p, q, g, y are the DSA parameters as described in FIPS-186-2.
129 curve and public key are respectively the ECDSA "[identifier]" and "Q"
130 defined in section 3.1 of RFC5656.
132 serial is an optional certificate serial number set by the CA to
133 provide an abbreviated way to refer to certificates from that CA.
134 If a CA does not wish to number its certificates it must set this
137 type specifies whether this certificate is for identification of a user
138 or a host using a SSH_CERT_TYPE_... value.
140 key id is a free-form text field that is filled in by the CA at the time
141 of signing; the intention is that the contents of this field are used to
142 identify the identity principal in log messages.
144 "valid principals" is a string containing zero or more principals as
145 strings packed inside it. These principals list the names for which this
146 certificate is valid; hostnames for SSH_CERT_TYPE_HOST certificates and
147 usernames for SSH_CERT_TYPE_USER certificates. As a special case, a
148 zero-length "valid principals" field means the certificate is valid for
149 any principal of the specified type. XXX DNS wildcards?
151 "valid after" and "valid before" specify a validity period for the
152 certificate. Each represents a time in seconds since 1970-01-01
153 00:00:00. A certificate is considered valid if:
155 valid after <= current time < valid before
157 criticial options is a set of zero or more key options encoded as
158 below. All such options are "critical" in the sense that an implementation
159 must refuse to authorise a key that has an unrecognised option.
161 extensions is a set of zero or more optional extensions. These extensions
162 are not critical, and an implementation that encounters one that it does
163 not recognise may safely ignore it.
165 The reserved field is currently unused and is ignored in this version of
168 signature key contains the CA key used to sign the certificate.
169 The valid key types for CA keys are ssh-rsa, ssh-dss and the ECDSA types
170 ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521. "Chained"
171 certificates, where the signature key type is a certificate type itself
172 are NOT supported. Note that it is possible for a RSA certificate key to
173 be signed by a DSS or ECDSA CA key and vice-versa.
175 signature is computed over all preceding fields from the initial string
176 up to, and including the signature key. Signatures are computed and
177 encoded according to the rules defined for the CA's public key algorithm
178 (RFC4253 section 6.6 for ssh-rsa and ssh-dss, RFC5656 for the ECDSA
184 The critical options section of the certificate specifies zero or more
185 options on the certificates validity. The format of this field
186 is a sequence of zero or more tuples:
191 Options must be lexically ordered by "name" if they appear in the
194 The name field identifies the option and the data field encodes
195 option-specific information (see below). All options are
196 "critical", if an implementation does not recognise a option
197 then the validating party should refuse to accept the certificate.
199 The supported options and the contents and structure of their
202 Name Format Description
203 -----------------------------------------------------------------------------
204 force-command string Specifies a command that is executed
205 (replacing any the user specified on the
206 ssh command-line) whenever this key is
207 used for authentication.
209 source-address string Comma-separated list of source addresses
210 from which this certificate is accepted
211 for authentication. Addresses are
212 specified in CIDR format (nn.nn.nn.nn/nn
214 If this option is not present then
215 certificates may be presented from any
221 The extensions section of the certificate specifies zero or more
222 non-critical certificate extensions. The encoding and ordering of
223 extensions in this field is identical to that of the critical options.
224 If an implementation does not recognise an extension, then it should
227 The supported extensions and the contents and structure of their data
230 Name Format Description
231 -----------------------------------------------------------------------------
232 permit-X11-forwarding empty Flag indicating that X11 forwarding
233 should be permitted. X11 forwarding will
234 be refused if this option is absent.
236 permit-agent-forwarding empty Flag indicating that agent forwarding
237 should be allowed. Agent forwarding
238 must not be permitted unless this
241 permit-port-forwarding empty Flag indicating that port-forwarding
242 should be allowed. If this option is
243 not present then no port forwarding will
246 permit-pty empty Flag indicating that PTY allocation
247 should be permitted. In the absence of
248 this option PTY allocation will be
251 permit-user-rc empty Flag indicating that execution of
252 ~/.ssh/rc should be permitted. Execution
253 of this script will not be permitted if
254 this option is not present.
256 $OpenBSD: PROTOCOL.certkeys,v 1.8 2010/08/31 11:54:45 djm Exp $