Skip to content

Commit 3eae985

Browse files
final edits
1 parent 02204dc commit 3eae985

File tree

2 files changed

+65
-39
lines changed

2 files changed

+65
-39
lines changed

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

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -191,51 +191,29 @@ SSH sessions have a maximum expected duration of 10 hours. For more information,
191191

192192
## Troubleshooting
193193

194-
Failure to connect to your SSH endpoint could be the result of multiple variables. Review the following troubleshooting steps to investigate and solve the source of your connection issue.
195-
196-
First, verify Access policy allows access.
197-
Second, verify tunnel health.
198-
- go to networks > routes > search your IP to find the tunnel associated with the IP.
199-
- copy the tunnel.
200-
- go to networks > tunnels, search by tunnel name and review that the tunnel status is "Healthy."
201-
202-
If the status is anything other than healty, do this ____.
203-
204-
Third, verify that the user you are attempting to connect as exists on the target.
205-
206-
Fourth, check sshd_config file for misconfiguration.
194+
Failure to connect to your SSH endpoint could be the result of multiple variables. Use the following steps to systematically investigate and resolve the source of your connection failure.
207195

196+
1. [Verify that your Access policies](#1-review-access-policies) allow the user to access the target machine.
197+
2. [Check Cloudflare Tunnel](#2-check-target-machine-connection) health.
198+
3. [Confirm user existence](#3-confirm-user-existence-on-the-target-server) on the target server.
199+
4. [Check your `sshd_config` file](#4-debug-sshd_config-file-misconfiguration) for misconfiguration.
208200

209201
### 1. Review Access policies
210202

211203
A user may be blocked by an Access policy from reaching an SSH target because:
212204

213-
- An Access policy denies access, or
214-
- No explicit allow policy exist and Access is set to deny the user by default.
215-
216-
As an end user, run [`warp-cli` target list`](/cloudflare-one/applications/non-http/infrastructure-apps/#display-available-targets) to verify if you have access to the target machine.
217-
218-
205+
- An Access policy exists that denies that user access, or
206+
- No explicit allow Access policy exists and Access is set to deny the user by default.
219207

220-
### Check target machine connection
208+
You were guided to create an Access policy for your SSH target in [substep 9 of step 5: Add an infrastructure application](#5-add-an-infrastructure-application).
221209

222-
A user may be blocked by a policy from reaching an SSH target because:
210+
As an end user, run [`warp-cli target list`](/cloudflare-one/applications/non-http/infrastructure-apps/#display-available-targets) to verify that you have access to the target machine.
223211

224-
- An Access policy denies access, or
225-
- No explicit allow policy exist and Access is set to deny the user by default.
212+
<Render file="tunnel/warp-cli-target-list" product="cloudflare-one" />
226213

227-
As an end user, run [`warp-cli` target list`](/cloudflare-one/applications/non-http/infrastructure-apps/#display-available-targets) to verify if you have access to the target machine.
214+
- If the target appears in the list, confirm that the username you are attempting to connect with is shown in the output. If the username is not shown, you must go to the Access policy associated with the target machine and add that user to the Access policy. If the username is shown,
228215

229-
- If the target does not appear, your Access policies concerning the target machine must be audited for potential misconfigurations. the administrator should check the Access logs to confirm whether a policy is blocking access.
230-
231-
- If the target appears in the list, confirm that the username you are attempting with is shown in the output. If the username is not shown, you must go to the Access policy associated with the target machine and add that user to the policy.
232-
233-
then check tunnel health
234-
235-
if you've checked tunnel health and there are no issues, then we assume > the issue is likely with the `sshd_config` file.
236-
237-
238-
### 2. Review Access logs
216+
- If the target does not appear in the list, your Access policies concerning the target machine must be audited for potential misconfigurations that may be blocking access.
239217

240218
:::note
241219

@@ -256,13 +234,42 @@ To review if an Access policy is causing connection issues:
256234

257235
By editing a [policy](/cloudflare-one/policies/access/) that is explicitly blocking the user or adding a new policy to explicitly allow the user, the connection issue should be resolved. After saving your policy changes, attempt to connect to the target machine as the end user.
258236

259-
### 3. Debug `sshd_config` file misconfiguration
237+
After you have audited your Access policies and are still having connection issues, you must review Tunnel health.
238+
239+
### 2. Check target machine connection
240+
241+
If the end user cannot connect to the target SSH machine, the tunnel you set up in [step 1: Connect the server to Cloudflare](#1-connect-the-server-to-cloudflare) may be down or inactive.
242+
243+
To check the status of your Tunnel:
244+
245+
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Networks** > **Routes**.
246+
2. Search your IP to find the Tunnel associated with the IP.
247+
248+
This IP will be visible in the `warp-cli target list` output in [the previous step](#1-review-access-policies). If you are an admin, you can also go to **Networks** > **Targets** and find the IP next your Hostname.
249+
250+
3. Copy the Tunnel name.
251+
4. Go to **Networks** > **Tunnels** and search by your Tunnel name.
252+
5. Review that the [Tunnel status](/cloudflare-one/connections/connect-networks/monitor-tunnels/notifications/#available-notifications) says Active, and not Down, Degraded, or Inactive.
253+
254+
If the status of your Tunnel is Inactive, you must install and run the Tunnel on your server as described in [step 1: Connect the server to Cloudflare](#1-connect-the-server-to-cloudflare).
255+
256+
If the status of your Tunnel is Down, the server could be turned off or the server was connected to Cloudflare at one point but is now no longer connected. This could be due to various changes on the server side, like firewalls, load balancers, or other network devices blocking `cloudflared` connections. Refer to the [Tunnel with Firewall](/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-with-firewall/#test-connectivity) or [Troubleshooting Tunnel documentation](/cloudflare-one/connections/connect-networks/troubleshoot-tunnels/) for more information.
257+
258+
After you have vertified that there are no issues with your Tunnel's health, continue to verifying your `sshd_config` file.
259+
260+
### 3. Confirm user existence on the target server
261+
262+
To verify the existence of the end user on the target server, run the `id <USERNAME>` command on the target SSH server to verify that the end user's username exists. If the username does not exist, you must add the user to the server.
263+
264+
### 4. Debug `sshd_config` file misconfiguration
260265

261266
Failure to connect to your SSH endpoint could be the result of multiple variables. One reason might be the result of a misconfigured `sshd_config` file.
262267

263268
#### Review your `sshd` logs
264269

265-
You will be told whether or not the user is making it to the server. The location of your sshd logs is defined in your `sshd_config`. // Mike to provide OS specific instructions.
270+
`sshd` logs can confirm whether or not the user is making it to the server. The location of your `sshd` logs is defined in your `sshd_config`. Logs location will likely be found at `journalctl -u ssh` on Ubuntu and `tail /var/log/auth.log` for Red Hat.
271+
272+
Using your `sshd` logs, validate that SSH connection attempts are arriving to the SSH target machine.
266273

267274
#### Review your `sshd_config` file for misconfigurations
268275

@@ -437,10 +444,10 @@ These troubleshooting steps could result in you being locked out of your SSH ser
437444
6. Enter `:x` to save and exit.
438445
7. [Reload](#reload-your-ssh-server) your SSH server.
439446

440-
:::caution[You may lose access to your SSH server]
441-
Restarting your `sshd` service will result in the termination of your current SSH connection. Make sure your reload instead restarting to avoid losing access to your SSH server permanently.
447+
:::caution[Do not restart]
448+
Restarting your `sshd` service will result in the termination of your current SSH connection. Make sure to reload instead restarting to avoid terminating all currently open SSH sessions.
442449
:::
443450

444451
<Render file="ssh/restart-server" product="cloudflare-one" />
445452

446-
// Need a conclusion. What does this do? What if it still doesn't work?
453+
By completing these steps, you should have resolved any connection issues caused by misconfiguration of the SSH server. If issues persist, [recheck `sshd` logs](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#review-your-sshd-logs). The example [`sshd_config` shared above](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#review-your-sshd_config-file-for-misconfigurations) enables debug logging and may expose more specific issues.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
{}
3+
---
4+
5+
```sh
6+
warp-cli target list
7+
```
8+
9+
```sh output
10+
╭──────────────────────────────────────┬──────────┬───────┬───────────────────────┬──────────────────────┬────────────╮
11+
│ Target ID │ Protocol │ Port │ Attributes │ IP (Virtual Network) │ Usernames │
12+
├──────────────────────────────────────┼──────────┼───────┼───────────────────────┼──────────────────────┼────────────┤
13+
│ 0193f22a-9df3-78e3-b5bb-7ab631903306 │ SSH │ 22 │ hostname: do-target │ 10.116.0.3 (a1net) │ alice │
14+
├──────────────────────────────────────┼──────────┼───────┼───────────────────────┼──────────────────────┼────────────┤
15+
│ 0193f22a-9df3-78e3-b5bb-7ab631903306 │ SSH │ 23 │ hostname: do-target │ 10.116.0.3 (a1net) │ root │
16+
├──────────────────────────────────────┼──────────┼───────┼───────────────────────┼──────────────────────┼────────────┤
17+
│ 01943cff-6130-7989-8bff-cbc02b59a2b1 │ SSH │ 80 │ hostname: az-target │ 172.16.0.0 (b1net) │ alice, bob │
18+
╰──────────────────────────────────────┴──────────┴───────┴───────────────────────┴──────────────────────┴────────────╯
19+
```

0 commit comments

Comments
 (0)