Repository navigation
Description
Summary
If ~/.ssh/config contains a catch-all Host * block with a ProxyCommand declared before the extension's own block, the extension refuses to connect with a modal Unexpected SSH Config Option and there is no way to proceed. This is the normal state of affairs for anyone whose SSH config is generated by a config manager — assh is the case I hit, and it is not fixable from the assh side.
Reproduce
-
Have
~/.ssh/configcontain, in this order:Host * ProxyCommand /opt/homebrew/bin/assh connect --port=%p %h # --- START CODER VSCODE coder.example.com --- Host coder-vscode.coder.example.com--* ProxyCommand "…/coder-darwin-arm64" … ssh --stdio … %h # --- END CODER VSCODE coder.example.com --- -
Open a workspace in VS Code Desktop.
-
Modal appears:
Your SSH config is overriding the "ProxyCommand" property to "/opt/homebrew/bin/assh connect --port=%p %h" when it expected "…coder-darwin-arm64 … ssh --stdio … %h" for the "coder-vscode.coder.example.com--user--workspace.dev" host. Please fix this and try again!
The only button is Reload Window, after which
closeRemote()runs and the connection is aborted.
Confirmed with OpenSSH that the extension's reading is correct:
$ /usr/bin/ssh -G coder-vscode.coder.example.com--user--workspace.dev | grep -i proxycommand
proxycommand /opt/homebrew/bin/assh connect --port=%p %hRoot cause
sshConfig.tsappendBlock()puts the Coder block at the end of the file when no existing marker block is found.- OpenSSH uses the first value obtained for each keyword, so an earlier
Host *block wins. remote.ts(updateSSHConfig) then compares expected against effective forProxyCommand,UserKnownHostsFileandStrictHostKeyChecking, and on any mismatch shows the modal, callscloseRemote()and throws.
So the extension writes its block into a position where it is guaranteed to lose, then treats losing as fatal.
Why users of config managers cannot fix this
With assh specifically, the global ProxyCommand is not user configuration that can be removed — it is how assh works, and it is emitted unconditionally for the defaults block (pkg/config/host.go):
if h.isDefault {
if h.noAutomaticRewrite {
fmt.Fprintf(w, " ProxyCommand %s connect --no-rewrite --port=%%p %%h\n", asshBinaryPath)
} else {
fmt.Fprintf(w, " ProxyCommand %s connect --port=%%p %%h\n", asshBinaryPath)
}
}Adding a per-host entry for coder-vscode.* to assh.yml does not help either, because for non-default hosts assh writes ProxyCommand as a comment and resolves it internally at connect time:
} else {
if h.ProxyCommand != "" {
fmt.Fprintf(w, " # ProxyCommand %s\n", h.ProxyCommand)
}
}assh also regenerates ~/.ssh/config from assh.yml, so manually reordering the blocks does not survive.
Current workaround
Setting remote.SSH.configFile to a dedicated file works, since getSshConfigPath() honours it:
const configured = vscode.workspace.getConfiguration().get<string>("remote.SSH.configFile");
return expandPath(configured || path.join("~", ".ssh", "config"));The cost is that Remote-SSH then only lists hosts from that file, so every other SSH host disappears from the picker. This workaround is not mentioned in the error message or, as far as I can find, in the docs.
Suggested fixes
Roughly in order of preference:
- Write the Coder block above any catch-all block rather than appending to the end, so the extension's values win by SSH's own first-match-wins rule. This overlaps with the placement idea in Support all accumulating SSH config options instead of re-implementing override behavior #695.
- Set the values on the command line instead of relying on config precedence — Remote-SSH's
ProxyCommandcan be supplied per-host in a file the extension fully controls, or options can be passed as-oflags, which beat config file entries. - Make the check non-fatal, or add an escape hatch. There is currently no setting to bypass it; I enumerated every entry in
contributes.configuration. - At minimum, name the workaround in the error message. The modal says "Please fix this and try again!" without saying that the conflicting block may be machine-generated, or that
remote.SSH.configFileexists.
Environment
| Extension | coder.coder-remote v1.15.2 |
| Coder | v2.34.7 (AGPL) |
| OpenSSH | OpenSSH_10.2p1, LibreSSL 3.3.6 |
| OS | macOS (darwin arm64) |
| SSH config manager | assh |
Related: #695.
Activity
linear-code commentedon Jul 31, 2026
ENG-3117
fix: write workspace SSH hosts to a shared glob include that ssh read…
EhabY commentedon Aug 14, 2026
Thanks for the detailed report, we've addressed this in #1061, I'll do a release next week but in the meantime you can apply the workaround you found or install the VSIX manually from
main: https://github.com/coder/vscode-coder/actions/runs/31798402004/artifacts/9218273669