Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法使用SSH将Git repo克隆到我的live server中_Ssh_Bitbucket - Fatal编程技术网

无法使用SSH将Git repo克隆到我的live server中

无法使用SSH将Git repo克隆到我的live server中,ssh,bitbucket,Ssh,Bitbucket,我试图克隆在一个可湿性粉剂网站,我已经建立了回购 我使用的是BitBucket,我可以设置我的公钥和私钥对,没有问题。然后,我通过GitBash终端中的SSH登录到我的live servers帐户(我在Windows上)。当我试图将我的回购协议克隆到网站的live文件夹时,我得到的就是这个 [Server-Name]$ cd domains-folder.com/ [Server-Name]$ git clone --recursive git@bitbucket.org:User/folder

我试图克隆在一个可湿性粉剂网站,我已经建立了回购

我使用的是BitBucket,我可以设置我的公钥和私钥对,没有问题。然后,我通过GitBash终端中的SSH登录到我的live servers帐户(我在Windows上)。当我试图将我的回购协议克隆到网站的live文件夹时,我得到的就是这个

[Server-Name]$ cd domains-folder.com/
[Server-Name]$ git clone --recursive git@bitbucket.org:User/foldername.git
Cloning into 'domain-folder'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
[Server-Name]$ ssh-add -l
Could not open a connection to your authentication agent.
[Server-Name]$ exit
logout
Connection to Server-Name.Server.com closed.
User@Computer ~/.ssh
$

我漏了一步吗?我很困惑,因为当我登录到我的服务器时,我已经SSH了,所以我不应该有访问权限吗?请告诉我我能做什么,如果您需要其他信息,我很乐意提供。

据我所知,该错误消息可能有多种原因,通常是因为git无法连接到用户

检查以下各项: 您正在使用已设置ssh密钥的用户吗? 您是否连接到正确的url? 检查您的密钥是否已加载:

ssh-add -l
这里有一个很好的疑难解答页面,可以帮助您:

不完全清楚您在做什么,但如果您希望加载的ssh密钥也能在“live server”上使用,以便通过bitbucket进行身份验证,那么您需要在“gitbash”客户端中启用密钥转发

对于ssh程序,这是打开“身份验证代理连接的转发”的-A选项