Repository navigation
fix(ssh): include the Coder SSH config where OpenSSH reads it off Windows - #1226
Merged
Merged
Conversation
EhabY
force-pushed
the
fix/ssh-home-from-passwd
branch
from
December 1, 2026 22:07
9c562ec to
769cde0
Compare
jeremyruppel
approved these changes
Dec 1, 2026
EhabY
force-pushed
the
fix/ssh-home-from-passwd
branch
from
December 2, 2026 10:24
769cde0 to
0b7eb7a
Compare
…dows OpenSSH reads ~/.ssh/config from the passwd entry and ignores HOME, but the extension wrote the include into $HOME/.ssh/config through os.homedir(). With HOME pointing elsewhere, ssh never saw the include. - Write the user's config under the passwd home (os.userInfo()), falling back to os.homedir() without a passwd entry. - OpenSSH expands ~ in Include from HOME (8.9) or the passwd entry (10.2), so write ~/... only when both are the same directory, else the absolute path.
EhabY
force-pushed
the
fix/ssh-home-from-passwd
branch
from
December 2, 2026 10:37
0b7eb7a to
b0624f7
Compare
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.
Part of VSC-58
Stack: #1221 (Git for Windows) → this PR → #1227 (
SshConfigclass to module functions).Off Windows, OpenSSH reads
.ssh/configfrom the passwd entry's home and ignoresHOME. The extension found the user's config throughos.homedir(), which followsHOME. WithHOMEpointing elsewhere (an overriddenHOME, some containers and shells), the include block went into$HOME/.ssh/config, a file ssh never opens, and the workspace host got noProxyCommand. Raised in the #1221 review.getSshHomeDir(). Off Windows that isos.userInfo().homedir(the passwd entry), withos.homedir()as the fallback when there is no passwd entry. On Windows it is unchanged.~inIncludefromHOMEin 8.9 (checked on Ubuntu) but from the passwd entry in 10.2 (the reviewer's check). So~/...is written only when both are the same directory; otherwise the include gets the absolute path, which every version reads.prod +31/−14, tests +65/−1.
Testing: unit tests mock the passwd entry and cover the fallback. A real-ssh test sets
HOMEto the fixture's parent and resolves the host. It runs on Linux and macOS CI and is skipped on Windows. The OpenSSH 8.9 behavior above was checked by hand in WSL.🤖 Generated with Claude Code