Skip to content

Commit 6e3f146

Browse files
authored
repo sync
2 parents 34295cf + 079c229 commit 6e3f146

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

content/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,42 @@ If you don't want to reenter your passphrase every time you use your SSH key, yo
2020
{% data reusables.command_line.open_the_multi_os_terminal %}
2121
2. Paste the text below, substituting in your {% data variables.product.product_name %} email address.
2222
```shell
23-
$ ssh-keygen -t rsa -b 4096 -C "<em>your_email@example.com</em>"
23+
$ ssh-keygen -t ed25519 -C "<em>your_email@example.com</em>"
2424
```
25+
{% note %}
26+
27+
**Note:** If you are using a legacy system that doesn't support the Ed25519 algorithm, use:
28+
```shell
29+
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
30+
```
31+
32+
{% endnote %}
2533
This creates a new ssh key, using the provided email as a label.
2634
```shell
27-
> Generating public/private rsa key pair.
35+
> Generating public/private ed25519 key pair.
2836
```
2937
3. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
3038

3139
{% mac %}
3240

3341
```shell
34-
> Enter a file in which to save the key (/Users/<em>you</em>/.ssh/id_rsa): <em>[Press enter]</em>
42+
> Enter a file in which to save the key (/Users/<em>you</em>/.ssh/id_ed25519): <em>[Press enter]</em>
3543
```
3644

3745
{% endmac %}
3846

3947
{% windows %}
4048

4149
```shell
42-
> Enter a file in which to save the key (/c/Users/<em>you</em>/.ssh/id_rsa):<em>[Press enter]</em>
50+
> Enter a file in which to save the key (/c/Users/<em>you</em>/.ssh/id_ed25519):<em>[Press enter]</em>
4351
```
4452

4553
{% endwindows %}
4654

4755
{% linux %}
4856

4957
```shell
50-
> Enter a file in which to save the key (/home/<em>you</em>/.ssh/id_rsa): <em>[Press enter]</em>
58+
> Enter a file in which to save the key (/home/<em>you</em>/.ssh/id_ed25519): <em>[Press enter]</em>
5159
```
5260

5361
{% endlinux %}
@@ -81,18 +89,18 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
8189
$ touch ~/.ssh/config
8290
```
8391
84-
* Open your `~/.ssh/config` file, then modify the file, replacing ` ~/.ssh/id_rsa` if you are not using the default location and name for your `id_rsa` key.
92+
* Open your `~/.ssh/config` file, then modify the file, replacing ` ~/.ssh/id_ed25519` if you are not using the default location and name for your `id_ed25519` key.
8593
8694
```
8795
Host *
8896
AddKeysToAgent yes
8997
UseKeychain yes
90-
IdentityFile ~/.ssh/id_rsa
98+
IdentityFile ~/.ssh/id_ed25519
9199
```
92100
93101
3. Add your SSH private key to the ssh-agent and store your passphrase in the keychain. {% data reusables.ssh.add-ssh-key-to-ssh-agent %}
94102
```shell
95-
$ ssh-add -K ~/.ssh/id_rsa
103+
$ ssh-add -K ~/.ssh/id_ed25519
96104
```
97105
{% note %}
98106

0 commit comments

Comments
 (0)