当先锋百科网

首页 1 2 3 4 5 6 7
The authenticity of hostx.x.x.x' can't be established.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? fail

该问题是因为vmare中的虚拟机设置的是nat模式,虚拟机IP发生变化导致秘钥不可用
解决方案:

  1. 删除服务器中的authorized_keys和knowns_host文件。
  2. 删除本地电脑中的秘钥文件重新生成(ssh-genkey),ssh-copy-id copy本地公钥到远程服务器
ssh-copy-id  -i ~/.ssh/id_rsa.pub [email protected]

  1. 通过ssh-keyscan查询本地公钥是否传输到远程服务器中\
  2. 重启vscode尝试远程