Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.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
Linux 使用ssh连接时git克隆失败_Linux_Git_Ssh - Fatal编程技术网

Linux 使用ssh连接时git克隆失败

Linux 使用ssh连接时git克隆失败,linux,git,ssh,Linux,Git,Ssh,我使用以下命令克隆git存储库 git clone ssh://git@test.server.com/project.git 我将密钥文件id\u rsa.pub和id\u rsa放在文件夹~/.ssh/中,但在尝试使用上述git命令进行克隆时,出现以下错误 ssh -v git@test.server.com OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration dat

我使用以下命令克隆git存储库

git clone ssh://git@test.server.com/project.git
我将密钥文件
id\u rsa.pub
id\u rsa
放在文件夹
~/.ssh/
中,但在尝试使用上述
git
命令进行克隆时,出现以下错误

ssh -v git@test.server.com
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /home/user/.ssh/config
debug1: Applying options for test.server.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to test.server.com [x.x.x.x] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa.pub type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/user/.ssh/id_rsa.pub-cert type -1
ssh_exchange_identification: Connection closed by remote host

您必须添加本地密钥(可在
/home/user/.ssh/id\u rsa.pub
中找到)在服务器上的
/home/git/.ssh/authorized_keys
中,您可以使用将公钥发送到服务器。

您可以告诉我们您已经尝试了什么吗…一个快速的
duckduckgo
:)将我带到这里:
http://edoceo.com/notabene/ssh-exchange-identification
当ssh直接工作时,为什么要使用它:git cloneuser@server:~/repos/project.git