ssh_exchange_identification: Connection closed by remote host under Git bash

后端 未结 26 2516
梦谈多话
梦谈多话 2021-01-30 08:57

I work at win7 and set up git server with sshd. I git --bare init myapp.git, and clone ssh://git@localhost/home/git/myapp.git in Cywgin

相关标签:
26条回答
  • 2021-01-30 09:03

    Got the same error message. Turning off WiFi and turning it back on again worked for me.

    0 讨论(0)
  • 2021-01-30 09:06

    I experienced this today and I just do a:

    12345@123456 MINGW64 ~/development/workspace/test (develop)
    $ git status
    Refresh index: 100% (1204/1204), done.
    On branch develop
    Your branch is up to date with 'origin/develop'.
    
    nothing to commit, working tree clean
    
    12345@123456 MINGW64 ~/development/workspace/test (develop)
    $ git fetch
    

    Then all worked again.

    0 讨论(0)
  • 2021-01-30 09:08

    Similar to Arun Sangal the problem lied in an in .ssh/config entry

    Host my.sshhost.com
      ProxyCommand ssh -q -W %h:%p myremotemachine.my.company.com
    

    The remote machine was added to avoid with ssh for VPN connections and worked well. But for the vacation period I switched off the myremotemachine and run into the described problem.

    0 讨论(0)
  • 2021-01-30 09:08

    To solve this edit /etc/ssh/ssh_config and comment the following line 1

    ProxyCommand /usr/bin/sss_ssh_knownhostsproxy -p %p %h

    https://www.evilbox.ro/linux/solve-ssh_exchange_identification-connection-closed-by-remote-host/ for reference

    0 讨论(0)
  • 2021-01-30 09:08

    Remove any config in ~/.ssh/config or other ssh config places which will disallow it to reach to Github servers

    In my case it was below config, and I wasn't connected to VPN.

    Host *
      ProxyJump 10.0.0.50 
    

    Note :- If I am connected to VPN, This config would mean git clone or any git operation will be send via VPN which might be slow depending on type of VPN we are using.

    0 讨论(0)
  • 2021-01-30 09:10

    For me this was caused by a limit on the number of concurrent ssh sessions. I added the two params below to /etc/ssh/sshd_config and then things worked.

    echo 'MaxSessions 2000' >> /etc/ssh/sshd_config
    echo 'MaxStartups 2000' >> /etc/ssh/sshd_config
    service ssh restart
    
    0 讨论(0)
提交回复
热议问题