使用ssh的git克隆在Windows中失败

使用ssh的git克隆在Windows中失败

本文介绍了由于权限问题,使用ssh的git克隆在Windows中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 /home/myuser/.git/project.git 的服务器中创建了一个新的GIT存储库。
我从找到了git的ssh密钥C:\ Users \Toshiba\.ssh\github_rsa.pub &附加服务器的 authorized_keys 文件。



当我尝试使用ssh做git clone时, p>

Cloning into 'project'...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Could you please help me in resolving this issue.

解决方案

If your public/private key doesn't have the standard name C:\Users\Toshiba\.ssh\id_rsa(.pub), but C:\Users\Toshiba\.ssh\github_rsa.pub, then you need an ssh config file

Host mysite
   Hostname mysite.net
   User myuser
   Port 2888
   IdentityFile C:\Users\Toshiba\.ssh\github_rsa.pub

That would allow you to do

git clone mysite:/home/myuser/.git/project.git

Test it first wih ssh -Tvvv mysite, and then ssh mysite ls.

Make sure the environment variable %HOME% is defined to C:\Users\Toshiba

You have another example in "SSH error on push to an existing project Permission denied (publickey)"

这篇关于由于权限问题,使用ssh的git克隆在Windows中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 12:32