【问题标题】:can't clone repo from remote - ssh keys identification error无法从远程克隆 repo - ssh 密钥识别错误
【发布时间】:2013-07-26 20:46:16
【问题描述】:

我在 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 ssh


    【解决方案1】:

    你应该试试:

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

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

    【讨论】:

    • 基于你如何 ssh - 你想使用相同的端口,所以既然你的 $ ssh user@servername.com ls 有效,那么 git clone ssh://user@servername.com:/path/ to/repo.git 也应该可以工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-22
    • 2018-12-21
    • 1970-01-01
    • 2022-01-14
    • 2018-08-24
    • 1970-01-01
    相关资源
    最近更新 更多