kex_exchange_identification: Connection closed by remote host

今天在windows命令行下准备上传文件到github的时候,ssh出现了如下问题

1
2
3
$ ssh -T git@github.com
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22

按照老办法,重新生成了ssh-key并添加到了github

再次测试,依旧是此报错,可奇怪了


于是百度了一下

1
ssh -Tv git@github.com

用了这个命令,没想到就好了

1
2
3
4
5
Hi musnows! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3136, received 2936 bytes, in 0.7 seconds
Bytes per second: sent 4251.8, received 3980.7
debug1: Exit status 1

不过,也可能不是这个命令的作用,恐怕就是玄学网络问题罢了