在VS Code上连接到远程服务器时如何跳转到IP地址?

问题描述 投票:0回答:1

我以前从未连接过远程服务器。我想连接到公司的远程服务器,然后跳转到另一个IP地址。

我遵循了VS代码指南here,并已连接到服务器,但是不确定如何跳转到IP地址。

有人可以帮我吗?非常感谢!

ssh visual-studio-code remote-server
1个回答
0
投票

我知道了。

我想连接到公司的专用服务器。为此,我必须连接到公司的主机服务器。当我在主机服务器中时,我必须连接到专用服务器(很抱歉,我的问题没有更清晰地表达出来)。

我将解决方案留在这里,以备将来参考。在VS Code中,执行F1(在Mac上为fn + F1)->远程SSH:连接到主机->配置SSH主机-> / Users //。ssh / config。

从那里,如下编辑配置文件:

Host <host-name>
  HostName <IP-address>
  Port <specify-port-number-here>
  User <user-name>

### The Remote Host
Host <private-server-name>
  HostName <IP-address>
  Port <specify-port-number-here>
  User <user-name>
  ProxyJump <host-name>

保存配置文件并通过F1连接到私有服务器->远程SSH:连接到主机->私有服务器名称

© www.soinside.com 2019 - 2024. All rights reserved.