Skip to content

Commit 79aa7d5

Browse files
[CF1] update sshd_config file instructions (#24119)
1 parent 75b27df commit 79aa7d5

File tree

4 files changed

+22
-29
lines changed

4 files changed

+22
-29
lines changed

src/content/docs/cloudflare-one/applications/non-http/short-lived-certificates-legacy.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Cloudflare Access will take the identity from a token and, using short-lived cer
5353

5454
<Render file="ssh/public-key" />
5555

56-
## 5. Modify your SSHD config
56+
## 5. Modify your `sshd_config` file
5757

5858
<Render file="ssh/modify-sshd" />
5959

src/content/docs/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access.mdx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ To connect your devices to Cloudflare:
4242
<Render file="access/add-infrastructure-app" />
4343

4444
## 6. (Recommended) Modify order of precedence in Gateway
45-
<Render file="access/modify-gateway-policy-precedence" product="cloudflare-one" params={{ selector: "Access Infrastructure Target", protocol: "ssh" }} />
45+
46+
<Render
47+
file="access/modify-gateway-policy-precedence"
48+
product="cloudflare-one"
49+
params={{ selector: "Access Infrastructure Target", protocol: "ssh" }}
50+
/>
4651

4752
## 7. Configure SSH server
4853

@@ -60,7 +65,7 @@ To generate a Cloudflare SSH CA and get its public key:
6065

6166
<Render file="ssh/public-key" />
6267

63-
### Modify your SSHD config
68+
### Modify your `sshd_config` file
6469

6570
<Render file="ssh/modify-sshd" />
6671

@@ -122,11 +127,11 @@ Cloudflare will stop logging SSH commands to your targets, as well as any comman
122127
To delete the SSH encryption public key using the [API](/api/resources/zero_trust/subresources/gateway/subresources/audit_ssh_settings/methods/update/):
123128

124129
<APIRequest
125-
path="/accounts/{account_id}/gateway/audit_ssh_settings"
126-
method="PUT"
127-
json={{
128-
public_key: "",
129-
}}
130+
path="/accounts/{account_id}/gateway/audit_ssh_settings"
131+
method="PUT"
132+
json={{
133+
public_key: "",
134+
}}
130135
/>
131136

132137
</TabItem>

src/content/docs/cloudflare-one/policies/gateway/network-policies/ssh-logging.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To generate a Gateway SSH proxy CA and get its public key:
4141

4242
<Render file="ssh/public-key" />
4343

44-
## 4. Modify your SSHD config
44+
## 4. Modify your `sshd_config` file
4545

4646
<Render file="ssh/modify-sshd" />
4747

src/content/partials/cloudflare-one/ssh/modify-sshd.mdx

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,23 @@
22
{}
33
---
44

5-
The following procedure makes two changes to the `sshd_config` file on the remote target machine. The first change requires that you uncomment a field already set in most default configurations; the second change adds a new field.
5+
Configure your SSH server to trust the Cloudflare SSH CA by updating the `sshd_config` file on the remote target machine.
66

7-
1. While staying within the `/etc/ssh` directory on the remote machine, open the `sshd_config` file.
7+
1. While in the `/etc/ssh` directory on the remote machine, open the `sshd_config` file.
88

99
```sh
10-
vim /etc/ssh/sshd_config
10+
sudo vim /etc/ssh/sshd_config
1111
```
1212

13-
2. Go to the row named `PubkeyAuthentication`. In most default configurations, the row will appear commented out as follows:
13+
2. Press `i` to enter insert mode, then add the following lines at the top of the file, above all other directives:
1414

1515
```txt
16-
# PubkeyAuthentication yes
17-
```
18-
19-
3. Remove the `#` symbol to uncomment the line:
20-
21-
```txt
2216
PubkeyAuthentication yes
23-
```
24-
25-
4. Add a new line below `PubkeyAuthentication`:
26-
27-
```txt
2817
TrustedUserCAKeys /etc/ssh/ca.pub
2918
```
3019

31-
5. Save the file and quit the editor. You might need to use the following command again to save and exit.
20+
:::caution[Be aware of your include statements]
21+
If there are any include statements below these lines, the configurations in those files will not take precedence.
22+
:::
3223

33-
```txt
34-
:w !sudo tee %
35-
:q!
36-
```
24+
3. Press `esc` and then type `:x` and press `Enter` to save and exit.

0 commit comments

Comments
 (0)