Skip to content

Commit 019d0b2

Browse files
committed
update API commands
1 parent 7664f75 commit 019d0b2

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

src/content/partials/cloudflare-one/ssh/ssh-proxy-ca.mdx

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,27 @@
33

44
---
55

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+
```
3428

3529
4. Copy the `public_key` value returned in the response.

0 commit comments

Comments
 (0)