2015-08-16 212 views
-1

我一直試圖將bitbucket連接到我的本地git存儲庫,但很難找到私鑰和公鑰。如何查找.ssh私鑰和公鑰

我在bash

$ ssh keygen -t rsa 

Generating public/private rsa key pairs 
Enter file in which to save the key (/c/Users/TOSHIBA/.ssh/id_rsa): password.txt (I don't have password.txt file on my system it was random file name I provided) 

Enter passphrase(empty for no passphrase): (I left empty) 
Enter same passphrase again: 
Your identification has been saved in password.txt. 
You public key has been saved in password.txt.pub 
The key fingerprint is: 
9c:9e:07:63:45:ad:76:b3:d0:e1:e1:0f:6c:20:aa:c4 [email protected] 
The Key's random art image is 

生成此命令的.ssh鍵我無法找出生成的密鑰。請讓我知道如果我做錯了什麼。

感謝

回答

0

私鑰是在你的文件password.txt和公鑰是password.txt.pub。完整路徑取決於您當前在shell中的工作目錄。

您可以剛剛按下輸入,而不是文件名。然後ssh-keygen會將其保存爲默認文件名/c/Users/TOSHIBA/.ssh/id_rsa。使用默認文件名是個好主意,因爲ssh客戶端會自動在那裏找到密鑰。

+0

謝謝我發現併成功將我的第一個項目上傳到bitbucket。 –