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:
execfails host-key verification (pinned old key vs presented new key).swamp data deleteon thehostKeyPin-*resource does not stick - the nextexecre-materializes and re-commits the behavior state (pin included), so the stale pin returns.repinrefuses unless policy istofu, and undertofuit fails on thetrueprobe 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
@swamp/sshmodel targeting a Windows OpenSSH host (defaultcmd.exeshell),hostKeyPolicy: tofu, password auth.- Establish the pin (run
execonce; tofu pins the current key). - Change the host's SSH host key (reinstall the OS, or regenerate the
ssh_host_*keys). 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 bothshandcmd.exe) instead oftrue, 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.exeshell, 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
Open
No activity in this phase yet.
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.