当前位置:网站首页>vscode使用ssh远程连接失败
vscode使用ssh远程连接失败
2022-04-22 01:14:00 【吨吨不打野】
1. 常见错误和解决方案
去查看自己的错误,
- 在vscode界面,帮助 -> 切换开发人员工具
- 如果是windows系统,直接快捷键
ctrl+shift+I打开开发者工具。
1.1 ERR Request 7 timed out (15000ms)

ERR Error: Time limit reached,超时错误,15000ms是个参数,可以设置响应等待时间,默认是15s,可以改为其他时间
参考 Stack Overflow:why ssh connection timed out in vscode?
- 文件-> 首选项->设置
- 在
常用设置中,找到扩展->Remote-SSH - 把15s改成更长的时间

另外,也有方法是修改一个配置文件。
依旧是在设置中,搜索ssh,找到 在setting.json中编辑

在这个文件夹中加入:"remote.SSH.useLocalServer": false,,编辑后文件类似下面这样:
{
"security.workspace.trust.untrustedFiles": "open",
"remote.SSH.useLocalServer": false,
"remote.SSH.remotePlatform": {
"10.71.10.49": "linux",
"10.70.21.10": "linux"
},
"workbench.colorTheme": "Quiet Light",
"workbench.iconTheme": "office-material-icon-theme",
"terminal.integrated.windowsEnableConpty": false,
}
如果没什么用的话,说明可能本地和远程服务器之间网可能确实不太好,大部分情况下重连几次就好了
1.2 ERR Error: WebSocket close with status code 1006
在开发者工具里信息如下:

其实在输出->remote ssh中,也会有一些有用的信息,

错误信息为:
Failed to set up socket for dynamic port forward to remote port XXX: Proxy connection timed out. Is the remote port correct?
大概意思是代理超时了。。(应该是vpn有问题?但是mobaxterm连接依然非常顺利)
参考Github:Vscode-issue
一些人选择降级,但是2021年是1.52版本,现在已经1.66了,而且这个问题已经关闭了,应该新版本已经解决了
参考
2. 自己看日志找适合自己的解决方案
2.1 确认错误
感谢Github上的issue:Keeps reconnect and reload when Remote SSH with VPN #2565,启发我去看自己的输出信息,确定远程log文件的位置。

使用xshell或者mobaxterm等远程连接工具,去查看上面这个日志文件,例如:
vim /home/user/.vscode-server/.dfd34e8260c270da74b5c2d86d61aee4b6d56977.log
找到其中的报错信息,例如我的是
[15:13:51] [Error: Could not find pty on pty host,
at C._throwIfNoPty (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:20:5336),
at C.updateTitle (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:20:1676),
at Object.call (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:13:8332),
at E.onPromise (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:12:4867),
at E.onRawMessage (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:12:4262),
at /home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:12:3554,
at L.invoke (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:8:145),
at l.fire (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:8:1856),
at process.U (/home/user/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/out/vs/platform/terminal/node/ptyHostMain.js:6:34661),
at process.emit (node:events:390:28),
at emit (node:internal/child_process:917:12),
at processTicksAndRejections (node:internal/process/task_queues:84:21)]
2.2 搜索解决(需要等待官方debug)
进一步搜索vscode remote Error: Could not find pty on pty host,,根据Github的issue:Could not find pty on pty host #144548。
- 一模一样的报错信息(自动测试机器人发现的。。)
- 2022.3.7才分配的错误
- 报错代码位于这里
- 修复时间从3月推迟到了4月
- 等吧
版权声明
本文为[吨吨不打野]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Castlehe/article/details/124196344
边栏推荐
- Huawei cloud hosting experience: your software storage expert
- Solve the problem that the idea web project does not have small blue dots
- Kotlin - Introduction to higher order functions
- 【Pranet】论文及代码解读(RFB与aggregation部分)——Cavy岚
- 简单理解变量的结构赋值
- Pytorch安装及GroupSpatialSoftmax报错解决
- Tencent byte and other big companies interview real questions summary, Android programmers how to gracefully cross the 30K barrier
- CH4INRULZ靶机渗透测试
- A comprehensive analysis of the application of histogram
- Draw2d custom dashboard
猜你喜欢

【Pranet】论文及代码解读(RFB与aggregation部分)——Cavy岚

Trollcave target penetration test

Several schemes of single USB to multi serial port

DVWA系列——CSRF

网络模型 LSTM模型内容详解

Fast r-cnn code detailed annotation data shape

【PraNet】主要架构解读-------wmilk
![[PRANET] paper code interpretation (loss function) - Blank](/img/86/f365b813f85efc820076e05d1cbb3e.png)
[PRANET] paper code interpretation (loss function) - Blank

学习 Butterfly主题美化 这一篇就够了

系统工程师面试问题,大专生三面蚂蚁金服
随机推荐
Filter the eloquent model using multiple optional filters
学习 Butterfly主题美化 这一篇就够了
Tencent Android development interview experience, HR's words pierced my heart
PR如何对裁剪之后的视频进行resize,指定到期望大小?
Huawei cloud hosting experience: your software storage expert
Introduction notes to PHP zero Foundation (11): String
CH4INRULZ靶机渗透测试
Zabbix深度监控:多款开源工具构建企业监控新架构
In 2022, crud alone can't meet the interview and upgrading notes of large factories in spring recruitment
一个朋友的方法
Investigator靶机渗透测试
代码源每日一题 div1 (501-507)
A friend's way
draw2d自定义仪表盘
[PRANET] paper and code interpretation -- cfsong
简单理解变量的结构赋值
Vnpy chapter of quantitative trading - synchronization module avoids self transaction risk and adds synchronization completion prompt
2022年春招大厂面试升级笔记,光CRUD已经不能满足了
Redis个人笔记:Redis应用场景,Redis常见命令,Reids缓存击穿穿透,Redis分布式锁实现方案,秒杀设计思路,Redis消息队列,Reids持久化,Redis主从哨兵分片集群
代码源每日一题 div1 (301-307)