@@ -12,108 +12,103 @@ In order to use Git locally in a secure manner, we need to connect our computer
1212
1313[ GitHub Instructions: Generate SSH Key] ( https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent )
1414
15-
16151 . Create an "SSH Key"
16+
1717 - Head to your terminal and enter the following command (using the email address you sign into GitHub with)
1818
1919 ``` bash
2020 ssh-keygen -t rsa -b 4096 -C
" [email protected] " 2121 ```
2222
23- - This will prompt you for a file location. Just accept the default
24-
25- ` ` ` bash
26- Enter file in which to save the key (/Users/yourname/.ssh/id_rsa):
27- ` ` `
28-
29- - It will then prompt you for a password to lock down this file. Enter one you can remember.
30-
31- > Note that you are free to leave this blank if you want to avoid typing passwords every time you use git. It' s fine, although not terribly secure if someone gets ahold of your laptop
32-
33- ```bash
34- Enter passphrase (empty for no passphrase):
35- ```
36-
37- - Once complete, it' ll give you output that looks similar to this:
38-
39- ` ` ` text
40- you@machine ~ $ ssh-keygen -t rsa -b 4096 -C " me@examplecom"
41- you@machine
42- Generating public/private rsa key pair.
43- Enter file in which to save the key (/Users/yourname/.ssh/id_rsa):
44- Enter passphrase (empty for no passphrase):
45- Enter same passphrase again:
46- Your identification has been saved in /Users/yourname/.ssh/id_rsa.
47- Your public key has been saved in /Users/yourname/.ssh/id_rsa.pub.
48- The key fingerprint is:
49- SHA256:ki0TNHm8qIvpH7/c0qQmdv2xxhYHCwlpn3+rVhKVeDo USEFUL-COMMENT
50- The key' s randomart image is:
51- +---[RSA 4096]----+
52- | o+ . . |
53- | .=.o . + |
54- | ..= + + |
55- | .+* E |
56- | .= So = |
57- | . +. = + |
58- | o.. = ..* . |
59- | o ++=.o =o. |
60- | ..o.++o.=+. |
61- +----[SHA256]-----+
62- ```
63-
64- 1. Give that key to GitHub
65-
66- - Type this command to see your new key:
23+ - This will prompt you for a file location. Just accept the default
24+
25+ ` ` ` bash
26+ Enter file in which to save the key (/Users/yourname/.ssh/id_rsa):
27+ ` ` `
28+
29+ - It will then prompt you for a password to lock down this file. Enter one you can remember.
30+
31+ > Note that you are free to leave this blank if you want to avoid typing passwords every time you use git. It' s fine, although not terribly secure if someone gets ahold of your laptop
6732
6833 ```bash
69- cat ~/.ssh/id_rsa.pub
34+ Enter passphrase (empty for no passphrase):
7035 ```
7136
72- - It ' ll look like a bunch of random letters, like this:
37+ - Once complete, it ' ll give you output that looks similar to this:
7338
7439 ` ` ` text
75- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1PqLEQoHNtq0Nx0IyIKQxXj91oSdTU0F2LA5FnCRPSJLBplzBtlkZdG9JLX
76- +2EsrfpAMpP7FPU2hKt1swmPLp3HrbPI3ziNyyPX9Mj/5qpANYv+9QiKs6X9iApsfl0r985BE0XthFqJNYzBKM
77- +q6bM1F5gKSBWX+t0RpTWn5lMnE970na52vQFVU7whQwmq1OxmzMzKlPtWA5xLF8b/
78- fvWzKPkj0d9pCd752zw4H2Rm2T1huqxYFx4i6y3Cv5fUIF2/B
79- 4WU1GUUiIrH3s0XCW7UxUnkFCOWJUZ3XFlkBvOftxN8mocMhaip1xsoOr2tWIYgrABcmFOE9vXKE7Z64ILO+
80- 1vjM3JzO660jBUYJfkOfWKRm1P/BDTqLG+4A7das8aJa+kQJHMrLR8BhlSnxZVHiNhbrGHaKcH8CZVuF/
81- ATdnT44EtyKgR433A7WwzLbr22vsMw4iU5HNwXHbnUY+5SD5Lw/ZngnXm1m5A4jP/7MBs4eJlYw6+K+HiNIze
82- +9w10TsmcaDlNcHckn8/
83- 22OzY6Qph3qx2NBWcZ42XcBKNDLnwgztdbNNA32R85UrCWb0v7XgO2YgthsKSGxtA3wSL32BWfJwlrkLuUJvLQ=
84- 40+ you@machine ~ $ ssh-keygen -t rsa -b 4096 -C " me@examplecom"
41+ you@machine
42+ Generating public/private rsa key pair.
43+ Enter file in which to save the key (/Users/yourname/.ssh/id_rsa):
44+ Enter passphrase (empty for no passphrase):
45+ Enter same passphrase again:
46+ Your identification has been saved in /Users/yourname/.ssh/id_rsa.
47+ Your public key has been saved in /Users/yourname/.ssh/id_rsa.pub.
48+ The key fingerprint is:
49+ SHA256:ki0TNHm8qIvpH7/c0qQmdv2xxhYHCwlpn3+rVhKVeDo USEFUL-COMMENT
50+ The key' s randomart image is:
51+ +---[RSA 4096]----+
52+ | o+ . . |
53+ | .=.o . + |
54+ | ..= + + |
55+ | .+* E |
56+ | .= So = |
57+ | . +. = + |
58+ | o.. = ..* . |
59+ | o ++=.o =o. |
60+ | ..o.++o.=+. |
61+ +----[SHA256]-----+
8562 ```
8663
87- - You' ll need to copy that and paste it into GitHub. There are 3 ways to do this
88-
89- - Mac Users: Run `pbcopy < ~/.ssh/id_rsa.pub` to copy key to clipboard.
90- - Linux / Windows Users can use `xclip` to do this
91- - `sudo apt-get install xclip` installs xclip
92- - `xclip -selection clipboard < ~/.ssh/id_rsa.pub` to copy key to clipboard
93- - Or, you can do this the old fashioned way and Highlight the text and copy it to your clipboard
94- - Note: Copy all of it, from the `ssh-rsa` to your email address at the end
95-
96- - Now that you have this in your clip board, get it into GitHub ...
64+ 1. Give that key to GitHub
9765
98- - Login to your GitHub Account
66+ - Type this command to see your new key:
9967
100- - Go to your settings page
101- - Click the down arrow next your icon on the top right and choose **"Settings"**
102- 
68+ ```bash
69+ cat ~/.ssh/id_rsa.pub
70+ ```
10371
104- - From the settings window, choose the **"SSH and GPG Keys"** menu option
105- 
72+ - It' ll look like a bunch of random letters, like this:
10673
107- - Click the green button labeled "New SSH Key"
74+ ` ` ` text
75+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1PqLEQoHNtq0Nx0IyIKQxXj91oSdTU0F2LA5FnCRPSJLBplzBtlkZdG9JLX
76+ +2EsrfpAMpP7FPU2hKt1swmPLp3HrbPI3ziNyyPX9Mj/5qpANYv+9QiKs6X9iApsfl0r985BE0XthFqJNYzBKM
77+ +q6bM1F5gKSBWX+t0RpTWn5lMnE970na52vQFVU7whQwmq1OxmzMzKlPtWA5xLF8b/
78+ fvWzKPkj0d9pCd752zw4H2Rm2T1huqxYFx4i6y3Cv5fUIF2/B
79+ 4WU1GUUiIrH3s0XCW7UxUnkFCOWJUZ3XFlkBvOftxN8mocMhaip1xsoOr2tWIYgrABcmFOE9vXKE7Z64ILO+
80+ 1vjM3JzO660jBUYJfkOfWKRm1P/BDTqLG+4A7das8aJa+kQJHMrLR8BhlSnxZVHiNhbrGHaKcH8CZVuF/
81+ ATdnT44EtyKgR433A7WwzLbr22vsMw4iU5HNwXHbnUY+5SD5Lw/ZngnXm1m5A4jP/7MBs4eJlYw6+K+HiNIze
82+ +9w10TsmcaDlNcHckn8/
83+ 22OzY6Qph3qx2NBWcZ42XcBKNDLnwgztdbNNA32R85UrCWb0v7XgO2YgthsKSGxtA3wSL32BWfJwlrkLuUJvLQ=
84+ 85+ ` ` `
86+
87+ - You' ll need to copy that and paste it into GitHub. There are 3 ways to do this
10888
109- - On the next screen you' ll see 2 inputs
110- - In the first one, give you key a name, like " My Computer"
111- - In the second box, paste in the key you copied in the previous step
89+ - Mac Users: Run `pbcopy < ~/.ssh/id_rsa.pub` to copy key to clipboard.
90+ - Linux / Windows Users can use `xclip` to do this
91+ - `sudo apt-get install xclip` installs xclip
92+ - `xclip -selection clipboard < ~/.ssh/id_rsa.pub` to copy key to clipboard
93+ - Or, you can do this the old fashioned way and Highlight the text and copy it to your clipboard
94+ - Note: Copy all of it, from the `ssh-rsa` to your email address at the end
11295
113- - Press the ** Add SSH Key** button
114- ! [Add Key](../images/add-key.png)
96+ - Now that you have this in your clip board, get it into GitHub ...
97+ - Login to your GitHub Account
98+ - Go to your settings page
99+ - Click the down arrow next your icon on the top right and choose **"Settings"**
100+ 
101+ - From the settings window, choose the **"SSH and GPG Keys"** menu option
102+ 
103+ - Click the green button labeled "New SSH Key"
104+ - On the next screen you' ll see 2 inputs
105+ - In the first one, give you key a name, like " My Computer"
106+ - In the second box, paste in the key you copied in the previous step
107+ - Press the ** Add SSH Key** button
108+ ! [Add Key](../images/add-key.png)
115109
1161101. Add the key to your computer' s **ssh-agent**
111+
117112 - The ssh-agent is a service that your computer will run to securely manage your keys
118113
119114 - Type this command to start and verify your **ssh-agent** is running properly
@@ -151,17 +146,18 @@ In order to use Git locally in a secure manner, we need to connect our computer
151146 ` ` `
152147
153148 - For Mac Users, you' ll also need to create an extra config file. Enter this command:
149+
154150 - Open the config file `nano ~/.ssh/config`
155- - Add the following to the editor :
151+ - Add the following:
156152
157153 ```bash
158154 Host *
159155 AddKeysToAgent yes
160156 UseKeychain yes
161- IdentityFile ~/.ssh/id_ed25519
157+ IdentityFile ~/.ssh/id_rsa
162158 ```
163159
164- - Press `ctrl-x` then press `y` then press `enter`
160+ - Press `ctrl-x` then press `y` then press `enter`
165161
1661621. Test it out!
167163
@@ -182,7 +178,6 @@ In order to use Git locally in a secure manner, we need to connect our computer
182178
183179 ! [Clone](../images/clone.png)
184180
185-
186181# # Git Config
187182
188183Like artists, programmers sign their work. Let' s configure Git to sign your commits with your name and email address.
@@ -201,5 +196,4 @@ git config --global user.email 'YOUR EMAIL ADDRESS'
201196git config --global core.editor "code --wait"
202197```
203198
204-
205199### [⇐ Previous](4-node.md) | [Next ⇒](6-tree.md)
0 commit comments