ssh 连接出现错误: kex_exchange_identification: Connection closed by remote host

错误如下表示:

windstorm@LocalHost-Server ~> ssh [email protected]
Couldn't get a file descriptor referring to the console.
fish: Unknown command: nc
fish:
exec nc -X connect -x 127.0.0.1:15732 192.168.122.22 22
     ^^
kex_exchange_identification: Connection closed by remote host

当出现这种错误的时候,不要慌,我在csdn上面看了其他人描述的花里胡哨,其实一点用没有,实际上你只要初始化一下你本用户的.ssh文件夹就可以了。

那么怎么初始化?

直接一条命令搞定

rm .ssh -rf

执行完这条命令,然后接着执行ssh 连接主机就可以成功执行了。

原因可能是我们本地的.ssh出现了问题,或者是ssh进行了更新,导致出现的问题,实际上我们只要重新生成一下就可以了。

猜你喜欢

转载自blog.csdn.net/weixin_53064820/article/details/131764965
今日推荐