Armitage2k
Armitage2k

Reputation: 1254

VS-Code Remote SSH: failed to set up socket - other clients are ok?

I am trying to connect to my shared server via VS Code Remote-SSH, but get the timeout error every time with the below error message. This error only occurs with VS Code Remote-SSH, when using another client (Putty, Termius) the connection works just fine.

Please note: this is a shared server where I have SSH access, but no sudo privileges and connect via port 1394. Also, the error notification popup ultimately says Could not fetch remote environment. Since its working well in Putty, my best guess is that there are some settings in VS-Code I need to adjust. Appreciate any insight.

[10:46:52.974] Remote server is listening on 17332
[10:46:52.974] Parsed server configuration: {"remoteListeningOn":{"port":17332},"osReleaseId":"Linux","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","tmpDir":"/run/user/65612","platform":"linux"}
[10:46:52.976] Persisting server connection details to /Users/User/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-MY-SERVER-e5a624b788d92b8d34d1392e4c4d9789406efe8f-0.56.0/data.json
[10:46:52.978] Starting forwarding server. localPort 62979 -> socksPort 62958 -> remotePort 17332
[10:46:52.979] Forwarding server listening on 62979
[10:46:52.979] Waiting for ssh tunnel to be ready
[10:46:52.980] Tunneled 17332 to local port 62979
[10:46:52.980] Resolved "ssh-remote+7b22686f73744e616d65223a225143492d536f75726365227d" to "127.0.0.1:62979"
[10:46:52.981] [Forwarding server 62979] Got connection 0
[10:46:52.996] ------
[10:46:53.034] [Forwarding server 62979] Got connection 1
[10:46:53.035] [Forwarding server 62979] Got connection 2
[10:46:53.055] Failed to set up socket for dynamic port forward to remote port 17332: Socket closed. Is the remote port correct?
[10:46:53.104] Failed to set up socket for dynamic port forward to remote port 17332: Socket closed. Is the remote port correct?
[10:46:53.104] Failed to set up socket for dynamic port forward to remote port 17332: Socket closed. Is the remote port correct?

Upvotes: 7

Views: 8327

Answers (1)

wuyimin
wuyimin

Reputation: 171

Edit /etc/ssh/sshd_config

vi /etc/ssh/sshd_config

Change AllowTcpForwarding to yes

AllowTcpForwarding  = yes

Restart sshd

systemctl restart sshd

Upvotes: 17

Related Questions