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
+29-21Lines changed: 29 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ chmod 600 /etc/ssh/ca.pub
96
96
97
97
## 8. Connect as a user
98
98
99
-
Users can use any SSH client to connect to the target, as long as they are logged into the WARP client on their device. If the target is located within a particular virtual network, ensure that the WARP client is [connected to that virtual network](/cloudflare-one/connections/connect-networks/private-net/cloudflared/tunnel-virtual-networks/#connect-to-a-virtual-network) before initiating the connection. Users do not need to modify any SSH configs on their device. For example, to SSH from a terminal:
99
+
Users can use any SSH client to connect to the target, as long as they are logged into the WARP client on their device. If the target is located within a particular virtual network, ensure that the WARP client is [connected to that virtual network](/cloudflare-one/connections/connect-networks/private-net/cloudflared/tunnel-virtual-networks/#connect-to-a-virtual-network) before initiating the connection. Users do not need to modify any SSH configuration on their device. For example, to SSH from a terminal:
100
100
101
101
```sh
102
102
ssh <username>@<target IP>
@@ -191,7 +191,7 @@ 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. Use the following steps to systematically investigate and resolve the source of your connection failure.
194
+
Failure to connect to your SSH endpoint could be the result of multiple variables. Use the following steps to investigate and resolve the source of your connection failure.
195
195
196
196
1.[Verify that your Access policies](#1-review-access-policies) allow the user to access the target machine.
@@ -205,17 +205,25 @@ A user may be blocked by an Access policy from reaching an SSH target because:
205
205
- An Access policy exists that denies that user access, or
206
206
- No explicit allow Access policy exists and Access is set to deny the user by default.
207
207
208
+
:::note[Access policies and infrastructure applications]
209
+
210
+
The Access infrastructure application (created in [step 5](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#5-add-an-infrastructure-application)) is the policy container for your SSH server. Cloudflare refers to your SSH server as a [target](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#4-add-a-target).
211
+
212
+
[Access policies](/cloudflare-one/policies/access/policy-management/) are the rules attached to this Access infrastructure application, determining who can connect and what UNIX usernames they can log in as on the server. Cloudflare will not create new users on the target. UNIX users must already be present on the server.
213
+
208
214
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).
209
215
216
+
:::
217
+
210
218
#### End users
211
219
212
220
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.
- 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, that means the Access policy should be granting access and you should ensure that the Tunnel is healthy in [step 2](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#2-check-target-machine-connection).
224
+
- 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, an administrator must find the Access policy associated with the target machine and add that username to the Access policy. An administrator should have created an Access policy in [substep 9 of step 5: Add an infrastructure application](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#5-add-an-infrastructure-application). If the username is shown, that means the Access policy should be granting access and you should ensure that the tunnel is healthy in [step 2](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#2-check-target-machine-connection).
217
225
218
-
- 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.
226
+
- If the target does not appear in the list, an administrator must audit your organization's policies for the target machine in the Zero Trust dashboard for potential misconfigurations that may be blocking access.
219
227
220
228
#### Administrators
221
229
@@ -233,19 +241,19 @@ You will need Cloudflare dashboard access and log view [permissions](/cloudflare
233
241
234
242
3. Review the **Decision**. If the **Decision** is `Access denied`, select the application and copy the name under App.
235
243
236
-
If the decision is `Access granted`, this mean your connection issue is with the Cloudflare Tunnel, SSH server, or the `sshd_config` file and Access policies are not interfering with your connection attempts.
244
+
If the decision is `Access granted`, Access policies are not interfering with your connection attempts and your connection issue is due to the Cloudflare Tunnel, SSH server, or the `sshd_config` file.
237
245
238
246
4. Go to **Access** > **Applications**.
239
247
240
248
5. Input the app name in the search bar and select the application.
241
249
242
250
6. Select **Configure**.
243
251
244
-
7. Go to **Policies** to review what criteria may be blocking the user.
252
+
7. Go to [**Policies**](/cloudflare-one/policies/access/policy-management/#test-your-policies) to review what criteria may be blocking the user.
245
253
246
254
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.
247
255
248
-
After you have audited your Access policies and are still having connection issues, you must review Tunnel health.
256
+
If you are still having connection issues after auditing your Access policies, review Tunnel health in the following step.
249
257
250
258
### 2. Check target machine connection
251
259
@@ -256,36 +264,36 @@ To check the status of your Tunnel:
256
264
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Networks** > **Routes**.
257
265
2. Search your IP to find the Tunnel associated with the IP.
258
266
259
-
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.
267
+
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 to your Hostname.
260
268
261
269
3. Copy the Tunnel name.
262
270
4. Go to **Networks** > **Tunnels** and search by your Tunnel name.
263
-
5. Review that the [Tunnel status](/cloudflare-one/connections/connect-networks/monitor-tunnels/notifications/#available-notifications) says Active, and not Down, Degraded, or Inactive.
271
+
5. Review that the [Tunnel status](/cloudflare-one/connections/connect-networks/monitor-tunnels/notifications/#available-notifications) says `Active`, and not `Down`, `Degraded`, or `Inactive`.
|**Healthy**| The `cloudflared` process is running and maintaining the expected number of resilient connections to Cloudflare's edge network. | No action is required. Your Tunnel is running correctly. |
268
-
|**Inactive**| The Tunnel has been created (via the API or dashboard) but the `cloudflared` connector has never been run to establish a connection. | Run the Tunnel as a service or using the `clouflared tunnel run` command on your origin server to connect the Tunnel to Cloudflare. Refer to substep 6 of step 1 in the [Create a Tunnel dashboard guide](/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/#1-create-a-tunnel) or step 4 in the [Create a Tunnel API guide](/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/#1-create-a-tunnel). |
275
+
|**Healthy**| The tunnel is active and serving traffic through four connections to the Cloudflare global network.| No action is required. Your Tunnel is running correctly. |
276
+
|**Inactive**| The Tunnel has been created (via the API or dashboard) but the `cloudflared` connector has never been run to establish a connection. | Run the tunnel as a service (recommended) or use the `cloudflared tunnel run` command on your origin server to connect the tunnel to Cloudflare. Refer to [substep 6 of step 1 in the Create a Tunnel dashboard guide](/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/#1-create-a-tunnel) or step 4 in the [Create a Tunnel API guide](/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/#1-create-a-tunnel). |
269
277
|**Down**| The Tunnel was previously connected but is currently disconnected because the `cloudflared` process has stopped. | 1. Ensure the `cloudflared` service or process is actively running on your server. <br /> 2. Check for server-side issues, such as the machine being powered off, an application crash, or recent network changes. |
270
-
|**Degraded**| The `cloudflared` connector is running but has fewer than the expected number of connections (it is connected to a single Cloudflare data center). | 1. Review your `cloudflared` logs for connection failures or error messages. <br /> 2. Investigate local network and firewall rules to ensure they are not blocking connections to other Cloudflare IP ranges. <br /> |
278
+
|**Degraded**| The `cloudflared` connector is running and the tunnel is serving traffic, but at least one individual connection has failed. Further degradation in [tunnel availability](/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-availability/) could risk the tunnel going down and failing to serve traffic. | 1. Review your `cloudflared` logs for connection failures or error messages. <br /> 2. Investigate local network and firewall rules to ensure they are not blocking connections to the [Cloudflare Tunnel IPs and ports](/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-with-firewall/). <br /> |
271
279
272
280
For detailed steps on troubleshooting, refer to the [Troubleshooting Tunnel documentation](/cloudflare-one/connections/connect-networks/troubleshoot-tunnels/). Review the [Tunnel with Firewall documentation](/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-with-firewall/#test-connectivity) to ensure your network is correctly configured to allow `cloudflared` connections.
273
281
274
-
After you have vertified that there are no issues with your Tunnel's health, continue to verifying the user's existence on the target SSH server.
282
+
After you have verified that there are no issues with your Tunnel's health, confirm the user's existence on the target SSH server in the following step.
275
283
276
284
### 3. Confirm user existence on the target server
277
285
278
-
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.
286
+
To verify the existence of the end user on the target SSH 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.
279
287
280
-
If the user exists on the target machine, continue to debugging the `sshd_config` file.
288
+
If the user exists on the target machine, debug your `sshd_config` file in the following step.
281
289
282
290
### 4. Debug `sshd_config` file misconfiguration
283
291
284
292
One reason a user is failing to connect to your SSH endpoint might be the result of a misconfigured `sshd_config` file. Follow the steps below to audit your `sshd_config` file for misconfigurations.
285
293
286
294
#### Review your `sshd` logs
287
295
288
-
`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.
296
+
`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 is likely at `journalctl -u ssh` on Ubuntu and `tail /var/log/auth.log` for Red Hat.
289
297
290
298
Using your `sshd` logs, validate that SSH connection attempts are arriving to the SSH target machine.
291
299
@@ -444,26 +452,26 @@ These troubleshooting steps could result in you being locked out of your SSH ser
444
452
445
453
1. Back up the existing `sshd_config` file.
446
454
447
-
```
455
+
```sh
448
456
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
449
457
```
450
458
451
459
2. Create a new `sshd_config` file.
452
460
453
-
```
461
+
```sh
454
462
vi /etc/ssh/sshd_config
455
463
```
456
464
457
-
3. Enter insert mode by pressing the 'i' character on your keyboard.
465
+
3. Enter insert mode by pressing the 'i' key on your keyboard.
458
466
459
467
4. Paste in the [example file](#review-your-sshd_config-file-for-misconfigurations).
460
468
461
-
5. Exit insert mode by pressing the escape `esc` key.
469
+
5. Exit insert mode by pressing the escape (`esc`) key.
462
470
6. Enter `:x` to save and exit.
463
471
7.[Reload](#reload-your-ssh-server) your SSH server.
464
472
465
473
:::caution[Do not restart]
466
-
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.
474
+
Restarting your `sshd` service will result in the termination of your current SSH connection. Make sure to reload instead of restarting to avoid terminating all currently open SSH sessions.
0 commit comments