简体   繁体   English

rsync / git / ssh 问题 macos 11.3.1 / Big Sur

[英]rsync / git / ssh problem macos 11.3.1 / Big Sur

16.6.21 UPDATE 16.6.21 更新

I Found the cause of this problem.我找到了这个问题的原因。 It was my VPN Client (CISCO Anyconnect).这是我的 VPN 客户端(CISCO Anyconnect)。 There were some Packet Filters installed with the Client and therefore not all Packages were sent properly to the server.客户端安装了一些包过滤器,因此并非所有包都正确发送到服务器。

QUESTIONE问题

I already searched google for hours to find a solution for my problem, but none of the written solutions helped me.我已经在谷歌上搜索了几个小时来找到我的问题的解决方案,但没有一个书面解决方案对我有帮助。

Last Friday, I did a complete fresh install of Mac OS Big Sur on my Mac Mini (2020).上周五,我在我的 Mac Mini (2020) 上全新安装了 Mac OS Big Sur。 I was setting up my development environment to my needs and it looked like it was working really good until yesterday.我正在根据我的需要设置我的开发环境,直到昨天它看起来工作得非常好。

Yesterday was trying to push some commits to our GitLab server... while pushing a error came up昨天试图向我们的 GitLab 服务器推送一些提交......同时推送错误

client_loop: send disconnect: Broken pipe
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly

I tried to fix the error by setting several arguments in my./ssh/config file, like:我尝试通过在 my./ssh/config 文件中设置几个 arguments 来修复错误,例如:

Host *
  ServerAliveInterval 60
  ServerAliveCountMax 5
  IPQoS=throughput

and many more.还有很多。

3 hours later I was really annoyed and pushed the commits via https not via ssh anymore. 3 小时后,我真的很生气,并通过 https 而不是通过 ssh 推送提交。

A bit later I had to push a local WordPress installation to our staging environment.稍后,我不得不将本地 WordPress 安装推送到我们的暂存环境。 Suddenly nearly the same error occurred again突然又发生了几乎相同的错误

rsync: [sender] write error: Broken pipe (32)
rsync error: unexplained error (code 255) at io.c(823) [sender=3.2.3]

The strange thing is:奇怪的是:
While downloading via git clone or rsync (both via ssh) everything works well.通过 git 克隆或 rsync(均通过 ssh)下载时,一切正常。 Also connecting via ssh to the server works really well BUT!通过 ssh 连接到服务器也工作得很好但是! when I begin to upload a larger amount of files I'm getting those errors (also tried with a plain rsync command).当我开始上传大量文件时,我遇到了这些错误(也尝试使用普通的rsync命令)。

Could this be caused by different OpenSSH versions on our servers (OpenSSH_7.2p2 Ubuntu-4ubuntu2.10, OpenSSL 1.0.2g 1 Mar 2016) and my machine (OpenSSH_8.6p1, OpenSSL 1.1.1k 25 Mar 2021)?这可能是由于我们的服务器(OpenSSH_7.2p2 Ubuntu-4ubuntu2.10、OpenSSL 1.0.2g 2016 年 3 月 1 日)和我的机器(OpenSSH_8.6p1、OpenSSL 1.11)上的不同 OpenSSH 版本造成的吗?

Anyone has any advices for me?有人对我有什么建议吗?

It works again.它再次起作用。 I don't know how or why, but it works.我不知道如何或为什么,但它有效。 I did a clean reinstall of macos (again) and now it seems to work.我(再次)重新安装了macos,现在它似乎可以工作了。

I still can't pinpoint what exactly it was, but i noticed the ssh disconnect issues after the latest Update.我仍然无法确定它到底是什么,但我注意到最新更新后 ssh 断开连接问题。 I could pinpoint it down to the Macbook SSH Libraries, because i did the following steps:我可以将其精确定位到 Macbook SSH 库,因为我执行了以下步骤:

  • Connected from another another source (Terminus on iPhone, another Mac and Debian running on NUC) within the network without any problems (same ssh target destinations in all source device examples)从网络中的另一个源(iPhone 上的终端、另一个 Mac 和 Debian 在 NUC 上运行)连接没有任何问题(所有源设备示例中的相同 ssh 目标目的地)
  • Disabled temporarily all network adblocking, firewall and filtering暂时禁用所有网络广告拦截、防火墙和过滤
  • added a wired connection to the "problem macbook"向“问题 macbook”添加了有线连接
  • tried all the ssh config options below, with the default openSSH and LibreSLL Version from MacOS尝试了下面的所有 ssh 配置选项,使用 MacOS 的默认 openSSH 和 LibreSLL 版本
  • Connected to different Target Servers from the "problem Mac" and the disconnects appeared suddenly everywhere with different timings (only with the problem Mac).从“问题Mac”连接到不同的目标服务器,并且断开连接突然出现在不同的时间(仅与问题Mac)。

I assume, that the problem lies with the default Big Sur OpenSSH and LibreSSL Version.我认为问题在于默认的 Big Sur OpenSSH 和 LibreSSL 版本。 After i installed OpenSSH with brew install openssh with the following config, everything works like before.在我使用brew install openssh安装 OpenSSH 并使用以下配置后,一切都像以前一样工作。

I hope it also solves your problem, because it took me couple of days:(我希望它也能解决你的问题,因为我花了几天时间:(

My Machine我的机器

  • MacOS 11.3.1 macOS 11.3.1
  • MacBook Pro Retina 15, Mid 2015 MacBook Pro 视网膜 15,2015 年中
  • Intel i7英特尔 i7

Steps to fix:修复步骤:

  1. brew install openssh
  2. Add config to ~/.ssh/config将配置添加到~/.ssh/config
Host *

    IPQoS none
    TCPKeepAlive no
    ServerAliveInterval 60
    ServerAliveCountMax 5

Play around with the .ssh/config config values, to match your needs and don't make them to aggressive使用.ssh/config配置值,以满足您的需求,不要让它们过于激进

ssh -V after brew install openssh : OpenSSH_8.6p1, OpenSSL 1.1.1k 25 Mar 2021 ssh -V brew install openssh后: OpenSSH_8.6p1, OpenSSL 1.1.1k 25 Mar 2021

Could this be caused by different openssh versions on our servers这可能是由我们服务器上的不同 openssh 版本引起的吗

Check if using an old PEM SSH key format would work better, considering OpenSSH 7.8 has switch to a new format by default:检查是否使用旧的 PEM SSH 密钥格式会更好,考虑到 OpenSSH 7.8 默认已切换到新格式:

ssh-keygen -t rsa -P "" -m PEM -f ~/.ssh/key2

Register that key2.pub to your GitLab server, and try at least a ssh -Tv git@myGitLabServer将该 key2.pub 注册到您的 GitLab 服务器,并至少尝试ssh -Tv git@myGitLabServer

Check also, as mentioned here , your SSH confog for any non-standard directive, like RemoteCommand还要检查,如here所述,您的 SSH 配置文件是否有任何非标准指令,如RemoteCommand

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM