Ubuntu18.4创建共享文件夹并支持Windows访问

Ubuntu 和Windows操作系统间可以通过创建共享目录,来进行数据、文件等资源的共享、读写等操作。下面介绍下如何实现在Ubuntu下创建共享目录,然后在windows 下进行该文件夹的访问和读写。

Ubuntu18.4创建共享文件夹并支持Windows访问

准备工作,Ubuntu18.04设置连接网络,使虚拟机下的Ubuntu18.04可以上网

参考https://blog.****.net/smartvxworks/article/details/107928925

Ubuntu安装samba工具

使用命令apt install samba安装samba服务

Ubuntu18.4创建共享文件夹并支持Windows访问

创建共享文件夹并设置访问属性

  1. 本文以Home目录进行事例讲解,所以先进入Home目录, 鼠标右键新建一个文件夹。

    Ubuntu18.4创建共享文件夹并支持Windows访问

  2. 命名该文件夹(ShareFolder)后右键该文件夹,在快捷菜单中点击属性(Properties)

    Ubuntu18.4创建共享文件夹并支持Windows访问

  3. 3

    在弹出的对话框中点局域网共享(Local Network Share)一项

    Ubuntu18.4创建共享文件夹并支持Windows访问

  4. 4

    开启所有列出项功能 - 分享,允许创建、删除、允许游客访问,点击创建分享(Create Share)。

    Ubuntu18.4创建共享文件夹并支持Windows访问

  5. 5

    在权限确认对话框中选择自动添加权限,然后点击close关闭对话框即可。

    Ubuntu18.4创建共享文件夹并支持Windows访问

    END

测试访问共享目录进行读写操作

  1. 在ShareFolder中新建一个测试文件,以供访问测试使用

    Ubuntu18.4创建共享文件夹并支持Windows访问

  2. 进入Windows系统,打开文件夹或我的电脑,在地址栏中输入你的Ubuntu IP地址,然后点击回车键即可进入Ubuntu共享目录。

    Ubuntu18.4创建共享文件夹并支持Windows访问

  3. 双击ShareFolder, 即可看到前几部创建的test文件

    Ubuntu18.4创建共享文件夹并支持Windows访问

  4. 右键该文件,可以看到该文件支持读写操作。

    Ubuntu18.4创建共享文件夹并支持Windows访问

在Windows下创建网络位置可以快捷访问Ubuntu18.4创建共享文件夹

1.在此电脑下面的空白处,鼠标右键,添加一个网络位置(L),跳出:添加网络配置向导

Ubuntu18.4创建共享文件夹并支持Windows访问

2.点击下一步(N),跳出:选择自定义网络位置

Ubuntu18.4创建共享文件夹并支持Windows访问

3.点击下一步(N),跳出:指定网络的位置

Ubuntu18.4创建共享文件夹并支持Windows访问

4.输入\\192.168.1.188\linux-sdk,点击下一步(N)

Ubuntu18.4创建共享文件夹并支持Windows访问

5.点击下一步(N)

Ubuntu18.4创建共享文件夹并支持Windows访问

6.点击完成

Ubuntu18.4创建共享文件夹并支持Windows访问

7.此时在此电脑下的网络位置可以看到Ubuntu18.4共享的linux_sdkUbuntu18.4创建共享文件夹并支持Windows访问

Ubuntu18.4创建共享文件夹并支持Windows访问

在windows下添加映射网络驱动器,将Ubuntu18.4共享的linux_sdk以磁盘的方式映射到Windows下

1.开始位置输入\\192.168.1.188\linux-sdk,并点击确认,跳出如下,网络位置:192.168.1.188

Ubuntu18.4创建共享文件夹并支持Windows访问

2.点击192.168.1.188,出现如下:

Ubuntu18.4创建共享文件夹并支持Windows访问

3.鼠标右键点击Ubuntu18.4创建共享文件夹并支持Windows访问,选择映射网络驱动器(M),出现如下

Ubuntu18.4创建共享文件夹并支持Windows访问

4.选择 未被使用的盘符F,并点击完成

Ubuntu18.4创建共享文件夹并支持Windows访问

5.此时看到linux-sdk以盘符形式存在在此电脑下的网络位置:linux-sdk (\\192.168.1.188)(F:)

Ubuntu18.4创建共享文件夹并支持Windows访问