我正在尝试克隆当前使用SSH公钥/私钥而不是密码配置的git仓库。我可以使用PuTTy进行SSH连接并使用以下命令生成密钥(它是基于Unix的服务器)。
$ ssh-keygen -t rsa "john@mysite.com"
这会生成我在.ssh /目录中的两个文件。
我遇到的问题基本上是尝试通过像SourceTree这样的常见git客户端将这个相同的git repo克隆到我的本地Windows桌面。
当我尝试通过SourceTree结账时,它会说: -
SSH Authentication Failed
Your SSH agent (Pageant) is running but the server still rejected your connection...
我安装了Pagent但不确定该怎么办?任何想法......
- 更新 - 当我在远程服务器上打开私钥时,这就是结构(显然更长,我出于安全目的而改变了它......)
-----BEGIN RSA PRIVATE KEY-----
MIIEoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END RSA PRIVATE KEY-----
答案 0 :(得分:1)
将您的ssh客户端更改为openssh。之后,您需要创建一对新密钥并将其添加到存储库主机。
您可以使用
创建ssh密钥ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"