Skip to content

Commit

Permalink
Clarify how SSH keys are selected (#7325)
Browse files Browse the repository at this point in the history
Fixes: https://github.com/orgs/community/discussions/52556

Update the help text for `gh codespace ssh` to provide more details about how SSH keys are selected.
  • Loading branch information
jkeech committed Apr 17, 2023
1 parent ee547a1 commit 4b5a903
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/cmd/codespace/ssh.go
Expand Up @@ -56,8 +56,14 @@ func newSSHCmd(app *App) *cobra.Command {
The 'ssh' command is used to SSH into a codespace. In its simplest form, you can
run 'gh cs ssh', select a codespace interactively, and connect.
By default, the 'ssh' command will create a public/private ssh key pair to
authenticate with the codespace inside the ~/.ssh directory.
The 'ssh' command will automatically create a public/private ssh key pair in the
~/.ssh directory if you do not have an existing valid key pair. When selecting the
key pair to use, the preferred order is:
1. Key specified by -i in <ssh-flags>
2. Automatic key, if it already exists
3. First valid key pair in ssh config (according to ssh -G)
4. Automatic key, newly created
The 'ssh' command also supports deeper integration with OpenSSH using a '--config'
option that generates per-codespace ssh configuration in OpenSSH format.
Expand Down

0 comments on commit 4b5a903

Please sign in to comment.