使用“远程SSH";在仅允许入站SSH连接的目标计算机上的VSCode中 [英] Using "Remote SSH" in VSCode on a target machine that only allows inbound SSH connections

查看:236
本文介绍了使用“远程SSH";在仅允许入站SSH连接的目标计算机上的VSCode中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用VSCode远程SSH扩展与不允许出站Internet连接的远程主机进行交互?

Is there a way to use the VSCode Remote SSH extension to interact with a remote host that does not allow outbound internet connections?

是否可以从另一个系统下载vscode-server文件并将其复制到主机?

Is it possible to download the vscode-server files from another system and copy to host?

我阅读了

I read this but I can't connect the server to internet.

推荐答案

当您连接到主机时,它会执行bash脚本,该脚本会获取或卷曲tarball并将其解压缩到主目录中的目录中.这是一个离线解决方法.

When you connect to a host it executes a bash script that wgets or curls a tarball and extracts it in a directory in your home directory. Here's an offline workaround.

  1. 尝试连接,让它失败
  2. 在服务器上,获取提交ID

  1. Attempt to connect, let it fail
  2. On server, get the commit id

$ ls ~/.vscode-server/bin
553cfb2c2205db5f15f3ee8395bbd5cf066d357d

  • 下载tarball,将$ COMMIT_ID替换为上一步中的提交编号 https://update.code.visualstudio.com/commit :$ COMMIT_ID/server -linux-x64/stable

  • Download tarball replacing $COMMIT_ID with the the commit number from the previous step https://update.code.visualstudio.com/commit:$COMMIT_ID/server-linux-x64/stable

    将tarball移动到〜/.vscode-server/bin/$ COMMIT_ID/vscode-server-linux-x64.tar.gz

    Move tarball to ~/.vscode-server/bin/$COMMIT_ID/vscode-server-linux-x64.tar.gz

    在此目录中提取tarball

    Extract tarball in this directory

    $ cd ~/.vscode-server/bin/$COMMIT_ID
    $ tar -xvzf vscode-server-linux-x64.tar.gz --strip-components 1
    

  • 重新连接

  • Connect again

    您仍然需要手动安装所有扩展.市场上所有扩展旁边都有一个下载按钮.拥有.vsix文件后,您可以使用扩展管理器中的从VSIX安装选项通过GUI安装它们.

    You'll still need to install any extensions manually. There's a download button next to all the extensions in the marketplace. Once you have the .vsix file you can install them through the GUI with the Install from VSIX option in the extensions manager.

    这是一种痛苦,希望他们可以改善此过程,但是如果您有基于网络的主目录,则只需执行一次.

    This is kind of a pain and hopefully they improve this process, but if you have a network-based home directory, you only have to do this once.

    这篇关于使用“远程SSH";在仅允许入站SSH连接的目标计算机上的VSCode中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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