https://stackoverflow.com/questions/75837749/vscode-failed-to-set-up-socket-for-dynamic-port-forward-to-remote-port-connect
1. SSH Server Configuration:
AllowTcpForwarding Setting: Verify that AllowTcpForwarding is set to yes in the SSH daemon configuration file (/etc/ssh/sshd_config) on the remote server. If it's set to no or commented out, uncomment it and set it to yes.
Code
sudo nano /etc/ssh/sshd_config
Ensure the line AllowTcpForwarding yes is present and not commented out.
Restart SSH Service: After modifying sshd_config, restart the SSH service on the remote machine for changes to take effect.
Code
sudo /etc/init.d/ssh restart
2. VS Code Server Issues:
Corrupted VS Code Server: A corrupted or outdated VS Code server installation on the remote machine can cause issues. Delete the .vscode-server folder in the user's home directory on the remote machine and reconnect with VS Code. VS Code will then reinstall a fresh server.
Code
rm -rf ~/.vscode-server
* your /etc/ssh/sshd_config may have this
Include /etc/ssh/sshd_config.d/*.conf
DisableForwarding yes