vscode 远程支持双 ssh 吗? [英] Does vscode remote support double ssh?

查看:61
本文介绍了vscode 远程支持双 ssh 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a gpu-server Server-A in office. The only way to access that server is through the office wired network. The office provides a proxy server Server-B. How I connect to the Server-B? I first ssh login Server-B, then in the bash of Server-B, ssh login Server-A. I want to use vscode remote extension to work for Server-A. How can I do? I can connect to Server-B now in vscode.

推荐答案

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

After several days struggling, I have figure it out. As Marc said, vscode respects the tunnels I setup in my .ssh/config file. A sample can be like :

Host server1
HostName server1_ip
PreferredAuthentications publickey
IdentityFile your_key
User you

Host server2
Hostname server2_ip
IdentityFile your_key
ProxyJump server1
User you

这篇关于vscode 远程支持双 ssh 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆