【发布时间】:2014-01-10 09:51:10
【问题描述】:
我无法在 Windows 上通过 ssh 提取 git 存储库。存储库位于 GitLab 服务器上。我执行以下步骤:
- 用
ssh-keygen -t rsa -C "my@email.here"创建一个公钥 - 将密钥保存在
C:\Users\myUserName\.ssh\keyName - 运行
ssh-agent的输出(即export SSH_AUTH_SOCK; ...) - 运行
ssh-add并将密钥添加到C:\Users\myUserName\.ssh\keyName - 在 GitLab 中添加公钥。
相同的设置在我的 Linux 和我同事的 Windows 机器上运行良好。
当我尝试使用git clone 克隆存储库时,出现以下错误:
Disconnecting: Bad packet length 1397966893.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我尝试用谷歌搜索,但没有找到合适的。有人知道我是否犯了错误或错误可能是服务器端的吗?
编辑:我得到以下调试输出:
C:\Users\Johannes\Documents\GitHub> ssh -vT -p 80 git@random.secret.sever.de
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/Johannes/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to random.secret.sever.de [192.44.1.37] port 80.
debug1: Connection established.
debug1: identity file /c/Users/Johannes/.ssh/identity type -1
debug1: identity file /c/Users/Johannes/.ssh/id_rsa type 1
debug1: identity file /c/Users/Johannes/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
Disconnecting: Bad packet length 1397966893.
编辑 2:看起来我的问题是基于我的硬件和软件设置。只需并行执行相同的步骤,它就可以在另一台计算机上运行。
【问题讨论】:
-
你是否验证了与 gitlab 的一般连接? (如果没有,你可以发出这个命令:
ssh git@gitlab.com) -
我得到以下输出:
Warning: Permanently added 'gitlab.com,54.243.197.170' (RSA) to the list of known hosts. Permission denied (publickey). -
然后您需要将您的公钥添加到您的 GitLab 帐户。
-
那么你的本地ssh设置配置不正确。
-
我在 5) 中做到了 - 指纹也匹配