Skip to content

Commit 037df07

Browse files
authored
[Containers] Document SSH enabled by default (#30678)
1 parent a558414 commit 037df07

3 files changed

Lines changed: 62 additions & 11 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: SSH through Wrangler is now enabled by default for Containers
3+
description: SSH through Wrangler is now enabled by default. Add a public key to connect, or opt out in your Container configuration.
4+
products:
5+
- containers
6+
date: 2026-05-12
7+
---
8+
9+
import { WranglerConfig } from "~/components";
10+
11+
SSH through Wrangler is now enabled by default for [Containers](/containers/). Previously, you had to set `ssh.enabled` to `true` in your Container configuration before you could connect.
12+
13+
This change does not expose any publicly accessible ports on your Container. The SSH service is reachable only through [`wrangler containers ssh`](/workers/wrangler/commands/containers/#containers-ssh), which authenticates against your Cloudflare account. You also need to add an `ssh-ed25519` public key to `authorized_keys` before anyone can connect, so enabling SSH alone does not grant access.
14+
15+
To connect, add a public key to your Container configuration and run `wrangler containers ssh <INSTANCE_ID>`:
16+
17+
<WranglerConfig>
18+
19+
```jsonc
20+
{
21+
"containers": [
22+
{
23+
"authorized_keys": [
24+
{
25+
"name": "<NAME>",
26+
"public_key": "<YOUR_PUBLIC_KEY_HERE>",
27+
},
28+
],
29+
},
30+
],
31+
}
32+
```
33+
34+
</WranglerConfig>
35+
36+
To disable SSH, set `ssh.enabled` to `false` in your Container configuration:
37+
38+
<WranglerConfig>
39+
40+
```jsonc
41+
{
42+
"containers": [
43+
{
44+
"ssh": {
45+
"enabled": false,
46+
},
47+
},
48+
],
49+
}
50+
```
51+
52+
</WranglerConfig>
53+
54+
For more information, refer to the [SSH documentation](/containers/ssh/).

src/content/docs/containers/ssh.mdx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ products:
1010

1111
import { WranglerConfig } from "~/components";
1212

13-
Anyone with write access to a Container can SSH into it with Wrangler as long as SSH is enabled.
13+
Anyone with write access to a Container can SSH into it with Wrangler as long as a matching public key is listed in `authorized_keys`.
14+
15+
SSH does not expose a publicly accessible port on the Container. The only way to connect is through Wrangler with [`wrangler containers ssh`](/workers/wrangler/commands/containers/#containers-ssh), which authenticates against your Cloudflare account.
1416

1517
## Configure SSH
1618

1719
SSH can be configured in your [Container's configuration](/workers/wrangler/configuration/#containers) with the `ssh` and `authorized_keys` properties. Only the `ssh-ed25519` key type is supported.
1820

19-
The `ssh.enabled` property only controls whether you can SSH into a Container through Wrangler.
20-
If `ssh.enabled` is false but keys are still present in `authorized_keys`, the SSH service will still be started on the Container.
21+
The `ssh.enabled` property only controls whether you can SSH into a Container through Wrangler. It defaults to `true`. Set it to `false` to disable SSH access completely.
2122

2223
## Connect with Wrangler
2324

24-
To SSH into a Container with Wrangler, you must first enable SSH in your Container configuration.
25-
The following example shows a basic configuration:
25+
To SSH into a Container with Wrangler, add an `ssh-ed25519` public key to `authorized_keys` in your Container configuration. The following example shows a basic configuration:
2626

2727
<WranglerConfig>
2828

@@ -31,9 +31,6 @@ The following example shows a basic configuration:
3131
"containers": [
3232
{
3333
// other options here...
34-
"ssh": {
35-
"enabled": true
36-
},
3734
"authorized_keys": [
3835
{
3936
"name": "<NAME>",
@@ -61,4 +58,4 @@ wrangler containers ssh <INSTANCE_ID>
6158

6259
## Process visibility
6360

64-
Without the [`containers_pid_namespace`](/workers/configuration/compatibility-flags/#use-an-isolated-pid-namespace-for-containers) compatibility flag, all processes inside the VM are visible when you connect to your Container through SSH. This flag is turned on by default for Workers with a [compatibility date](/workers/configuration/compatibility-dates/) of `2026-04-01` or later.
61+
Without the [`containers_pid_namespace`](/workers/configuration/compatibility-flags/#use-an-isolated-pid-namespace-for-containers) compatibility flag, all processes inside the VM are visible when you connect to your Container through SSH. This flag is turned on by default for Workers with a [compatibility date](/workers/configuration/compatibility-dates/) of `2026-04-01` or later.

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ Configuration for SSH access to a Container instance through Wrangler. For a gui
14261426
The following options are available:
14271427

14281428
- `enabled` <Type text="boolean" /> <MetaInfo text="optional" />
1429-
- Whether SSH through Wrangler is enabled. Defaults to `false`.
1429+
- Whether SSH through Wrangler is enabled. Defaults to `true`. Set to `false` to disable SSH access.
14301430

14311431
- `port` <Type text="number" /> <MetaInfo text="optional" />
14321432
- The port for the SSH service to run on. Defaults to `22`.
@@ -1896,4 +1896,4 @@ And the `.wrangler/deploy/config.json` contains the path to the generated config
18961896
{
18971897
"configPath": "../../dist/wrangler.jsonc"
18981898
}
1899-
```
1899+
```

0 commit comments

Comments
 (0)