Skip to content

gh cs: add ssh --config flag #4713

@adonovan

Description

@adonovan

From #4486 (comment):

One option here would be to have a command, say gh cs ssh --config, simply emit a hunk of ssh_config syntax to stdout. Users could directly incorporate this into their ~/.ssh/config, or save it in a separate file (overwriting it with updated information when necessary), and pull that into their main ~/.ssh/config with an include directive.
Something like:

host znull-github-github-p79g6r727w7p
  user root
  hostname localhost
  port 23456
  NoHostAuthenticationForLocalhost yes

with a host stanza for each codespace. With this setup, other ssh integrations would just work. Shell tab-complete for ssh hosts would pick this up, for example. scp would just work. Git ssh remotes could be configured for the codespace as well.

There are many ways one could approach the underlying problem; we shouldn't overanchor on the one proposed here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions