VSCode用ssh连接ubuntu虚拟机实现远程访问文件夹

1. ubuntu安装ssh服务

1.1 安装

shell 复制代码
sudo apt-get install ssh
sudo apt-get install openssh-server

1.2 启动ssh服务

shell 复制代码
sudo service ssh start
sudo service ssh status # 查看状态
## 或者用下面方式重启ssh服务 ##
/etc/init.d/ssh restart

1.3 ssh服务加入开机启动

shell 复制代码
sudo systemctl enable ssh​

1.4 获取ubuntu ip地址

2. VSCode安装插件

2.1 安装Remote ssh插件

2.2 配置ssh文件

2.2.1 点击SSH后面的添加按钮

2.2.2 增加一个配置

2.2.3 打开配置文件并编辑

2.2.4 配置完成

保存配置文件并刷新,注意观察右下角会有连接进度

2.2.5 打开远程文件

连接后就可以打开我们想要访问的文件夹,连接的时候会提醒输入明码,我们按提示输入即可

参考链接:https://blog.csdn.net/m0_48418397/article/details/136920175

相关推荐
炸膛坦客10 小时前
Git 和 GitHub:(七)将本地新建仓库与 GitHub 远程仓库关联起来(SSH)
git·ssh·github
想你依然心痛16 小时前
从监控数据到告警管理:Prometheus与Alertmanager部署实战
ubuntu·prometheus·内网穿透·系统监控·cpolar·告警管理
黑白园18 小时前
解决服务器拒绝连接导致ubuntu镜像无法下载问题 https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/
ubuntu
yangpan01120 小时前
ubuntu输入法安装及选择
linux·运维·ubuntu
强里秋千墙外道20 小时前
Ubuntu 开机 Kernel Panic:HWE 内核升级失败 + NVIDIA DKMS 踩坑实录
linux·运维·ubuntu
啊啊啊迈 旋棍1 天前
【译】TypeScript 7 测试版已在 Visual Studio 2026 18.6 Insiders 3 中默认启用
ubuntu·typescript·visual studio
Yolanda_20221 天前
在vscode终端中可使用pip,但是cmd终端中找不到命令 pip问题的解决
vscode·python·conda·pip
Eloudy2 天前
ubuntu 22.04安装 cuda 12.8.2
linux·运维·ubuntu
π同学2 天前
ESP-IDF+vscode开发ESP32 联网篇第一讲——WIFI扫描
vscode·esp32c6·wifi scan
接针2 天前
Pycharm远程连接Ubuntu的conda环境
ubuntu·pycharm·conda