VS Code 设置免密登陆Linux

视频教程链接:为VS Code配置ssh免密登陆Linux服务器_哔哩哔哩_bilibili

1.在win主机生成rsa公私钥

ssh-keygen

2.生成的公钥就是需要上传至Linux主机的密钥

id_rsatest1.pub

3.开启Linux服务器,安装ssh server

sudo apt install openssh-server

4.Linux服务器ip地址使用ip a命令查询,开头en的就是

ip a

ens33

192.168.116.134

5.创建authorized_keys,添加2中的公钥,保存

vim authorized_keys

6.在VS Code中安装remote ssh插件

7.添加Linux服务器主机,添加ssh私钥文件

  IdentityFile "C:\Users\11405\.ssh\id_rsatest1"

8.连接Linux服务器,此时已配置好免密登陆Linux服务器

猜你喜欢

转载自blog.csdn.net/qq_41575489/article/details/126012099