vscode 远程支持双 ssh 吗?

Qin*_*ang 13 ssh visual-studio-code vscode-remote

我在办公室有一个 gpu-server Server-A。访问该服务器的唯一方法是通过办公室有线网络。办公室提供代理服务器Server-B。我如何连接到 Server-B?我先ssh登录Server-B,然后在Server-B的bash中,ssh登录Server-A。我想使用 vscode 远程扩展来为 Server-A 工作。我能怎么做?我现在可以在 vscode 中连接到 Server-B。

Qin*_*ang 21

经过几天的挣扎,我已经弄清楚了。正如 Marc 所说,vscode 尊重我在 .ssh/config 文件中设置的隧道。一个示例可以是这样的:

Host server1
HostName server1_ip
PreferredAuthentications publickey
IdentityFile your_key
User you

Host server2
Hostname server2_ip
IdentityFile your_key
ProxyJump server1
User you
Run Code Online (Sandbox Code Playgroud)

  • 那么 1=B 和 2=A 吗?如果您使用问题中的名称,会更容易获得您的解决方案! (7认同)

小智 7

您是否考虑过在 ssh 配置中设置隧道以通过 Server-B 访问 Server-A?我相信 vscode 会尊重您在 .ssh/config 文件中设置的隧道。