Skip to content

Commit

Permalink
Mention SSH server requirement for JetBrains and CLI (github#32024)
Browse files Browse the repository at this point in the history
  • Loading branch information
hubwriter authored Oct 26, 2022
1 parent 108f3da commit d9ce5ef
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ shortTitle: Create a codespace

## About codespace creation

You can create a codespace on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. Use the tabs in this article to display instructions for each of these ways of creating a codespace.
{% data reusables.codespaces.ways-to-create-a-codespace %} Use the tabs in this article to display instructions for each of these ways of creating a codespace.

{% note %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To work in a codespace in a JetBrains IDE you need:
* A valid JetBrains license
* The JetBrains Gateway application
* {% data variables.product.prodname_cli %} version 2.2.0 or later
* An existing codespace that's running an SSH server

### JetBrains license

Expand Down Expand Up @@ -68,9 +69,17 @@ gh --version

For more information, see "[About GitHub CLI](/github-cli/github-cli/about-github-cli)."

## Authenticating with {% data variables.product.prodname_cli %}
### Codespace running an SSH server

To use {% data variables.product.prodname_cli %} for {% data variables.product.prodname_github_codespaces %} you must authenticate with {% data variables.product.prodname_dotcom_the_website %}, specifying the `codespace` scope.
You must have an existing codespace to connect to. {% data reusables.codespaces.ways-to-create-a-codespace %} For more information, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."

{% data reusables.codespaces.ssh-server-installed %}

For more information about the `devcontainer.json` file and the default container image, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."

## Authenticating with {% data variables.product.prodname_dotcom_the_website %}

Before you can use the JetBrains Gateway to connect to your codespaces, you must use {% data variables.product.prodname_cli %} to authenticate with {% data variables.product.prodname_dotcom_the_website %}, specifying the `codespace` scope.

1. In a terminal window:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ To run commands on the remote codespace machine, from your terminal, you can SSH
gh codespace ssh -c CODESPACE-NAME
```

{% note %}

**Note**: {% data reusables.codespaces.ssh-server-installed %}

<br>For more information about the `devcontainer.json` file and the default container image, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."

{% endnote %}

{% data variables.product.prodname_github_codespaces %} copies your GitHub SSH keys into the codespace on creation for a seamless authentication experience. You may be asked to enter the passphrase for your SSH key, after which you will get a command prompt from the remote codespace machine.

If you don't have any SSH keys, follow the instructions in "[Generating a new SSH key and adding it to the ssh-agent](/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)."
Expand Down
11 changes: 11 additions & 0 deletions data/reusables/codespaces/ssh-server-installed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The codespace you connect to must be running an SSH server. The default container image includes an SSH server, which is started automatically. If your codespaces are not created from the default image, you can install and start an SSH server by adding the following to the `features` object in your `devcontainer.json` file.

```json
"features": {
...
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
...
}
```
1 change: 1 addition & 0 deletions data/reusables/codespaces/ways-to-create-a-codespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You can create a codespace on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}.

0 comments on commit d9ce5ef

Please sign in to comment.