我可以在 Visual Studio 代码中从 WSL ssh 吗? [英] Can I ssh from WSL in visual studio code?

查看:59
本文介绍了我可以在 Visual Studio 代码中从 WSL ssh 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 windows 10 上使用 WSL 进行编程,最近发现可以通过 SSH 使用 VS code 编辑程序.

I am using WSL on windows 10 to program, and recently discovered that VS code can be used to edit programs through SSH.

但是,我通常通过 WSL SSH 连接到我大学的计算机,以便我可以访问这些系统上的文件并使用它们的 GPU.

However, I normally SSH into my university's computers through WSL so i can access the files on those systems and use their GPUs.

有什么方法可以使用 vscode SSH 到 WSL,然后 ssh 到我的大学系统,并从 vscode 中访问他们的资源和文件系统?

Is there any way to SSH into WSL using vscode, and then ssh into my universities systems, and have access to their resources and filesystems from with within vscode?

推荐答案

可以在windows下创建ssh.bat文件,内容如下:

You can create ssh.bat file under windows with the content:

C:\Windows\system32\wsl.exe ssh %*

然后设置 VS Code 设置remote.SSH.path";指向那个 bat 文件.
您将在 VS Code 中拥有与在 WSL 中相同的 ssh 配置和凭据.

And than set VS Code setting "remote.SSH.path" to point to that bat file.
You’ll have the same ssh configuration and credentials in VS Code as you have in WSL.

这篇关于我可以在 Visual Studio 代码中从 WSL ssh 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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