报错
VS Code 无法连接到远程扩展主机服务器 (错误: WebSocket close with status code 1006)
channel 3: open failed: administratively prohibited: open failed
解决
step1
清理/root/.vscode-server目录(注意:.vscode-server的安装位置vscode第一次远程连接时会显示在vscode终端,如果找不到可以find / -name .vscode-server),vs代码将在再次连接到远程计算机时创建一个新目录。
step2
vim /etc/ssh/sshd_config
将AllowTcpForwarding yes #注释去掉,改成 yes
重启 sshd服务:systemctl restart sshd
如果仍然不能解决,参考vscode remote shh出现 open failed:administratively prohibited:open failed 问题进行尝试。
参考链接
VS Code Remot-SSH连接及各种报错集合
Vscode无法连接到远程Linux (_WebSocket关闭,状态代码1006)
当VSCode遇到无法连接到远程扩展主机服务器,错误提示WebSocket关闭状态代码1006时,可以尝试清理远程服务器上的.vscode-server目录,并在sshd_config文件中确保AllowTcpForwarding设置为yes,然后重启sshd服务。如果问题依然存在,参考相关资料进一步排查。
3907

被折叠的 条评论
为什么被折叠?



