Skip to content

Commit

Permalink
Update adding-a-new-ssh-key-to-your-github-account.md (#31103)
Browse files Browse the repository at this point in the history
Co-authored-by: hubwriter <hubwriter@github.com>
  • Loading branch information
dhirschfeld and hubwriter committed Feb 5, 2024
1 parent 2bef58d commit 0b3264f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ After adding a new SSH authentication key to your account on {% data variables.l

Before you can use the {% data variables.product.prodname_cli %} to add an SSH key to your account, you must authenticate to the {% data variables.product.prodname_cli %}. For more information, see [`gh auth login`](https://cli.github.com/manual/gh_auth_login) in the {% data variables.product.prodname_cli %} documentation.

{% ifversion ssh-commit-verification %}At present, you can only use {% data variables.product.prodname_cli %} to add SSH authentication keys, you cannot add SSH signing keys.{% endif %}

To add an SSH authentication key to your GitHub account, use the `ssh-key add` subcommand, specifying your public key. If you're prompted to request additional scopes, follow the instructions in the command line.
To add an SSH key to your GitHub account, use the `ssh-key add` subcommand, specifying your public key. For authentication keys, if you're prompted to request additional scopes, follow the instructions in the command line.

```shell
gh ssh-key add KEY-FILE
gh ssh-key add KEY-FILE --type {authentication|signing}
```

To include a title for the new key, use the `-t` or `--title` flag.
Expand All @@ -80,7 +78,7 @@ gh ssh-key add KEY-FILE --title "personal laptop"
If you generated your SSH key by following the instructions in "[AUTOTITLE](/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)", you can add the key to your account with this command.

```shell
gh ssh-key add ~/.ssh/id_ed25519.pub
gh ssh-key add ~/.ssh/id_ed25519.pub --type signing
```

{% endcli %}
Expand Down

0 comments on commit 0b3264f

Please sign in to comment.