Skip to content

Commit 427ab70

Browse files
committed
fix(ssh): isolate managed tunnel processes
- Disable OpenSSH connection multiplexing for T3-managed port forwards. - Prevent inherited ControlMaster settings from making supervised tunnels exit early. - Cover the tunnel command options in the lifecycle test.
1 parent b44ed83 commit 427ab70

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/ssh/src/tunnel.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,11 @@ describe("ssh tunnel scripts", () => {
381381

382382
const first = yield* manager.ensureEnvironment(target);
383383
assert.equal(first.httpBaseUrl, "http://127.0.0.1:41773/");
384+
const firstTunnelArgs = spawnedCommands.find((args) => args.includes("-N"));
385+
assert.isDefined(firstTunnelArgs);
386+
assert.include(firstTunnelArgs, "ControlMaster=no");
387+
assert.include(firstTunnelArgs, "ControlPath=none");
388+
assert.include(firstTunnelArgs, "ControlPersist=no");
384389

385390
yield* manager.disconnectEnvironment(target);
386391
assert.equal(tunnelKillCount, 1);

‎packages/ssh/src/tunnel.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,12 @@ const startSshTunnel = Effect.fn("ssh/tunnel.startSshTunnel")(function* (input:
963963
"-o",
964964
"ExitOnForwardFailure=yes",
965965
"-o",
966+
"ControlMaster=no",
967+
"-o",
968+
"ControlPath=none",
969+
"-o",
970+
"ControlPersist=no",
971+
"-o",
966972
"ServerAliveInterval=15",
967973
"-o",
968974
"ServerAliveCountMax=3",

0 commit comments

Comments
 (0)