Connecting to Synology DSM Using VSCode Remote SSH

Quick Start

When connecting to Synology directly via VSCode SSH, you may encounter the following error:

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

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

Resolution:

1. Connect to Synology via SSH Command Line

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

2. Enable Port Forwarding

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

Modify the configuration as follows:

1
2
AllowAgentForwarding yes 
AllowTcpForwarding yes

alt
Note: There are two occurrences of these parameters. Uncomment them at the beginning of the file and add them again at the end.
image.png

It is recommended to avoid modifying the root and admin account configurations. Instead, add a new configuration block at the end of the file for your DSM account (replace “username” with your actual username):

1
2
3
Match User username
AllowAgentForwarding yes
AllowTcpForwarding yes

3. Restart sshd

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

See also: microsoft/vscode-remote-release#8132 (comment)