当前位置:网站首页>【修电脑】系统重装但IP不变后VScode Remote SSH连接失败解决
【修电脑】系统重装但IP不变后VScode Remote SSH连接失败解决
2022-08-09 06:37:00 【松库本库】
目录
问题一 Host key verification failed. 过程试图写入的管道不存在。
问题一说明
原IP地址的linux服务器成功用SSH连接过,后来因某些原因,Linux服务器重装了,但IP依旧保留不变。
自己的Windows机器上关于该target ip的缓存没有删除,因此报错Connection failed,但不清楚具体的缓存信息保存在哪。根据如下连接失败时的日志信息进行排障。
其中部分信息省略。关键报错信息如下,敏感信息已模糊处理:
[16:06:27.600] Running script with connection command: ssh -T -D 55569 "10.xxx.xxx.xxx" bash
[16:06:27.606] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:06:28.195] > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> @ 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:z6+hBVhvhl5CJHb7duA8ku3nq3ZiRrhWv89SIEgjDwY.
> Please contact your system administrator.
> Add correct host key in C:\\Users\\username/.ssh/known_hosts to get rid of this message.
> Offending ECDSA key in C:\\Users\\username/.ssh/known_hosts:29
> Host key for 10.xxx.xxx.xxx has changed and you have requested strict checking.
> Host key verification failed.
> 过程试图写入的管道不存在。
> ]0;C:\WINDOWS\System32\cmd.exe
[16:06:28.196] Got some output, clearing connection timeout
问题一解决
可以看到C:\\Users\\username/.ssh/known_hosts中确实将目标linux服务器列为known_host,我们进入到特定文件中,如下如所示的known_hosts文件和known_hosts.old,找到该ip对应的行,将其删除,再进行连接尝试。
之所以也删除.old文件中关于目标IP的描述,是担心VScode的恢复机制,会从old文件中提取相关描述,重新写入到known_hosts文件中。

此时即可看到可以继续连接。
点击continue之后,输入密码。即可连接成功。如下图:
问题二 ssh: connect to host 192.168.xxx port 22: Connection timed out > 过程试图写入的管道不存在。
问题二说明
此vmware内的kali虚拟机环境的ip地址分配并非自己通过dhcp动态分配,而是手动配置的静态IP地址,VMware中的kali能够上外网。但主机vscode ssh连接失败。
参考:服务器22端口连接超时 ssh: connect to host *** port 22: Operation timed out
得知IP配置错误。发现vmware内kali能够ping通主机,但主机ping不同内网中的kali。
后来发现,自己Win11上已经没有了该Kali IP的网关网卡。而该Kali采用的是NAT模式,具体而言就是自己没有了VMnet8。
问题二解决
参考:网络适配器中找不到VMware Network Adapter VMnet8选项
查询相关资料后得知,需要在VMware Workstation中编辑=>虚拟网络编辑器=>NAT模式的那个网络下,勾选连接到主机网络适配器的选项,这样Win11上就会自动生成一个Vmnet8网卡。如下图所示:
这样就既可以ping通也可以ssh连接成功了。
边栏推荐
猜你喜欢

leetcode 之盛水问题

IQ Products巨细胞病毒CMV感染检测试剂盒的特征和应用

2022-08-08: Given an array arr, it represents the height of the missiles that will appear in order from morning to night.When the cannon shoots missiles, once the cannon is set to shoot at a certain h

Flask failed to create database without error

工控设备的系统如何进行加固

ByteDance Written Exam 2020 (Douyin E-commerce)

普罗米修斯原理及节点发布

中英文说明书丨CalBioreagents 山羊抗人白蛋白,IgG组分

中英文说明书丨CalBioreagents ACTH N端单克隆抗体

leetcode 之 70 爬楼梯问题 (斐波那契数)
随机推荐
C language implements sequential stack and chain queue
XxlJobConfig分布式定时器任务管理XxlJob配置类,替代
zip压缩包密码解密
e-learning summary
Program Performance Analysis - Complexity Analysis
golang xml 处理动态属性
语句加锁分析
长沙学院2022暑假训练赛(一)六级阅读
The singleton pattern
Fragments
.NET高级技术
治疗消化性溃疡—Toronto Research Chemicals 甘氨酸铝
报错:FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS重大开销和将disab补充道
阿里巴巴官方技术号
简单使用Lambda表达式
Search 1688 product interface by image (item_search_img-search 1688 product by image (Politao interface) code docking tutorial
P7 Alibaba Interview Questions 2020.07 Sliding Window Algorithm (Alibaba Cloud Interview)
workbench 数据导出
The JVM thread state
Output method of list string print(*a) print(““.join(str(c) for c in a) )