距离上次更新本文已经过去了 679 天,文章部分内容可能已经过时,请注意甄别

kex_exchange_identification: Connection closed by remote host

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

plaintext
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

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


于是百度了一下

plaintext
1
ssh -Tv git@github.com

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

plaintext
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

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