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 22 redis集群搭建
linux·运维·ubuntu
小猪写代码2 小时前
Ubuntu 文件权限管理
linux·ubuntu
jzzy_hony4 小时前
移植Qt4.8.7到ARM40-A5
qt·ubuntu·arm·终端
davenian7 小时前
< 自用文 OS 有关 > (续)发现正在被攻击 后的自救 Fail2ban + IPset + UFW 工作流程详解
ubuntu·bash·fail2ban·ipset
阿贤Linux8 小时前
设置网卡名称为传统命名方式
linux·ubuntu
GoodG_study10 小时前
windows通过xrdp远程连接Ubuntu黑屏问题解决
linux·ubuntu
一张假钞10 小时前
Windows 11主机Ubuntu 24.04虚机共享目录权限问题
linux·运维·ubuntu
GoodG_study10 小时前
一文教您解决win11运行Ubuntu,wsl相关命令出现系统找不到指定文件的错误提示
linux·ubuntu·wsl
daizhe12 小时前
Mac M4环境下基于VMware Fusion虚拟机安装Ubuntu24.04 LTS ARM版
ubuntu·macos