Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh 将Visual Studio代码连接到Codeanywhere容器_Ssh_Visual Studio Code_Codeanywhere - Fatal编程技术网

Ssh 将Visual Studio代码连接到Codeanywhere容器

Ssh 将Visual Studio代码连接到Codeanywhere容器,ssh,visual-studio-code,codeanywhere,Ssh,Visual Studio Code,Codeanywhere,我在任何地方都使用代码。云IDE还可以,但我更愿意使用VisualStudio代码。因为我在一台没有管理员权限的工作计算机上,所以我有一个可移植版本的VisualStudio代码,我想用它连接到CodeAnywhere容器。我发现了几个扩展,可以让您通过ssh挂载文件夹。它们是SSH-FS和FS-Remote。但我不知道如何连接。有人有这方面的经验吗?或者知道远程托管容器并使用VSC代码连接的其他方法吗?谢谢以下是Mac电脑的说明 设置SSH密钥 打开一个终端 运行命令生成SSH密钥:SSH k

我在任何地方都使用代码。云IDE还可以,但我更愿意使用VisualStudio代码。因为我在一台没有管理员权限的工作计算机上,所以我有一个可移植版本的VisualStudio代码,我想用它连接到CodeAnywhere容器。我发现了几个扩展,可以让您通过ssh挂载文件夹。它们是SSH-FS和FS-Remote。但我不知道如何连接。有人有这方面的经验吗?或者知道远程托管容器并使用VSC代码连接的其他方法吗?谢谢

以下是Mac电脑的说明

设置SSH密钥

  • 打开一个终端
  • 运行命令生成SSH密钥:SSH keygen-t rsa
  • 按enter键接受保存密钥的默认位置
  • 当提示输入密码短语时,按enter键两次
  • 复制公钥:pbcopy<~/.ssh/id\u rsa.pub
  • 在Codeanywhere容器上打开SSH会话
  • 将复制的公钥粘贴到容器上的文件~/.ssh/authorized_keys
  • 收集容器信息

  • 右键单击容器并选择Info
  • 您将获得一个专门针对您的容器(如主机和端口)的信息页面
  • 设置Visual Studio代码

  • Microsoft为Visual Studio代码安装远程SSH扩展
  • 单击VSC左下角的按钮,将打开带有远程SSH选项列表的命令选项板
  • 选择打开配置文件…
  • 选择要编辑的ssh配置文件,例如/Users/username/.ssh/config
  • 添加以下内容,但请填写容器的信息:
  • 保存并退出配置文件
  • 再次打开远程SSH的命令调色板,并选择连接到主机
  • 有时我会使用扩展名,但仅用于访问和修改少数服务器上的一些文件。我不确定您是否能够使用它连接到您的容器,因为这个扩展只是通过SSH挂载一个远程文件夹作为本地工作区文件夹。
    Host Codeanywhere
        HostName hostXX.codeanyhost.com
        User cabox
        Port 12345
        IdentityFile ~/.ssh/id_rsa