git pull报错: ssh_exchange_identification
2021-01-11 09:04
3231 查看
问题
在项目中我写了个编译打包的脚本,会拉取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
相关文章推荐
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host
- 解决升级OPENSSH后无法SSH登陆主机问题:kex_exchange_identification: read: Connection reset by peer
- ssh问题:ssh_exchange_identification
- ssh_exchange_identification: Connection closed by remote host
- 使用xshell连接服务器问题:ssh_exchange_identification: Connection closed by remote host
- ssh远程报错ssh_exchange_identification: read: Connection reset by peer
- ssh 错误: ssh_exchange_identification
- Linux expect问题集:ssh_exchange_identification: Connection closed by remote host
- ssh连接远程服务器:ssh_exchange_identification: read: Connection reset by peer
- ssh_exchange_identification: read: Connection reset by peer 报错解决办法
- ssh登陆概率性失败,报错:kex_exchange_identification
- ssh_exchange_identification: read: Connection reset by peer
- 【Mars运维笔记系列】基础篇(一):ssh登录主机报错:ssh_exchange_identification:Connection closed by remote host
- 由chmod改系统文件权限引ssh登录报ssh_exchange_identification: read: Connection reset by peer无法登陆问题
- ssh_exchange_identification: Connection closed by remote hos
- ssh_exchange_identification: Connection closed by remote host 问题的解决
- ssh问题:ssh_exchange_identification: Connection closed by remote host
- ssh_exchange_identification: Connection closed by remote host