You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access.mdx
+46-39Lines changed: 46 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,51 +191,29 @@ SSH sessions have a maximum expected duration of 10 hours. For more information,
191
191
192
192
## Troubleshooting
193
193
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.
207
195
196
+
1.[Verify that your Access policies](#1-review-access-policies) allow the user to access the target machine.
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.
208
200
209
201
### 1. Review Access policies
210
202
211
203
A user may be blocked by an Access policy from reaching an SSH target because:
212
204
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.
219
207
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).
221
209
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.
223
211
224
-
- An Access policy denies access, or
225
-
- No explicit allow policy exist and Access is set to deny the user by default.
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,
228
215
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.
239
217
240
218
:::note
241
219
@@ -256,13 +234,42 @@ To review if an Access policy is causing connection issues:
256
234
257
235
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.
258
236
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
260
265
261
266
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.
262
267
263
268
#### Review your `sshd` logs
264
269
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.
266
273
267
274
#### Review your `sshd_config` file for misconfigurations
268
275
@@ -437,10 +444,10 @@ These troubleshooting steps could result in you being locked out of your SSH ser
437
444
6. Enter `:x` to save and exit.
438
445
7.[Reload](#reload-your-ssh-server) your SSH server.
439
446
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.
// 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.
0 commit comments