加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Rsync和“ssh_exchange_identification:连接由远程主机关闭”

发布时间:2020-12-13 17:01:59 所属栏目:Linux 来源:网络整理
导读:我有一个脚本,rsync是大约10个远程服务器的本地目录.它基本上有一个服务器列表和for循环通过每个服务器进行rsync.为了加快这个过程,我让它为每个rsyncs分叉,以便所有10个并行发生.问题是最后几个服务器返回“ssh_exchange_identification:连接由远程主机关
我有一个脚本,rsync是大约10个远程服务器的本地目录.它基本上有一个服务器列表和for循环通过每个服务器进行rsync.为了加快这个过程,我让它为每个rsyncs分叉,以便所有10个并行发生.问题是最后几个服务器返回“ssh_exchange_identification:连接由远程主机关闭”.单独或串行执行rsyncs时不会发生这种情况,并且在每个之间放置半秒延迟修复问题(通常,有时列表中的最后一个服务器仍会返回错误).

有谁知道为什么会发生这种情况?我认为这是rysnc而不是我的脚本的问题,因为脚本只是对rysnc进行系统调用.

解决方法

我以前见过这个问题.您需要在要连接的SSH服务器上调高MaxStartups值.请注意,默认值为10.您可以通过编辑/ etc / ssh / sshd_config并重新加载SSH守护程序(希望您控制远程服务器)来执行此操作.

从man sshd_config:

MaxStartups
         Specifies the maximum number of concurrent unauthenticated connections to the SSH daemon.  Additional connections will be dropped until authentication succeeds or the
         LoginGraceTime expires for a connection.  The default is 10.

         Alternatively,random early drop can be enabled by specifying the three colon separated values “start:rate:full” (e.g. "10:30:60").  sshd(8) will refuse connection attempts
         with a probability of “rate/100” (30%) if there are currently “start” (10) unauthenticated connections.  The probability increases linearly and all connection attempts are
         refused if the number of unauthenticated connections reaches “full” (60).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读