zoukankan      html  css  js  c++  java
  • git pull报错: ssh_exchange_identification

    问题

    在项目中我写了个编译打包的脚本,会拉取gitlab上工程的代码进行编译,然后上传到产品服务器。其中有一次git pull去拉取gitlab上工程代码报错了:

    ssh_exchange_identification: Connection closed by remote host

    fatal: Could not read from remote repository.

    分析

    上面提示的意思是git在pull代码期间连接突然被远程中断,我手动在机器上执行git pull代码,并没有出现上述报错。

    我怀疑是gitlab端的问题,由于公司有几百研发在使用内网搭建的源码服务器gitlab,很有可能是并发量太大导致gitlab的处理了问题。

    我使用的是ssh认证方式去pull代码,所以第一个想到的是gitlab服务器上ssh参数可能需要调整下。

    修改ssh配置

    ssh的配置文件:/etc/ssh/sshd_config

    修改如下内容:

    MaxStartups 500 #ssh登入前的联机画面,(即ssh某台机器,提示yes/no的那个画面)

    MaxSessions 500 #允许的最大会话数

    修改完后之后重新加载该配置:

    service sshd reload

    提示:千万不要使用service sshd restart,这样会导致很多客户端ssh连接中断

    博主:测试生财

    座右铭:专注测试与自动化,致力提高研发效能;通过测试精进完成原始积累,通过读书理财奔向财务自由。

    csdn:https://blog.csdn.net/ccgshigao

    博客园:https://www.cnblogs.com/qa-freeroad/

    51cto:https://blog.51cto.com/14900374

  • 相关阅读:
    poj3686 Windys
    poj3155 Hard Life
    luoguP2774 方格取数问题
    poj3469 Dual Core CPU
    poj3281 Dining
    luogu P3410 拍照
    离散化
    最短路(SPFA)
    lower_bound && upper_bound
    gcd
  • 原文地址:https://www.cnblogs.com/qa-freeroad/p/14249809.html
Copyright © 2011-2022 走看看