无法从远程克隆存储库 - SSH 密钥识别错误



我在Windows上,使用的是Git Bash。我想克隆远程裸存储库。假设我已经正确设置了ssh密钥,因为我可以通过ssh协议访问服务器。我已经通过尝试获得服务器上的目录列表进行了测试:

$ ssh user@servername.com ls

它要求密码:

Enter passphrase for key 'c/users/user/.ssh/id_rsa'

我把它键入并成功地获得了目录列表。但是,如果我尝试通过ssh克隆存储库,它会失败。我在Git Bash中写了以下内容:

$ git clone ssh://user@servername.com:80/path/to/repo.git

并得到以下错误:

ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

是ssh密钥的问题吗?或者可能是其他原因,因为我已经测试了我的钥匙的工作情况?

您应该尝试:

git clone ssh://user@servername.com:/path/to/repo.git

ssh守护进程不太可能在端口80上侦听。
它将在默认端口(22)上侦听。

最新更新