解决 VSCode 远程登录失败 Error: WebSocket close with status code 1006

保留现场

使用 VSCode 远程登录失败,报错:Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006)。

解决方法

vim /etc/ssh/sshd_config

AllowTcpForwarding no

AllowAgentForwarding no

# 替换为

AllowTcpForwarding yes

AllowAgentForwarding yes

保存后重启 sshd 服务:

systemctl restart sshd