首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VSCode Remote SSH连接失败

VSCode Remote SSH连接失败
EN

Stack Overflow用户
提问于 2020-03-03 20:52:55
回答 7查看 16.2K关注 0票数 7

我正在尝试使用Remote-SSH扩展来编辑Debian服务器上的文件。SSH连接已正确建立,但随后我收到错误消息:

代码语言:javascript
复制
Failed to connect to the remote extension host server

和日志:

代码语言:javascript
复制
[13:19:04.182] Remote server is listening on port 51569
[13:19:04.182] Parsed server configuration: {"agentPort":51569,"osReleaseId":"debian","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","tmpDir":"/tmp"}
[13:19:04.184] Starting forwarding server. localPort 59828 -> socksPort 59825 -> remotePort 51569
[13:19:04.185] Forwarding server listening on 59828
[13:19:04.185] Waiting for ssh tunnel to be ready
[13:19:04.186] Tunneled remote port 51569 to local port 59828
[13:19:04.186] Resolved "ssh-remote+home-debian.web-data.host" to "127.0.0.1:59828"
[13:19:04.187] [Forwarding server 59828] Got connection 0
[13:19:04.195] ------
[13:19:04.208] [Forwarding server 59828] Got connection 1
[13:19:04.208] [Forwarding server 59828] Got connection 2
[13:19:04.217] Failed to set up socket for dynamic port forward to remote port 51569: Socket closed. Is the remote port correct?
[13:19:04.227] > channel 3: open failed: administratively prohibited: open failed
[13:19:04.235] Failed to set up socket for dynamic port forward to remote port 51569: Socket closed. Is the remote port correct?
[13:19:04.237] Failed to set up socket for dynamic port forward to remote port 51569: Socket closed. Is the remote port correct?
[13:19:04.241] > channel 4: open failed: administratively prohibited: open failed
> channel 5: open failed: administratively prohibited: open failed

我正在其他几个服务器上使用远程ssh连接,并且从来没有出现过这个错误。我已经测试了从网络上收集到的一些东西,但到目前为止都没有起作用。

有人能告诉我这个问题的原因或可能的解决方案吗?谢谢!

EN

回答 7

Stack Overflow用户

发布于 2020-05-21 14:23:45

代码语言:javascript
复制
Delete '~/.vscode-server' folder on your server, and try reconnect.

不确定是否适用于Debian服务器,但这在Ubuntu 18.04上有效

票数 11
EN

Stack Overflow用户

发布于 2020-07-23 18:51:07

在sshd_config中将AllowTcpForwardingno更改为yes,然后重新启动sshd

Raspbian GNU/Linux 10 (buster)上测试

票数 7
EN

Stack Overflow用户

发布于 2021-08-17 10:22:39

请按照以下步骤操作

  1. 更新主机中的sshd_config文件,然后将主机上的ssh设置为yes
  2. Restart ssh,然后再次通过VS
  3. 连接主机rm -rf /home/<user_name>/.vscode-server
  4. Now中的.vscode-server。希望它能工作
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60507713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档