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.配置错误 参看该文章

相关推荐
*wait for?2 天前
VScode使用uv-创建python虚拟环境
ide·vscode·编辑器
GPU实战笔记2 天前
云端写 Python:JupyterLab 和 VS Code Remote-SSH,按工作方式选
python·vs code·jupyterlab·remote-ssh·远程开发·云端开发
意法半导体STM322 天前
【官方原创】LAT1724 STM32CubeIDE for VSCode 修改链接文件中的起始地址无效?
vscode·stm32·单片机·嵌入式硬件·mcu·stm32cube
超级大福宝3 天前
VS Code Remote-SSH 因 RemoteForward 端口冲突导致连接失败的排查与解决
运维·服务器·windows·vscode·ssh
golang学习记4 天前
VSCode AI完成任务的仪式感:撒礼花
ide·vscode·编辑器
菜_小_白5 天前
codex
linux·vscode·ai
cuijiecheng20185 天前
Codex VS Code 插件新版卡住、界面异常:通过降级插件版本解决
vscode
golang学习记6 天前
VSCode AI新特性:HydraFusion来了:系统会自己组队干活
ide·人工智能·vscode
mklpo1476 天前
在win7 sp1 系统上安装最新版 的 Visual Studio Code。2026-10-04
ide·vscode·编辑器
承渊政道9 天前
Linux系统学习【线程概念与控制核心知识详解】
linux·运维·vscode·学习·ubuntu·线程创建 终止 等待