VSCode remote-ssh 连接远端服务器失败

系统

Mac os Intel处理器

描述

该问题在上午时还没有,下午突然毫无征兆的发生,当时没有更新vscode,没有更新插件。

分析

网上对于该问题的答案多是说磁盘空间不够vscode不能下载相应插件,我所遇到的并不是这种情况。报的错误多是bash的脚本错误,感觉是bash环境没有配置好,重装vscode没有办 法清除掉所有的配置遗留,关于插件的配置文件存放位置没有再继续深究

bash报错记录

bash: syntax error near unexpected token `then'

bash: syntax error near unexpected token `else'

bash: syntax error near unexpected token `fi'

bash: syntax error near unexpected token `}'

bash: syntax error near unexpected token `('

vscode报错内容

The remote host may not meet VS Code Server's prerequisites for glibc and libstd

解决方案

Command+Shift+p 调出 Command Palette 搜索 Remote-SSH: Settings

找到 Remote.SSH: Use Local Server 禁用该项

重新连接远端服务器,会提示选择目标系统(Linux, Mac, Windows)之后就正常了

参考链接

Unable to connect to Arch Linux (5.16.9-arch1-1) remote host without bash as default shell · Issue #6341 · microsoft/vscode-remote-release · GitHub 其中**ihciah**的发言中提到了该方法

其它

关于该问题主要有三个方向

1.磁盘空间 https://www.cnblogs.com/fireinstone/p/16059207.html

2.使用的是/bin/sh不是/bin/bash

​​​​​​ https://github.com/microsoft/vscode-remote-release/issues/5111#issuecomment-858493199

https://github.com/microsoft/vscode-remote-release/issues/6341

3.配置错误 参看该文章

相关推荐
爱就是恒久忍耐13 天前
VSCode里如何比较2个branch
ide·vscode·编辑器
意法半导体STM3213 天前
【官方原创】如何为STM32CubeMX2配置Visual Studio Code配置方案
vscode·stm32·单片机·嵌入式硬件·策略模式·stm32cubemx·嵌入式开发
bloglin9999913 天前
vscode中可视化的合并分支,在“合并编辑器中解析”中“与基线进行比较”是什么意思
ide·vscode·编辑器
天疆说13 天前
在 Ubuntu 的 VSCode 中配置 MATLAB
vscode·ubuntu·matlab
春日见14 天前
vscode的AI编程插件推荐:
大数据·ide·vscode·算法·机器学习·编辑器·ai编程
jieshenai14 天前
VScode sys.path,并使CTRL+左键可访问源码
ide·vscode·编辑器
qq_4480111614 天前
VSCode环境搭建
ide·vscode·编辑器
qq_3384323714 天前
VSCode Remote-SSH 远程 Windows Server 卡死的排查与解决
windows·vscode·ssh
console.log('npc')14 天前
Codex 桌面端接入 Headroom 压缩代理完整教程
前端·vscode
女神下凡15 天前
这是 Cursor(Composer) 的五种核心交互模式
服务器·人工智能·windows·vscode·microsoft