SSH 连接设置
设置 SSH 连接 (Windows)
转到开始菜单 > All Programs > 打开 TortoiseGit 并启动 Putty Key Generator。
![Open TortoiseGit items and run Puttygen](/static/2cd64261b2f93c8b5a857e9bb66aa34c/5a190/01.png)
单击“Generate”并将鼠标光标移动到红色框内,直到进度条完成。这将随机生成一个密钥。
![Until the progress bar reaches the right corner, you move the mouse with the red-framed area](/static/7a3515ec72bc44ef0f2ad58df9f6f07e/5a190/02.png)
密钥生成完成后,您将看到以下显示。单击“Save private key”并保存“.ppk”文件。
![Save the ppk file by clicking the "Save private key" button.](/static/a7fb9498f248d4290285ea901182d95d/5a190/03.png)
您以后可以通过将.ppk
文件加载到 Putty Key Generator 中,再次查看公钥。
为了在使用 TortoiseGit 推送时配置 SSH 连接,请右键单击 TortoiseGit,然后选择“Manage”。
![If you click TortoiseGit, the following screen will be displayed. Then, click Manage button](/static/46599e5430bc9e5100ad1daccb74232f/5a190/04.png)
在远程栏中选择“origin”,将 SSH 路径添加到 URL 字段,并将我们刚才保存的“.ppk”文件路径添加到 Putty Key 字段。单击“Add New/Save”。现在,与 SSH URL 路径关联的 origin 远程将添加到远程连接此存储库的列表中。单击“OK”来完成。
![Assign the ppk file that you just saved to the Putty authentication, and then click Add New/Save button](/static/cd94cdadb3e7f12aaf51c3c13b3a1cd1/5a190/05.png)
设置 SSH 连接 (Mac)
在 application/utility 下打开终端,并执行以下命令。
$ ssh-keygen
您将看到以下输出。您可以选择输入此生成的 RSA 密钥对的 passphrase。
如果您不想设置 passphrase,请按回车键继续。
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): <Press Enter key>
Created directory '/Users/username/.ssh'.
Enter passphrase (empty for no passphrase): <Input passphrase>
Enter same passphrase again: <Please enter the same passphrase again>
Your identification has been saved in /Users/username/.ssh/id_rsa.
Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
The key fingerprint is:
57:15:3c:ca:f2:dc:27:6d:c2:9a:88:d0:70:cf:8d:31 username@username-example-device
The key's randomart image is:
+--[ RSA 2048]----+
| .o. |
| .o |
| ... . |
| . . E.o |
| +So.O o . |
| . ..+ + = +|
| . . . o = |
| . . o |
| |
+-----------------+
您可以使用以下命令查看 SSH 公钥。
$ cat ~/.ssh/id_rsa.pub
输出示例
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkkJvxyDVh9a+zH1f7ZQq/JEI79dVjDSG
4RzttQwfK+sgWEr0aAgfnxdxQeDKxIxqI1SwyTY8oCcWzvpORuPqwbc7UWWPcCvbQ3jlEdN
5jvwKM82hincEWwI3wzcnVg2Mn8dH86b5m6REDzwRgozQ3lqrgwGVlTvkHDFs6H0b/1PSrM
XGppOP/QXGEVhZ6Hy4m3b1wMjjrbYwmWIeYklgoGHyrldhAaDYc33y7aUcRyFyq5DubtsLn
2oj4K+1q36iviCHxCOri0FDmn2dzylRCI4S+A2/P7Y7rVfdT+8OWYKCBUs8lfjujghEtejq
Qmj9ikyGTEAW1zQCN7hVwYdjL hoge@hoge.local
将此密钥复制,并粘贴到远程存储库设置中。
设置 SSH 连接 (Console)
执行以下命令。
$ ssh-keygen
您将看到以下输出。您可以选择输入此生成的 RSA 密钥对的 passphrase。如果您不想设置 passphrase,请按回车键。
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): <Press Enter key>
Created directory '/Users/username/.ssh'.
Enter passphrase (empty for no passphrase): <Input passphrase>
Enter same passphrase again: <Please enter the same passphrase again>
Your identification has been saved in /Users/username/.ssh/id_rsa.
Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
The key fingerprint is:
57:15:3c:ca:f2:dc:27:6d:c2:9a:88:d0:70:cf:8d:31 username@username-example-device
The key's randomart image is:
+--[ RSA 2048]----+
| .o. |
| .o |
| ... . |
| . . E.o |
| +So.O o . |
| . ..+ + = +|
| . . . o = |
| . . o |
| |
+-----------------+
您可以使用以下命令查看 SSH 公钥。
$ cat ~/.ssh/id_rsa.pub
输出示例
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkkJvxyDVh9a+zH1f7ZQq/JEI79dVjDSG
4RzttQwfK+sgWEr0aAgfnxdxQeDKxIxqI1SwyTY8oCcWzvpORuPqwbc7UWWPcCvbQ3jlEdN
5jvwKM82hincEWwI3wzcnVg2Mn8dH86b5m6REDzwRgozQ3lqrgwGVlTvkHDFs6H0b/1PSrM
XGppOP/QXGEVhZ6Hy4m3b1wMjjrbYwmWIeYklgoGHyrldhAaDYc33y7aUcRyFyq5DubtsLn
2oj4K+1q36iviCHxCOri0FDmn2dzylRCI4S+A2/P7Y7rVfdT+8OWYKCBUs8lfjujghEtejq
Qmj9ikyGTEAW1zQCN7hVwYdjL hoge@hoge.local
将此密钥复制,并粘贴到远程存储库设置中。
将 SSH 公钥注册到 Backlog
用您可以访问 Git 存储库的账户用户名登录到 Backlog。登录后,单击“Personal Settings”。
![Click "Personal setting"](/static/3ff08377fdae796456ed8ddf1e031577/5a190/06.png)
单击“Register SSH public key”。
![Click "Register SSH public key"](/static/185378babd3e643159eb56241bad3845/5a190/07.png)
将 SSH 公钥粘贴到文本区域,并单击“Submit”。
![Paste the content of SSH public key and click "Register" button](/static/c5cb3933772676d34a4b9d631d1ab012/5a190/08.png)