VSCode 配置阿里云CentOS 7.6 远程开发

配置步骤

1、windows 10 开发机配置

windows 10 1809后支持ssh命令linux

一、生成ssh密钥。使用如下命令,先生成本地公钥和私钥
ssh-keygen -t rsa -b 4096
执行完后,本地用户文件夹【C:\Users\用户名.ssh】会生成 id_rsa 和 id_rsa.pub 两个文件,分别对应 私钥 和 公钥。windows

2、linux服务器配置

一、将windows开发机上生成的 id_rsa.pub 公钥文件内容,追加到 linux 上 /root/.ssh/authorized_keys 文件内
二、开启ssh登陆
参考连接:https://www.jianshu.com/p/4d83d8ecd192
三、windows 10开发机验证登录
ssh root@[IP地址]
如图所示,表示登陆成功
image.png服务器

3、VS Code 配置
一、插件安装
image.pngssh

二、添加主机配置文件,并进行远程链接开发
image.pngpost

配置文件如图所示。右键左边的主机列表,点击 链接主机 选项
image.png.net

三、此时会新打开一个命令行界面,在linux服务器上自动安装vscode远程开发服务
image.png插件

四、配置完成命令行

参考连接

vscode官方文档

https://code.visualstudio.com/docs/remote/troubleshooting#_configuring-key-based-authentication
3d

其余参考文档

http://www.javashuo.com/article/p-ohgbybtb-gq.html
https://xirikm.net/2019/619-1
https://yq.aliyun.com/articles/711865code

相关文章
相关标签/搜索