使用 VSCode Remote SSH 连接到群晖 DSM

Quick Start

vscode直接ssh进入群晖时会出现:

The remote host may not meet VS Code Server’s prerequisites for glibc and libstdc++

https://community.synology.com/enu/forum/10/post/153781

解决办法如下:

ssh命令行进入群晖

1
ssh [email protected]
1
sudo vim /usr/bin/ldd
1
2
#/bin/sh 
echo "ldd 2.20"
1
chmod 755 /usr/bin/ldd

开启端口转发

1
2
3
sudo cp sshd_config sshd_config.bck
cd /etc/ssh/
/etc/ssh$ sudo vim sshd_config

修改配置

1
2
AllowAgentForwarding yes 
AllowTcpForwarding yes

alt
注意一共有两处,文件起始处的参数去掉#注释,另外一处在文档末尾
image.png

建议root和admin等账户不要改,在末尾加一项自己的用户名配置,username是你自己的DSM账户名:

1
2
3
Match User username
AllowAgentForwarding yes
AllowTcpForwarding yes

重启sshd

1
2
sudo systemctl restart sshd 
rm -rf ~/.vscode-server/

引用自:microsoft/vscode-remote-release#8132 (comment)

更多内容请关注我的博客