Skip to main content
← Back to list
01Issue
BugOpenExtensionsPublicTeam
AssigneesNone

Relationships

#4910 @swamp/ssh: repin fails on Windows targets - POSIX `true` liveness probe not found in cmd.exe, new pin never persisted

Opened by kneel · 11/19/2026

Description

repin is the only sanctioned way to update a tofu host-key pin after a legitimate host rekey. On Windows OpenSSH targets it never persists the new pin: after connecting, the method runs a true liveness probe. Windows' default shell for OpenSSH is cmd.exe (PowerShell is no better), where true is not a command, so the probe exits 1, repin reports failure, and the pin is left unchanged.

Consequence: after a Windows host's SSH key changes (OS reinstall, host-key regeneration), a tofu-pinned @swamp/ssh model becomes permanently unreachable with no in-tool recovery path:

  • exec fails host-key verification (pinned old key vs presented new key).
  • swamp data delete on the hostKeyPin-* resource does not stick - the next exec re-materializes and re-commits the behavior state (pin included), so the stale pin returns.
  • repin refuses unless policy is tofu, and under tofu it fails on the true probe as above.

The only available workarounds are both undesirable: temporarily set hostKeyPolicy: insecure (disables verification for the connection), or plant a true.cmd / true.exe shim on the Windows host so the probe returns 0.

Steps to reproduce

  1. @swamp/ssh model targeting a Windows OpenSSH host (default cmd.exe shell), hostKeyPolicy: tofu, password auth.
  2. Establish the pin (run exec once; tofu pins the current key).
  3. Change the host's SSH host key (reinstall the OS, or regenerate the ssh_host_* keys).
  4. swamp behavior run <model> repin --input hosts=all

Observed:

Error: repin failed on 1/1 host(s): <host> (exit 1: Warning: Permanently added
'<alias>' (ED25519) to the list of known hosts.
'true' is not recognized as an internal or external command,
operable program or batch file.)

Pin unchanged. Confirmed root cause locally: creating C:\Windows\System32\true.cmd containing @exit /b 0 makes the probe return 0, after which repin succeeds and persists the new pin (repinned <host>: SHA256:<old> -> SHA256:<new>, exitCode 0).

Expected

repin persists the new pin on Windows targets regardless of the remote shell. Possible fixes:

  • Use a shell-agnostic liveness check (e.g. exit 0, valid in both sh and cmd.exe) instead of true, or detect the remote platform; or
  • Persist the pin before the liveness probe and downgrade a failed probe to a warning rather than discarding the re-pin.

Environment

  • swamp CLI: 20261114.210101.0-sha.537e03d1
  • @swamp/ssh typeVersion: 2026.10.20.1
  • Target: Windows Server 2022 Standard (Server Core), OpenSSH Server, default cmd.exe shell, password auth, reached via a WAN DNAT port-forward.

Upstream repository: https://github.com/swamp-club/swamp-extensions

Environment

  • Extension: @swamp/ssh@2026.10.23.1
  • swamp: 20261114.210101.0-sha.537e03d1
  • OS: linux (x86_64)
  • Deno: 2.9.8
  • Shell: /bin/zsh
02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

11/19/2026, 6:18:03 PM

No activity in this phase yet.

03Sludge Pulse
kneel moved this from a private collective to public11/21/2026, 7:41:20 PM
Editable. Press Enter to edit.

system commented 11/19/2026, 6:18:03 PM

Classified automatically when this issue was filed.

  • Source: Extensions

If you feel this classification is incorrect, add a ripple to tell us so.

Sign in to post a ripple.