没有解决,思路全错。可能就是网络问题。
错误描述
使用git
通过SSH
克隆远程仓库时,出现错误
ssh_dispatch_run_fatal: Connection to 20.205.243.166 port 22: Operation timed out
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
我记得我是有私钥的,做个测试。
1 | ssh ssh -T [email protected] |
报错
kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22
可能原因
搜了一下,出现kex_exchange_identification: Connection closed by remote host这个问题好像没啥通用的原因。
有个人提到
In OpenSSH source code, kex_exchange_identification is a function to exchange server and client identification (duh), and the specified error happened if the socket connection between OpenSSH server and client is interrupted (see EPIPE), i.e. client already closed its connection
来源https://serverfault.com/questions/1015547/what-causes-ssh-error-kex-exchange-identification-connection-closed-by-remote
我突然记起来前段时间使用brew install openssl
安装了一个openssl
。于是系统里有了两个openssl
。
1 | which -a openssl |
所以可能是这个新的openssl
不认原来的。(猜测
先Debug一下。
1 | ssh -vT [email protected] |
输出如下:
1 | OpenSSH_9.0p1, LibreSSL 3.3.6 |
居然又可以了。。。 好了,可以否决这个想法了。
Operation timed out
可能就是网络问题吧。
解决方法:没有。好像是网络问题
网上有人说可以重新生成key解决,没试。