尝试克隆存储库时收到错误 - git [英] Receiving error when try to clone a repository - git
问题描述
我创建了一个heroku应用程序,这是git地址:
git@heroku.com:sheltered-meadow -7151.git
但是,当我尝试克隆存储库时,收到此错误:
$ git clone git@heroku.com:sheltered-meadow-7151.git克隆到
'sheltered-meadow-7151'...无法创建目录
'/home/Adrian/.ssh'。主机'heroku.com
(50.19.85.156)'的真实性无法建立。 RSA密钥指纹是
8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad。您确定要
继续连接(是/否)吗?是无法将主机添加到已知主机的
列表(/home/Adrian/.ssh/known_hosts)。权限被拒绝
(publickey)。致命:远程终端意外挂断
更新:
$ ls -l〜/ .ssh
是:
合计1
------- --- + 1 Adrian None 405 10月1日23:25 known_hosts
我的.ssh键位于 C:\ Users \Adrian\.ssh
上面的dir指向不正确的位置吗?
Update 2:
我已将所有密钥复制到〜/ .ssh文件夹中,但收到同样的错误消息
我试图在Windows计算机上设置这些,并且这些步骤都能正常工作。 (我使用mingw32.exe作为bash模拟器而不是Putty)
$ ssh-agent
code>
这是该命令的输出:
#SSH_AUTH_SOCK = / tmp / ssh-xxxxxxxx / agent.3840;导出SSH_AUTH_SOCK
#SSH_AGENT_PID = 3572;导出SSH_AGENT_PID;
#echo代理程序pid 3572
现在,我不知道为什么环境变量是不会自动设置为输出。但他们没有设置。要修复它,请运行以下命令:
$ export SSH_AUTH_SOCK = / tmp / ssh-xxxxxxxx / agent.3840
然后执行:
p>
更新: http://funkaoshi.com/blog/could-not-open-a-connection-to-your-authentication-agent 此博客文章I发现还验证了我的声明,即运行 ssh-agent
不会设置环境变量,并且应该手动设置它们。
I've created a heroku app and this is the git address :
git@heroku.com:sheltered-meadow-7151.git
But when I try to clone the repository I receive this error :
$ git clone git@heroku.com:sheltered-meadow-7151.git Cloning into 'sheltered-meadow-7151'... Could not create directory '/home/Adrian/.ssh'. The authenticity of host 'heroku.com (50.19.85.156)' can't be established. RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/home/Adrian/.ssh/known_hosts). Permission denied (publickey). fatal: The remote end hung up unexpectedly
Update :
Output of
$ ls -l ~/.ssh
is :
total 1
----------+ 1 Adrian None 405 Oct 1 23:25 known_hosts
My .ssh keys are located in C:\Users\Adrian\.ssh
so is the above dir pointing at an incorrect location ?
Update 2 :
I've copied all keys into the ~/.ssh folder but receiving same error
I've tried to set this up on a windows machine and these steps worked. (I'm using mingw32.exe as the bash emulator and not Putty)
$ ssh-agent
And this was the output of that command:
# SSH_AUTH_SOCK=/tmp/ssh-xxxxxxxx/agent.3840; export SSH_AUTH_SOCK
# SSH_AGENT_PID=3572; export SSH_AGENT_PID;
# echo Agent pid 3572
Now, I don't know why the environment variables were not automatically set to the output. But they were not set. To fix it, run this command:
$ export SSH_AUTH_SOCK=/tmp/ssh-xxxxxxxx/agent.3840
And then run:
$ ssh-add ~/path/to/privatekey
That should do it.
Update: http://funkaoshi.com/blog/could-not-open-a-connection-to-your-authentication-agent This blog post I found also verifies my claim that running ssh-agent
does not set the environment variables and that these should be set manually.
这篇关于尝试克隆存储库时收到错误 - git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!