我正在尝试使用VSCode-Insiders使用Remote-SSH插件在远程AWS机器的docker容器上运行代码。我已经打开了一个终端,并像这样设置了端口转发:ssh -L 2201:localhost:2222 user@host -N -i ~/.ssh/id_rsa。然后在VSCode中,我尝试连接到root@localhost它并启动,但随后给了我一条错误消息:
> Found existing installation...
> Found running server...
>
> bash: no job control in this shell
"install" terminal command done
Received install output: bash: no job control in this shell
Failed to parse remote port from server output: bash: no job control in this shell
Run Code Online (Sandbox Code Playgroud)
我从几天前开始执行此过程,并且有效。昨天它进进出出了一点,而今天却根本不起作用。我尝试将其关闭然后再打开,但是无法正常工作。如果需要的话,我在装有Mojave OS的MacOS上。
编辑:
神奇的是,它今天(第二天)第一次起作用。我仍然有兴趣知道下次修复时如何解决。如果有帮助,这是工作时的输出:
SSH Resolver called for "ssh-remote+7b22686..."
SSH Resolver called for host: root@localhost
Setting up SSH remote "localhost"
Using commit id …Run Code Online (Sandbox Code Playgroud) 我有一个多阶段的 Dockerfile。我想配置 VS Code Remote 来构建 Dockerfile 的 dev 阶段,而不是 Dockerfile 中的最后一个阶段。
我很确定这个配置会出现在 .devcontainer.json 文件中。我已经通读了 .devcontainer.json 参考:https ://code.visualstudio.com/docs/remote/containers#_devcontainerjson-reference并尝试过runArgs,但这些是运行时参数,而不是构建参数。
我试过这个:
{
"dockerFile": "Dockerfile",
"extensions": ["ms-python.python"],
"runArgs": [
"--target",
"dev"
]
}
Run Code Online (Sandbox Code Playgroud)
和:
{
"dockerFile": "Dockerfile",
"extensions": ["ms-python.python"],
"buildArgs": [
"--target",
"dev"
]
}
Run Code Online (Sandbox Code Playgroud)
当我使用时runArgs,我得到了Failed: Starting the development container因为target不是一个docker run选项。当我尝试时buildArgs,该参数显然被忽略了,这是有道理的,因为它没有在文档中列出。
我有一个在 jumpbox 后面运行 Ansible 的 RHEL“开发”服务器。
我需要使用 VS Code Remote - SSH 扩展从 Windows 10 机器连接到 RHEL 服务器以进行 Ansible 开发工作。我正在将 Git Bash 用于 SSH/*nix 的东西。
Jumpbox 禁用了 SSH 端口转发 - 据我所知,它将保持禁用状态。
我已将agent-forwarding公钥复制到 jumpbox 和 RHEL 服务器。因此,我可以使用 SSH 代理转发通过 jumpbox 连接到 RHEL 服务器。
这是我的 SSH 配置文件的样子。
Host *
ForwardAgent yes
# Jump box
Host jump-box
HostName xx.xx.xx.xx
User test_user
IdentityFile ~/.ssh/agent-forwarding
# RHEL server
Host rhel-dev
HostName xx.xx.xx.xx
User test_user
IdentityFile ~/.ssh/agent-forwarding
Run Code Online (Sandbox Code Playgroud)
使用此 SSH 配置,从 VS Code,我使用Remote-SSH: Connect …
我想让服务器始终运行 Live Share,这样我就不必总是让计算机打开 VSCode 窗口来保持 Live Share 处于活动状态。我尝试通过 Remote-SSH 扩展在我的服务器上运行 Live Share,但是,当我关闭窗口时,Live Share 将与 Remote-SSH 会话一起关闭。
是否可以始终在我的服务器上运行 Live Share?
所以我在 VSCode 中使用“Remote - SSH”插件连接到我的 VPS 并编辑我的代码。我失去了连接,然后在 30 分钟以上后不得不硬重置它。现在我无法再使用 VSCode 访问它 [腻子工作] 并获得Could not establish connection to "[vps-ip]". Permission denied (publickey,password).在 ssh up 中启动 VSCode 或重新加载连接时获取。
我也每次都得到这个日志。
我该怎么做才能让它再次正常工作?
这是我用 [...] 替换了一些东西的日志
[18:42:52.792] Log Level: 2
[18:42:52.795] remote-ssh@0.50.0
[18:42:52.795] win32 x64
[18:42:52.797] SSH Resolver called for "ssh-remote+[vps-ip]", attempt 1
[18:42:52.797] SSH Resolver called for host: [vps-ip]
[18:42:52.798] Setting up SSH remote "[vpsip]"
[18:42:52.801] Acquiring local install lock: C:\Users\[myname]\AppData\Local\Temp\vscode-remote-ssh-[vps-ip]-install.lock
[18:42:52.816] Looking for existing server data file at c:\Users\[myname]\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-[vps-ip]-[id]\data.json
[18:42:52.817] Using …Run Code Online (Sandbox Code Playgroud) 我已成功连接到 VS Code 中的 ssh 服务器Remote-SSH。我可以将 VS Code 终端附加到服务器上正在运行的容器,但无法将 VS Code 编辑器本身附加到正在运行的容器。
当我尝试执行时Attach Visual Studio Code,它显示没有正在运行的容器。如何将 VS Code 指向在远程服务器上运行的容器列表?
VSCODE SSH 扩展 GIT 拉/同步不起作用,它挂起。
1.Install SSH-Extension
2. Connect to SSH Host -
3. Open existing git Repo from remote server which is cloned from our internal git server with ssh URL using RSA Key pair without passphrase
4. run git sync from git menu or git pull from a terminal. This doesn't finish
Run Code Online (Sandbox Code Playgroud)
我正在尝试在 Windows 2010 笔记本电脑上设置远程 SSH 开发。
我可以使用密钥对从开发服务器和笔记本电脑使用 ssh 访问我们的内部 git 服务器。
我是笔记本电脑和服务器的管理员,并确保 ssh 和本地 git 正常工作,在笔记本电脑和服务器上使用 SSH 从我们的 git 服务器克隆 repo,并分别从笔记本电脑和服务器成功运行 git pull 和 git push。 …
当使用 VS Code 远程 SSH 连接到远程机器时,此操作始终会打开一个新的 VS Code 窗口。有没有办法改变这种行为以使用现有的打开窗口?谢谢
我正在尝试使用远程 SSH 从我的 Windows 10 机器连接到我的 Ubuntu Linux 服务器 (16.04.6)。为此,我阅读了许多不同的教程,但都没有成功。
我可以通过 ssh 从我的 Windows 10 命令提示符连接到 Ubuntu Linux 服务器,没有任何问题。我什至使用 ssh-keygen 生成私钥和公钥,并将公钥复制到 Linux 服务器 (.ssh) 上的相应目录。
在 VsCode 中,我安装了扩展 Remote-SSH 将我的主机添加到我的配置文件 c:\user.ssh\config:
Host <ip-address>
HostName <ip-address>
User <username>
Run Code Online (Sandbox Code Playgroud)
然后我在 VSCode 中单击左下角的按钮“打开远程窗口”并选择了我的主机。一个新窗口打开,VSCode 正在尝试连接。然后我看到一个带有错误消息的窗口:“无法建立与 的连接。连接被取消”。这是日志。
[11:53:17.573] Log Level: 2
[11:53:17.582] remote-ssh@0.51.0
[11:53:17.583] win32 x64
[11:53:17.586] SSH Resolver called for "ssh-remote+<ip-address>", attempt 1
[11:53:17.587] SSH Resolver called for host: <ip-address>
[11:53:17.587] Setting up SSH remote "<ip-address>"
[11:53:17.648] Using commit id "5763d909d5f12fe19f215cbfdd29a91c0fa9208a" and quality "stable" …Run Code Online (Sandbox Code Playgroud) 我喜欢 VS Code 的一点是,当我在 WSL 中使用终端时,我可以运行code file.txt,并且它将使用 WSL 远程扩展在我的本地使用 VS Code 打开该文件。
是否可以用 SSH 做类似的事情?即,如果我code file.txt通过 SSH 连接到远程主机,是否可以进行设置,以便运行将在我的本地计算机上打开 VS Code,通过远程 SSH 扩展连接来打开该文件?