|
3 | 3 |
|
4 | 4 | --- |
5 | 5 |
|
6 | | -import { Render } from "~/components" |
7 | | - |
8 | | -1. If you have not yet generated your Cloudflare SSH CA, make a `POST` request to the Cloudflare API with your email address and [API key](/fundamentals/api/get-started/keys/) as request headers. |
9 | | - |
10 | | - ```bash |
11 | | - curl --request POST \ |
12 | | - "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/gateway_ca" \ |
13 | | - --header "X-Auth-Email: <EMAIL>" \ |
14 | | - --header "X-Auth-Key: <API_KEY>" |
15 | | - ``` |
16 | | - |
17 | | -2. If you have already created your Cloudflare SSH CA or try the above and receive the error message, "access.api.error.gateway_ca_already_exists," modify the above command to a `GET` request instead. |
18 | | - |
19 | | - ```bash |
20 | | - curl --request GET \ |
21 | | - "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/gateway_ca" \ |
22 | | - --header "X-Auth-Email: <EMAIL>" \ |
23 | | - --header "X-Auth-Key: <API_KEY>" |
24 | | - ``` |
25 | | - |
26 | | -3. If you would like to use an API token instead of a Global API key, the token must have edit permissions for "Access: SSH Auditing" permissions. The `POST` or `GET` request should be modified to use the "Authorization: Bearer" value instead of "X-Auth-Key." |
27 | | - |
28 | | - ```bash |
29 | | - curl --request POST \ |
30 | | - "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/gateway_ca" \ |
31 | | - --header "X-Auth-Email: <EMAIL>" \ |
32 | | - --header "Authorization: Bearer <API_TOKEN>" |
33 | | - ``` |
| 6 | +import { Render, Details } from "~/components" |
| 7 | + |
| 8 | +1. [Create an API token](/fundamentals/api/get-started/create-token/) with the following permissions: |
| 9 | + |
| 10 | + | Type | Item | Permission | |
| 11 | + | ------- | ---------------- | ---------- | |
| 12 | + | Account | Access: SSH Auditing | Edit | |
| 13 | + |
| 14 | +2. If you have not yet generated a Cloudflare SSH CA, make a `POST` request to the Cloudflare API: |
| 15 | + |
| 16 | + ```bash |
| 17 | + curl --request POST \ |
| 18 | + "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/gateway_ca" \ |
| 19 | + --header "Authorization: Bearer <API_TOKEN>" |
| 20 | + ``` |
| 21 | + |
| 22 | +3. If you have already created a Cloudflare SSH CA or receive the error message `access.api.error.gateway_ca_already_exists`, make a `GET` request instead: |
| 23 | + |
| 24 | + ```bash |
| 25 | + curl https://api.cloudflare.com/client/v4/accounts/{account_id}/access/gateway_ca \ |
| 26 | + --header "Authorization: Bearer <API_TOKEN>" |
| 27 | + ``` |
34 | 28 |
|
35 | 29 | 4. Copy the `public_key` value returned in the response. |
0 commit comments