VSCode SSH远程连接失败 最速解决方案

步骤 1:获取本地 VSCode 的 commit ID

在本地电脑的终端中运行:

bash

复制代码
code --version

你会看到类似这样的输出:

text

复制代码
1.85.0
af28b32d7e553898b2a91af498b1fb666fdebe0c
x64

第二行就是你的 commit ID

步骤 2:在服务器上手动下载 vscode-server

登录到你的服务器,然后执行:

bash

复制代码
# 创建目标目录
mkdir -p ~/.vscode-server/bin/<你的commit-id>

# 进入目录
cd ~/.vscode-server/bin/<你的commit-id>

# 使用 wget 下载(推荐使用 -c 参数支持断点续传)
wget -c https://update.code.visualstudio.com/commit:<你的commit-id>/server-linux-x64/stable -O vscode-server.tar.gz

# 解压
tar -xzf vscode-server.tar.gz

# 重命名解压出的文件夹(解压后通常是一个名为 "vscode-server-linux-x64" 的文件夹)
mv vscode-server-linux-x64/* ./
rmdir vscode-server-linux-x64

步骤 3:验证文件结构

确保 ~/.vscode-server/bin/<你的commit-id> 目录下包含:

text

复制代码
bin  extensions  LICENSE  node  node_modules  out  package.json  product.json

步骤 4:重新连接

现在重新用 VSCode 连接服务器,应该就能直接成功了!

相关推荐
猪在黑魔纹里8 小时前
解决VSCode无法高亮、解析numpy中的部分接口(如pi、deg2rad)
ide·vscode·python·numpy
辣椒酱.8 小时前
vscode报错------控制台
vscode·编辑器
让梦想疯狂8 小时前
Visual Studio 自动格式化代码
ide·visual studio
code bean8 小时前
【CMake 】[第九篇] 解决 CMake + Visual Studio 中文乱码问题完整指南
ide·visual studio
AllinGold9 小时前
反重力Antigravity配置
ide
欢喜躲在眉梢里10 小时前
基于 openFuyao 社区的无硬件 UB 开发实战指南
运维·数据库·人工智能·vscode·ai·开发工具·go开发
秦时明月天明10 小时前
GitLab SSH Key 过期:git pull failed : remote your ssh key has expired
git·ssh·gitlab
粤M温同学10 小时前
VsCode快速打出console.log()方法设置
vscode·编辑器
阿关@11 小时前
Vscode中Python无法将pip/pytest”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
vscode·python·pip
忘带键盘了11 小时前
eclipse配置
java·ide·eclipse