You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: recipes/shell/ssh/keys.md
+10-15
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,8 @@ If the machine doesn't have an SSH key set, you'll have to _generate_ one - see
60
60
61
61
How to generate a new SSH key pair.
62
62
63
+
_Note that GitHub dropped support for RSA so here we use Ed25519 algorithm instead. See [GitHub doc](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)._
64
+
63
65
First _navigate_ to the appropriate directory, to ensure the files get generated there.
64
66
65
67
```sh
@@ -72,42 +74,35 @@ Use the command below or see a bit further down for use with more flags.
72
74
Create the key pair:
73
75
74
76
```sh
75
-
$ ssh-keygen -t rsa
77
+
$ ssh-keygen -t ed25519
76
78
```
77
79
78
80
If this is your first SSH key on the current machine, you can leave the location as the default and press enter.
79
81
80
82
```
81
83
Generating public/private rsa key pair.
82
-
Enter file in which to save the key (~/.ssh/id_rsa):
84
+
Enter file in which to save the key (~/.ssh/id_ed25519):
83
85
```
84
86
85
87
That will use filenames as:
86
88
87
89
```
88
-
~/.ssh/id_rsa
89
-
~/.ssh/id_rsa.pub
90
+
~/.ssh/id_ed25519
91
+
~/.ssh/id_ed25519.pub
90
92
```
91
93
92
94
Or, enter a custom name like `id_rsa_abc` and press enter.
93
95
94
96
You can press enter to skip through the rest of the options - unless you want to set a passphrase on the SSH key.
95
97
96
-
Alternate command, based on what is recommended by this [GitHub doc](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
-`-t rsa`: Specifies the type of key to create. The possible values are “rsa1” for protocol version 1 and “dsa”, “ecdsa”, “ed25519”, or “rsa” for protocol version 2.
100
+
-`-t ed25519`: Specifies the type of key to create. The possible values are “rsa1” for protocol version 1 and “dsa”, “ecdsa”, “ed25519”, or “rsa” for protocol version 2.
108
101
-`-b 4096`: Specifies the number of bits in the key to create.
109
102
-`-f ~/.ssh/foo.key`: Specifies the filename of the key file, if you don't want to set this in the REPL.
110
-
-`-C COMMENT`: A comment added to the end to help identify. This could be `"[email protected]"` as recommended by GitHub docs. But I prefer `"$USER@$HOSTNAME"` e.g. `michael@dell`, as it is specific to your machine. If you omit this flag you'll get that anyway.
103
+
-`-C COMMENT`: A comment added to the end to help identify it.
- If you omit the flag, you'll get the default value, which looks like `"$USER@$HOSTNAME"` e.g. `michael@dell`. This makes sense if you want to use that machine name in your key contents as well as the name on GitHUb. And if you have multiple machines and want to identify them (rather than a single email address across machines). For security, should avoid using the same SSH key on multiple machines (which might be the temptation if you use the email as the identifier).
111
106
112
107
See also this SSH Public Key [tutorial](https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key) on Git's docs, but that doesn't add much to what is covered above.
0 commit comments