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
Got the same error message. Turning off WiFi and turning it back on again worked for me.
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.
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.
To solve this edit /etc/ssh/ssh_config and comment the following line 1
https://www.evilbox.ro/linux/solve-ssh_exchange_identification-connection-closed-by-remote-host/ for reference
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.
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