我试图通过VS代码远程-SSH连接到我的共享服务器,但是每次使用下面的错误消息获取超时错误。此错误仅在VS Code Remote-SSH中发生,当使用另一个客户端(Putty,Termius)时,连接工作正常。
请注意:这是一个共享服务器,我可以访问SSH,但没有sudo特权,并且通过端口1394进行连接。此外,弹出的错误通知最终显示为Could not fetch remote environment。由于它在Putty中运行良好,我最好的猜测是在VS代码中有一些设置是我需要调整的。感谢你的洞察力。
[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?发布于 2021-02-23 06:48:27
编辑 /etc/ssh/sshd_config
vi /etc/ssh/sshd_config将 AllowTcpForwarding改为yes
AllowTcpForwarding = yes重启 sshd
systemctl restart sshdhttps://stackoverflow.com/questions/64941796
复制相似问题