1. 问题
今天提交代码,出现如下错误:kex_exchange_identification: read: Connection reset by peer
2. 原因
When an ssh client connects to an ssh server, the server starts by sending a version string to the client. The error that you're getting means that the TCP connection from the client to the server was "abnormally closed" while the client was waiting for this data from the server, in other words immediately after the TCP connection was opened.
As a practical matter, it's likely to mean one of two things:
- The ssh server process malfunctioned (crashed), or perhaps it detected some serious issue causing it to exit immediately.
- Some firewall is interfering with connections to the ssh server.
3. 解决
3.1 查询 ip 地址
终端输入命令,结果如图
ifconfig
3.2 更新指文
ssh-keygen -R <ip地址>