欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 艺术 > ubuntu安装samba:win10直接访问ubuntu服务器的文件

ubuntu安装samba:win10直接访问ubuntu服务器的文件

2024/10/24 18:19:15 来源:https://blog.csdn.net/zhaotun123/article/details/142094897  浏览:    关键词:ubuntu安装samba:win10直接访问ubuntu服务器的文件
一、为什么安装samba

samba可以在ubuntu设置共享目录,从而使得同一局域网的win10可以直接访问该共享目录,非常方便,可以直接查看ubuntu服务器的图片或视频。

二、ubuntu换软件源

打开终端,备份原来的源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

如果显示 /etc/apt/sources.list 不存在,直接创建

sudo vim /etc/apt/sources.list

加入以下阿里源

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse focal

输入命令更新源

sudo apt-get update

输入命令更新软件

sudo apt-get upgrade

ubuntu20.04如何更换国内源

三、安装samba
sudo apt-get install samba samba-common
四、配置samba

先备份

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

编辑

sudo vim /etc/samba/smb.conf

在文件最后添加

[csf]
comment = csf home directory
path = /
public = yes
browseable = yes
writeable = yes

意思是把整个根目录共享

然后重启samba服务

sudo systemctl restart smbd
五、win10访问ubuntu目录

在这里插入图片描述
在这里插入图片描述

ubuntu 20.04 安装配置Samba服务,Windows 和 linux协同工作

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com