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

相关推荐
lanhuazui1018 小时前
【Vscode】显示多个文件 & 打开多个文件时实现标签栏多行显示
vscode·编辑器
张较瘦_21 小时前
环境搭建 | [入门级]VSCode(Cursor|Trae|Qoder)搭建Java(Springboot3)企业开发环境全流程
java·ide·vscode
天赐细莲1 天前
(Linux) WSL 通过 VSCode 连接不执行 profile 问题(登录Shell问题)
linux·运维·vscode
暮色驶过苍茫1 天前
VSCode 配置 SSH 远程连接
ide·vscode·ssh
我狸才不是赔钱货2 天前
DevOps:打破开发与运维之间的高墙
运维·vscode·docker·devops
我狸才不是赔钱货2 天前
揭开命令行的面纱:终端、CLI、Shell的终极辨析
vscode·ssh·bash
非得登录才能看吗?2 天前
VScode 入门(设置篇)
ide·vscode·编辑器
AlphaFinance3 天前
Windows下Vscode连接到WSL的方法
ide·vscode·编辑器
Dobby_053 天前
【Go】C++ 转 Go 第(二)天:变量、常量、函数与init函数
vscode·golang·go
止观止3 天前
如何开发 VSCode 内置扩展:从零开始构建最简扩展
ide·vscode·编辑器