当前位置:网站首页>vscode使用remote-ssh连接以及连接失败的解决方法
vscode使用remote-ssh连接以及连接失败的解决方法
2022-07-27 09:17:00 【黄昏贩卖机】
Step 1 Remote-SSH 安装和基础配置
首先安装vscode插件
安装完成后,点击vscode左下角图标(下图绿色部分)

打开 ssh 配置文件

选择.ssh\config

向配置文件中添加要连接的主机的配置信息
这里的演示是通过私钥登录的,关于创建私钥和公钥进行ssh连接的教程有很多
有许多ssh 免密登录的方法,配置完ssh免密登录后这里就不需要 IdentityFile 的信息了
Host 主机名
HostName 服务器地址
Port 端口号
User 用户名
IdentityFile 本机上私钥地址
Step 2 连接失败及其解决方法
我在使用私钥登陆的时候,出现如下问题,根本原因是因为密钥文件 id_rsa 的文件访问权限
如果在linux系统下,将id_rsa 文件的权限修改为 600,可以使用 sudo chmod -R 600 filename 完成
如果是在windows系统下就稍微麻烦点
将其权限修改为如下情况即可

具体操作方法为,密钥文件右键 ->属性 -> 安全 -> 高级 -> 禁用继承 ->从此对象中删除所有已继承的权限 -> 应用,将权限全部清空。
这样,我们再次打开属性->安全 ,查看时组或用户名权为空,
回到属性->安全->高级-> 添加 -> 选择主体->高级-> 立即查找

选择后确定。
这样权限就修改完成了。
再次尝试连接

成功连接后,可以选择打开远程目录中的文件或文件夹,也可以选择打开本地文件或文件夹

如果有问题解决不了,欢迎留言!
边栏推荐
- C# 窗体应用常用基础控件讲解(适合萌新)
- 一些实用、常用、效率越来越高的 Kubernetes 别名
- Ctfshow ultimate assessment
- SQL exercise set
- 基于restful页面数据交互
- [leetcode -- the second day of introduction to programming ability] operator (the number of bit 1 / the difference between the sum of the products of integers)
- [C language - zero foundation _ study _ review _ lesson 4] data types and operations
- QT uses SQLite to open multiple database files at the same time
- Intel, squeezed by Samsung and TSMC, finally put down its body to customize chip technology for Chinese chips
- Apple cut its price by 600 yuan, which was almost a devastating blow to the collapse of its domestic flagship mobile phone
猜你喜欢

Special exercises for beginners of C language to learn code for the first time

As a VC, the auction house invested Web3 for the first time

linux安装和远程连接mysql记录

pollFirst(),pollLast(),peekFirst(),peekLast()
![[C language _ study _ exam _ review lesson 3] overview of ASCII code and C language](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[C language _ study _ exam _ review lesson 3] overview of ASCII code and C language

Restful

NPM install error forced installation

Hard core structure, violent interpretation

软件测试功能测试全套常见面试题【功能测试-零基础】必备4-1

Mangodb简单使用
随机推荐
As a VC, the auction house invested Web3 for the first time
Five kinds of 2D attention finishing (non local, criss cross, Se, CBAM, dual attention)
Detailed explanation of two methods of Sqlalchemy
5G没能拉动行业发展,不仅运营商失望了,手机企业也失望了
Qt中发送信号时参数为结构体或者自定义的类怎么办?
async/await的执行顺序以及宏任务和微任务
ES6 new - string part
被三星和台积电挤压的Intel终放下身段,为中国芯片定制芯片工艺
二叉树遍历
C language exercise 2
拍卖行做VC,第一次出手就投了个Web3
500 error reporting
Mangodb simple to use
ArkUI中的显式动画
Antdesign a-modal user-defined instruction realizes dragging and zooming in and out
软件测试功能测试全套常见面试题【功能测试-零基础】必备4-1
5g failed to stimulate the development of the industry, which disappointed not only operators, but also mobile phone enterprises
【云原生之kubernetes实战】在kubernetes集群下部署Rainbond平台
Rewrite the tensorrt version deployment code of yolox
Summary of traversal methods