Generating an SSH key using the Che command palette

The following section describes a generation of an SSH key using the Che command palette and its further use in Git provider communication. This SSH key restricts permissions for the specific Git provider; thus, the user has to create a unique SSH key for each Git provider in use.

Prerequisites
Procedure

A common SSH key pair that works with all the Git providers is present by default. To start using it, add the public key to the Git provider.

  1. Generate an SSH key pair that only works with a particular Git provider:

    • In the Che IDE, press F1 to open the Command Palette, or navigate to View → Find Command in the top menu.

      The command palette can be also activated by pressing Ctrl+Shift+p (or Cmd+Shift+p on macOS).

    • Search for SSH: generate key pair for particular host by entering generate into the search box and pressing Enter once filled.

    • Provide the hostname for the SSH key pair such as, for example, github.com.

      The SSH key pair is generated.

  2. Click the View button and copy the public key from the editor and add it to the Git provider.

    As a result of this action, the user can now use another command from the command palette: Clone git repository by providing an SSH secured URL.

Adding the associated public key to a repository or account on GitHub

To add the associated public key to a repository or account on GitHub:

  1. Navigate to github.com.

  2. Click the drop-down arrow next to the user icon in the top-right corner of the window.

  3. Click SettingsSSH and GPG keys and then click the New SSH key button.

  4. In the Title field, type a title for the key, and in the Key field, paste the public key copied from Che.

  5. Click the Add SSH key button.

Adding the associated public key to a Git repository or account on GitLab

To add the associated public key to a Git repository or account on GitLab:

  1. Navigate to gitlab.com.

  2. Click the user icon in the top-right corner of the window.

  3. Click SettingsSSH Keys.

  4. In the Title field, type a title for the key and in the Key field, paste the public key copied from Che.

  5. Click the Add key button.