我在 Windows 上通过 ssh 提取 git 存储库时遇到问题。存储库位于 GitLab 服务器上。我执行以下步骤:
ssh-keygen -t rsa -C "my@email.here"
创建公钥C:\Users\myUserName\.ssh\keyName
ssh-agent
的输出(即导出 SSH_AUTH_SOCK; ...)ssh-add
并在 C:\Users\myUserName\.ssh\keyName
中添加 key 同样的设置在我的 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:看起来我的问题是基于我的硬件和软件设置。只需并行执行相同的步骤,它就可以在另一台计算机上运行。
最佳答案
偶然发现了我的问题的原因。我尝试使用一个旧技巧并启动系统恢复来撤消我的 Git 安装。由于我的病毒扫描程序,它失败了。卸载 Bitdefender Antivirus 免费版后,它工作了。传入的 SSH2 消息被阻止(获得 Windows 8 Pro),导致 bad packet length
错误。无论如何,感谢您的支持!
关于Git克隆产生错误的数据包长度错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20722169/