我在vscode里面远程连接服务器编辑代码时,正常我按F1选择了服务器IP地址,然后让我选在Linux,然后我再输入服务器密码,但是当我选择Linux系统之后直接没出让我输入服务器密码的输入框,而是直接报错
could not esatablish connection 172.31.8.199
然后vscode里面有下面的打印
[10:17:41.574] Log Level: 2
[10:17:41.584] SSH Resolver called for "ssh-remote+172.31.8.199", attempt 1
[10:17:41.584] "remote.SSH.useLocalServer": false
[10:17:41.584] "remote.SSH.showLoginTerminal": false
[10:17:41.585] "remote.SSH.remotePlatform": {"172.31.8.78":"linux","172.31.8.79":"linux","192.168.1.7":"linux"}
[10:17:41.585] "remote.SSH.path": undefined
[10:17:41.585] "remote.SSH.configFile": undefined
[10:17:41.585] "remote.SSH.useFlock": true
[10:17:41.586] "remote.SSH.lockfilesInTmp": false
[10:17:41.586] "remote.SSH.localServerDownload": auto
[10:17:41.586] "remote.SSH.remoteServerListenOnSocket": false
[10:17:41.586] "remote.SSH.showLoginTerminal": false
[10:17:41.587] "remote.SSH.defaultExtensions": []
[10:17:41.587] "remote.SSH.loglevel": 2
[10:17:41.588] "remote.SSH.enableDynamicForwarding": true
[10:17:41.588] "remote.SSH.enableRemoteCommand": false
[10:17:41.588] "remote.SSH.serverPickPortsFromRange": {}
[10:17:41.591] "remote.SSH.serverInstallPath": {}
[10:17:41.595] VS Code version: 1.80.2
[10:17:41.596] Remote-SSH version: remote-ssh@0.102.0
[10:17:41.596] win32 x64
[10:17:41.597] SSH Resolver called for host: 172.31.8.199
[10:17:41.597] Setting up SSH remote "172.31.8.199"
[10:17:41.601] Using commit id "2ccd690cbff1569e4a83d7c43d45101f817401dc" and quality "stable" for server
[10:17:41.605] Install and start server if needed
[10:17:43.168] Checking ssh with "C:\Program Files (x86)\VMware\VMware Workstation\bin\ssh.exe -V"
[10:17:43.173] Got error from ssh: spawn C:\Program Files (x86)\VMware\VMware Workstation\bin\ssh.exe ENOENT
[10:17:43.174] Checking ssh with "C:\Program Files\Common Files\Oracle\Java\javapath\ssh.exe -V"
[10:17:43.177] Got error from ssh: spawn C:\Program Files\Common Files\Oracle\Java\javapath\ssh.exe ENOENT
[10:17:43.177] Checking ssh with "D:\secureCRT_is_installed_here\ssh.exe -V"
[10:17:43.181] Got error from ssh: spawn D:\secureCRT_is_installed_here\ssh.exe ENOENT
[10:17:43.181] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[10:17:43.182] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[10:17:43.183] Checking ssh with "C:\Windows\ssh.exe -V"
[10:17:43.184] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[10:17:43.185] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[10:17:43.186] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[10:17:43.186] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:17:43.188] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:17:43.189] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[10:17:43.246] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
[10:17:43.251] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 14448 "172.31.8.199" bash
[10:17:43.254] Terminal shell path: C:\Windows\System32\cmd.exe
[10:17:43.489] > ]0;C:\Windows\System32\cmd.exe
[10:17:43.490] Got some output, clearing connection timeout
[10:17:43.557] > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[10:17:43.566] > @ 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 ECDSA key sent by the remote host is
> SHA256:eDN7dleUTuAKnCIvvXQ7gKxUxLXX7X46cBqiJtKGdUk.
> Please contact your system administrator.
> Add correct host key in C:\\Users\\chw/.ssh/known_hosts to get rid of this messa
> ge.
> Offending ECDSA key in C:\\Users\\chw/.ssh/known_hosts:10
> ECDSA host key for 172.31.8.199 has changed and you have requested strict checki
> ng.
> Host key verification failed.
[10:17:43.581] > 过程试图写入的管道不存在。
[10:17:44.852] "install" terminal command done
[10:17:44.852] Install terminal quit with output: 过程试图写入的管道不存在。
[10:17:44.853] Received install output: 过程试图写入的管道不存在。
[10:17:44.853] Failed to parse remote port from server output
[10:17:44.855] Resolver error: Error:
at m.Create (c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:584145)
at t.handleInstallOutput (c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:582705)
at t.tryInstall (c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:681881)
at async c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:644110
at async t.withShowDetailsEvent (c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:647428)
at async t.resolve (c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:645160)
at async c:\Users\chw\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:720916
[10:17:44.866] ------
我直接问Bing AI,得到如下结果
那应该是删除我电脑中保存的服务器的秘钥,我从上面的报错log里面可以看到一行这个
> Add correct host key in C:\\Users\\chw/.ssh/known_hosts to get rid of this messa
那秘钥的路径应该就在
然后我打开known_hosts.old,把里面有关199服务器的哪一行删掉就好了。
172.31.8.78 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHNQcRzt9gH8OGI1/yZpr1NKQz6oox94i7JRP+2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NRtDSRLuTno68wPLqc+01e/ClKnJSG6CSXvT4KeHs736+DE7Pdzaz6GHpyunDaDP6gSgepfZJFOl7ULswU0aXXeDLVHD3sJURX+eemnHdXXj9fbnmztIBVsYF49xoow2J++fbnTdNoStI9Id240DBhtLOd4A8hDdavxQrjHXScsOyj/5bSX4syot94YrULO45MhGKL5uBv
172.31.8.31 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOEy/AvraF8+Fmb5UQ5+pzCeq+VhJfhvRcN1nzj5fF4j3JLPD+H2MIzXNljTfKFUCeQx8EZQUYtTjd9HeQvwP1U=
172.31.8.142 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOEy/AvraF8+Fmb5UQ5+pzCeq+VhJfhvRcN1nzj5fF4j3JLPD+H2MIzXNljTfKFUCeQx8EZQUYtTjd9HeQvwP1U=
这一行删掉 172.31.8.199 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM21brvcOxJ0SIBt0I5VFNdhLFIp/KmYzrjgD+B6L3xgvz8JRL5vgNwNr7fFF0mTRii/fo1wK+HMNimU1sBZGrU=
192.168.1.147 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBLU59XX5bhG6cqh8g+r72k3pq1OSbZVvAgwuaGZQHoAWQC9PvHs+CU1230svjsXZzTp54onPcaH1iJHj6fvL0s8=
192.168.1.221 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDCyY61fNZ8Bf8kGmkqGEIipKHF/QZW6UrOi9TZtFylxw9HDlz8svfreCKzjoszdOXffSmohZzkUxJbGcyub3l8=
192.168.1.221 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINcy/xSTPoCTqkOyzzakt1gFwSPzekGT6kHbU7fPrKnx
192.168.1.191 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMbQmjFvs5cVa8PWP04eF9mLANKYP+zORlhB/dIGVVfRVO7HrddIsu7aXHJrbVGelcvgnhPB+SAzVH3eKAbxnNw=
192.168.1.222 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKvNUHjrY8yX8y87I9v1x0pjq5wWbjq8/Z/+369aJOQuhDotSxia3TbcYWmKpn+fgr1kR8GZP6xDuls2jq5Xm18=
192.168.1.184 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBF91BRo2SClRF+g3i3YTGfpJOQYzln//SZiSgxG/lIHwf3yH9MmaXsFKEo3o94detkTL4r0p9isFYT10s8wQiMs=