2015-08-16 163 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。 –