VSCODE使用WSL SSH配置和身份?

发布于 2025-01-27 17:26:08 字数 616 浏览 3 评论 0原文

我在Windows 10和11上使用WSL2来完成所有SSH的操作,但我希望能够在我的VSCODE中使用WSL的WSL2 SSH Config + Identity + Agent。

看到了一些用以下内容之一的单独的ssh.bat的方法

c:\ windows \ system32 \ wsl.exe bash -login -c ssh%* C:\ Windows \ System32 \ wsl.exe bash -ic'ssh%' C:\ Windows \ System32 \ wsl.exe SSH%

在远程.ssh.path中带有ssh.bat beeing。

我唯一能找到的错误是,但是我很确定它以前有效:

[14:18:34.726]从SSH出现错误 “ c:\用户< user> \ documents \ ssh.bat” enoent [14:18:34.727] 指定的路径“ c:\ users<用户> \ documents \ ssh.bat”不是有效的SSH 二进制

似乎没有任何作用。由于某种原因,它不使用WSL SSH。 有什么想法吗?

I'm using WSL2 on Windows 10 and 11 to do all of my ssh stuff but I'd like to be able to use the wsl2 ssh config + identity + agent from wsl within my VSCode.

Saw some approaches with a seperate ssh.bat with one of the following contents

C:\Windows\system32\wsl.exe bash --login -c ssh %*
C:\Windows\system32\wsl.exe bash -ic 'ssh %'
C:\Windows\system32\wsl.exe ssh %

With the ssh.bat beeing in the remote.SSH.Path.

The only error i could find was this but im pretty sure it worked like this before:

[14:18:34.726] Got error from ssh: spawn
"C:\Users<USER>\Documents\ssh.bat" ENOENT [14:18:34.727] The
specified path "C:\Users<USER>\Documents\ssh.bat" is not a valid SSH
binary

Nothing seemed to work. For some reason it does not use the wsl ssh.
Any Ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

睡美人的小仙女 2025-02-03 17:26:08

这条路

C:\Users<USER>\Documents\ssh.bat

缺少后斜线。应该是

C:\Users\<USER>\Documents\ssh.bat

The path

C:\Users<USER>\Documents\ssh.bat

is missing a backslash. It should be

C:\Users\<USER>\Documents\ssh.bat
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文