Skip to content

Non-recent versions of JetBrains editors don't support Include statements in SSH config #2317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mafredri opened this issue Jun 14, 2022 · 1 comment · Fixed by #2341
Closed
Assignees
Labels
cli Area: CLI

Comments

@mafredri
Copy link
Member

mafredri commented Jun 14, 2022

JetBrains only added support for SSH config parsing via ssh -G this year (https://youtrack.jetbrains.com/issue/IDEA-221941/Get-rid-of-sshconfig-parser-use-ssh-G-instead). Before that they used a custom config parser that does not support Include coder, which we're currently using (#1326, #1900).

JetBrains has (or plans to) make OpenSSH config parsing the default, but recent versions (e.g. 2022.1.3`) require this parser to be manually enabled in Advanced settings.

As a result, it's not possible to connect to coder workspaces unless the new parser is enabled, or manual changes are made to ~/.ssh/config.

Our options are (there may be more, ideas welcome):

  1. Document the JetBrains gotcha, instruct the user how to change the parser (or update their SSH config for older versions (e.g. see Host coder.* below))
  2. Revert the changes in feat: Refactor CLI config-ssh to improve UX #1900 either fully or partially (there are some other good changes like safer config writing and --diff in that PR)
  3. Add an option like coder config-ssh --jetbrains-compat (or --single-file) which writes to ~/.ssh/config
  4. Something else?

Example for how to define a catch-all that could be used as part of docs (or second option):

Host coder.*
	ConnectTimeout=0
	StrictHostKeyChecking=no
	UserKnownHostsFile=/dev/null
	LogLevel ERROR
	ProxyCommand "coder" --global-config "/Users/me/Library/Application Support/coderv2" ssh --stdio $(echo %h | cut -d. -f2-)

Also note that only having the glob (Host coder.*) is incompatible with VSCode Remote SSH (the workspace won't be listed).

This is a blocker for #2153 (if we decide to do it).

@mafredri mafredri added Community MVP needs decision Needs a higher-level decision to be unblocked. cli Area: CLI labels Jun 14, 2022
@ketang
Copy link
Contributor

ketang commented Jun 14, 2022

Aww man, I really liked that change too. I think we need to back it out. JetBrains IDEs need to Just Work™ out of the box.

@mafredri mafredri self-assigned this Jun 15, 2022
mafredri added a commit that referenced this issue Jun 15, 2022
This commit partially reverts #1900 and removes the separate
`~/.ssh/coder` config file whilst keeping most other features.

This will allow us to remain more compatible with different IDEs.

Fixes #2317
@mafredri mafredri removed the needs decision Needs a higher-level decision to be unblocked. label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Area: CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants