通过 VSCode 远程连接服务器运行代码
首先,不建议使用 win10 内置的 ssh,因为 VSCode 使用内置的 ssh 连接服务器总是有问题,建议下载安装 git,使 VSCode 通过 git 自带的 ssh 连接服务器。
第一步
在环境变量中将 win10 内置 SSH 的路径替换为 git 的
这是原本环境变量中路径,将其删除
%SYSTEMROOT%\System32\OpenSSH\
将电脑上 git 中 ssh 的路径,添加到环境变量(Path)中
C:\Software\Git\usr\bin
第二步
在 git 终端中,输入以下命令生成公钥和私钥
ssh-keygen -t rsa -C "your_email@example.com"
"your_email@example.com"邮箱干嘛用的
The email is only optional field to identify the key.
邮箱仅仅是识别用的key
When you create the ssh you type (for example):
ssh-keygen -t rsa -C “any comment can be here”
当你创建ssh的时候
-t = The type of the key to generate
密钥的类型
-C = comment to identify the key
用于识别这个

本文介绍了如何通过VSCode远程连接服务器运行代码,解决win10内置SSH问题,使用git SSH,生成并配置公钥私钥,安装Remote Development插件,以及处理常见连接问题。
最低0.47元/天 解锁文章
3050

被折叠的 条评论
为什么被折叠?



