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

一、为什么安装samba

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

二、ubuntu换软件源

打开终端,备份原来的源

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

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

bash 复制代码
sudo vim /etc/apt/sources.list

加入以下阿里源

bash 复制代码
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

输入命令更新源

bash 复制代码
sudo apt-get update

输入命令更新软件

bash 复制代码
sudo apt-get upgrade

ubuntu20.04如何更换国内源

三、安装samba
bash 复制代码
sudo apt-get install samba samba-common
四、配置samba

先备份

bash 复制代码
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

编辑

bash 复制代码
sudo vim /etc/samba/smb.conf

在文件最后添加

bash 复制代码
[csf]
comment = csf home directory
path = /
public = yes
browseable = yes
writeable = yes

意思是把整个根目录共享

然后重启samba服务

bash 复制代码
sudo systemctl restart smbd
五、win10访问ubuntu目录


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

相关推荐
人工智能训练1 小时前
在ubuntu系统中如何将docker安装在指定目录
linux·运维·服务器·人工智能·ubuntu·docker·ai编程
qing222222225 小时前
Ubuntu设置程序开机自启动:基于.service文件实现
linux·运维·ubuntu
lxmyzzs8 小时前
在使用 `resolvconf` 的 Ubuntu 系统上持久化 DNS 设置
linux·运维·ubuntu
老黄编程21 小时前
02-ubuntu24.04证书体系架构及证书有关配置文件、工具详细介绍
ubuntu·数字证书
catoop21 小时前
在 Windows 中基于 WSL 子系统 Ubuntu 安装配置 conda 示例
windows·ubuntu·conda
老黄编程21 小时前
03-gpg(证书管理 )详细范例
linux·运维·ubuntu·数字证书
莱茶荼菜1 天前
Ubuntu 20.04 系统库管理详细教程
linux·运维·ubuntu
xiaotao1311 天前
unity hub在ubuntu 22.0.4上启动卡住
ubuntu·unity·游戏引擎
David.K1 天前
记录:win10环境手动编译tcl源码过程
windows·环境·win10·tcl·tcl环境搭建
大大da怪i1 天前
WSL-Ubuntu忘记root密码,修改root密码
linux·ubuntu