带端口连接方式:
ssh root@10.10.10.10:22001
问题描述
之前连接正常,今天连接,出现无法连接问题,报错如下:
[14:00:21.495] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[14:00:22.263]
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
> Someone could be eavesdropping on you right now (man-in-the-middle attack)!
> It is also possible that a host key has just been changed.
> The fingerprint for the ED25519 key sent by the remote host is
> SHA256:xxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxx.
> Please contact your system administrator.
> Add correct host key in C:\\Users\\admin/.ssh/known_hosts to get rid of this message.
> Offending ECDSA key in C:\\Users\\admin/.ssh/known_hosts:16
> Host key for [10.4.23.19]:20125 has changed and you have requested strict checking.
> Host key verification failed.
> 过程试图写入的管道不存在。
[14:00:22.264] Got some output, clearing connection timeout
问题解决
-
Windows 系统:
- 打开文件管理器,进入路径:
C:\Users\admin\.ssh\
(注意替换admin
为你的用户名)。 - 找到并编辑
known_hosts
文件(可用记事本打开)。 - 找到包含
10.10.10.10:22001
的那一行(错误信息提示在第 16 行:Offending ECDSA key in ...:16
),删除整行。 - 保存文件后,重新尝试 SSH 连接。
- 打开文件管理器,进入路径:
或者删除整个known_hosts
重新连接即可解决。