Fix Windows SSH compatibility: ProxyCommand, key ACLs, and ESM require - #70
Open
shaunymca wants to merge 1 commit into
Open
Fix Windows SSH compatibility: ProxyCommand, key ACLs, and ESM require#70shaunymca wants to merge 1 commit into
shaunymca wants to merge 1 commit into
Conversation
- vers-client.ts, swarm.ts: remove 2>/dev/null from ProxyCommand — this
Unix shell redirect is passed literally to openssl on Windows native
ssh.exe (System32), breaking every SSH connection. The -quiet flag
already suppresses the relevant stderr output.
- vers-client.ts, swarm.ts: replace UserKnownHostsFile=/dev/null with
a platform-aware value (NUL on Windows, /dev/null elsewhere) — /dev/null
works on Windows by accident via internal OpenSSH mapping but is not
guaranteed across all Windows versions and distributions.
- vers-client.ts: after writing the SSH private key file, run icacls on
Windows to set correct ACLs — Node's mode: 0o600 is ignored on Windows
NTFS, leaving the key accessible to SYSTEM and Administrators, which
causes Windows native ssh.exe to refuse the key with bad permissions.
- vers-client.ts: replace require('fs').readFileSync with a proper ESM
import — require() is not available in strict ESM and was only working
due to Bun's leniency.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vers-client.ts,swarm.ts: remove2>/dev/nullfromProxyCommand— this Unix shell redirect is passed literally toopensslon Windows nativessh.exe(System32), breaking every SSH connection. The-quietflag already suppresses the relevant stderr output.vers-client.ts,swarm.ts: replaceUserKnownHostsFile=/dev/nullwith a platform-aware value (NULon Windows,/dev/nullelsewhere) —/dev/nullworks on Windows by accident via an internal OpenSSH mapping but is not guaranteed across all Windows versions.vers-client.ts: after writing the SSH private key file, runicaclson Windows to set correct ACLs — Node's{ mode: 0o600 }is silently ignored on Windows NTFS, leaving the key accessible toSYSTEMandAdministrators, causing Windows nativessh.exeto refuse it withbad permissions.vers-client.ts: replacerequire('fs').readFileSyncwith a proper ESMimport—require()is unavailable in strict ESM and only worked due to Bun's leniency.Test plan
ssh.exe(System32)bad permissionserror on WindowsUserKnownHostsFileusesNULon Windows and/dev/nullon Unix🤖 Generated with Claude Code