【发布时间】:2016-03-08 11:35:58
【问题描述】:
我使用 PuTTy keygen 创建了一个公钥。我将公钥复制到david.pub 并发送给将密钥放在服务器(vps)上的开发人员,以便我可以克隆存储库。当我创建公钥时,我输入了密码。当我尝试克隆时会发生这种情况:
$ git clone my_app:money_app.git new_money_app
Cloning into 'new_money_app'...
Enter passphrase for key '/c/Users/User1/.ssh/david.pub':
我输入我设置的密码,这行重复了 3 次 Enter passphrase for key '/c/Users/User1/.ssh/david.pub':
然后显示这个之后
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
存储库存在。这是我的配置文件的样子:
Host my_app
User git
HostName xx.xx.xxx.xx
PubkeyAuthentication yes
PreferredAuthentications publickey
IdentityFile ~/.ssh/david.pub
我该如何解决这个问题,以便我可以克隆存储库?我对 GIT 完全陌生,我需要重新创建公钥吗?我被告知要创建一个公钥,我还需要一个私钥吗?
我是前端开发人员,所以这很令人困惑。
【问题讨论】:
-
没有私钥的公钥是完全没用的。我建议你阅读en.wikipedia.org/wiki/Public-key_cryptography 的部分内容。