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协同工作

相关推荐
问简3 小时前
Ubuntu 26 + Windows 10 双系统 NTFS 共享盘笔记
ubuntu
pilifeng15 小时前
Ubuntu Linux 目录结构详解
linux·ubuntu
李小白杂货铺8 小时前
从 macOS 免密 SSH 到 Windows 10 完整配置指南
windows·win10·openssh·踩坑·ssh服务器·免密连接·安装和配置
daemon.qiang19 小时前
国内虚拟机对接 Freedesktop:Fork xserver、自建 Runner 与提交 MR 实战
linux·ubuntu·centos·gitlab·开源软件
orange....1 天前
VMware 双网卡配置:宿主机切换网络时 Ubuntu 固定 IP 访问方案
网络·ubuntu·网络安全
园长的牧歌1 天前
Ubuntu 打开应用在导航栏没有图标是个齿轮
linux·ubuntu
牢姐与蒯1 天前
Linux进程间通信(一).进程间通信概念&&环境切换(着重强调vscode)
linux·运维·服务器·ubuntu
指尖的爷2 天前
【地狱级难度】ubuntu系统GOCV编译安装
linux·运维·ubuntu
j7~2 天前
【C++微服务项目开发脚手架】(环境篇)虚拟机 + Docker + MySQL/Redis/RabbitMQ/ES/etcd/FastDFS 全套配齐
linux·c++·ubuntu·docker·vmware·项目开发·微服务脚手架
可涵不会debug2 天前
公司外怎么连接管家婆?从 SQL Server 安装到 cpolar 固定 TCP 远程登录
linux·运维·ubuntu