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 路徑關聯的源遠端將被新增到遠端連接此儲存庫的清單中。單擊「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)