Title: Use wildcard SSH host names · Issue #14986 · coder/coder · GitHub
Open Graph Title: Use wildcard SSH host names · Issue #14986 · coder/coder
X Title: Use wildcard SSH host names · Issue #14986 · coder/coder
Description: I would like to propose that we configure SSH with a wildcard instead of individual host names. For example: coder.* ProxyCommand coder %h And in ssh.go we trim out the coder. prefix. Mainly, this is to support the IDEs. VS Code already ...
Open Graph Description: I would like to propose that we configure SSH with a wildcard instead of individual host names. For example: coder.* ProxyCommand coder %h And in ssh.go we trim out the coder. prefix. Mainly, this ...
X Description: I would like to propose that we configure SSH with a wildcard instead of individual host names. For example: coder.* ProxyCommand coder %h And in ssh.go we trim out the coder. prefix. Mainly, this ...
Opengraph URL: https://github.com/coder/coder/issues/14986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use wildcard SSH host names","articleBody":"I would like to propose that we configure SSH with a wildcard instead of individual host names. For example:\n\n```\ncoder.*\n ProxyCommand coder %h\n```\n\nAnd in `ssh.go` we trim out the `coder.` prefix.\n\nMainly, this is to support the IDEs. VS Code already does this with a special `vscodessh` sub-command but I think we should roll that up into `ssh`, then JetBrains can also benefit.\n\nThe main reason is that the IDEs support connecting to anyone's workspace (for admins). That means potentially hundreds of SSH config entries, and potentially hundreds of calls to template resources, since that has to be [done for every workspace](https://github.com/coder/coder/blob/ea3b13c78e2bcc15317ba74070084b61233b7589/cli/configssh.go#L161), at least the ones that are off, to get the agent names.\n\nIt would eventually remove the need for the Gateway and VS Code plugins to implement their own versions of `config-ssh` as they currently do, but this would need one more tweak to include the deployment URL in the host (for example `coder-vscode.dev.coder.com--*` is generated by the VS Code plugin).\n\nIt would eliminate the resource fetch loop in `config-ssh` as well.\n\nAs one data point, I tested with 138 off workspaces and configuring SSH took 20 seconds.\n\nAlternatives:\n- A separate `idessh` sub-command that does this, maybe just rename `vscodessh` and add a deprecated alias, but I believe it also has some VS Code-specific logic that would need to be figured out.\n- Gate it behind flags (`config-ssh --wildcard` and `ssh --wildcard` or some such).\n- Skip changing `config-ssh` for now, and add `ssh --strip-prefix=coder-vscode.dev.coder.com--` or some such flag to at least allow the IDEs to configure their own wildcard host.\n- From the IDEs, we could instead do some inline shell magic to strip out the prefix, but I am not sure what Windows support looks like.\n\n```\ncoder-vscode.dev.coder.com--*\n ProxyCommand coder $(echo \"%h\" | sed 's/coder-vscode.dev.coder.com--//')\n```\n\n---\n\n**Edit**: I presented the prefix flag as an alternative, but actually no matter what we will need a prefix flag for `ssh` because we want unique hosts for the plugins so they can add different SSH configuration if necessary (for example the session type env var, although that is deprecated). I also learned that `config-ssh` already has an `ssh-prefix-host` flag, so it makes sense to add that same flag to `ssh`. Then we can use `ProxyCommand coder ssh --ssh-prefix-host coder-gateway.dev.coder.com. %h` and emit a single wildcard entry in the plugins.\n\nI think we should still eventually change `config-ssh` to use wildcards, and switch the plugins to use `config-ssh` instead of replicating that effort, but that can be done later.","author":{"url":"https://github.com/code-asher","@type":"Person","name":"code-asher"},"datePublished":"2024-10-04T22:27:06Z","url":"https://github.com/coder/coder/issues/14986"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:64cdc37c-9a7d-eb3b-3bab-419fa3f56ec0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9AC:6DC60:19C39DE:206DE7D:6B017E3E |
| html-safe-nonce | 59c9efc6ff9b1277a165ca90e7d09a0b7058245b244248f4a145cab318262ebb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUFDOjZEQzYwOjE5QzM5REU6MjA2REU3RDo2QjAxN0UzRSIsInZpc2l0b3JfaWQiOiIxMjM3NTM2NjA1NTYwOTk1MzkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1af2ba907ce3bfed9889bd8e0ea97531e175643bf7bfd94b2a06a87d04783525 |
| hovercard-subject-tag | issue:2567489512 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/14986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f0e7dee5e2dec2dbd5e59e4e695b0c532b56cc02f24be56289f4ddd6127c66be/coder/coder/issues/14986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f0e7dee5e2dec2dbd5e59e4e695b0c532b56cc02f24be56289f4ddd6127c66be/coder/coder/issues/14986 |
| og:image:alt | I would like to propose that we configure SSH with a wildcard instead of individual host names. For example: coder.* ProxyCommand coder %h And in ssh.go we trim out the coder. prefix. Mainly, this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | code-asher |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width