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

相关推荐
DjangoJason3 小时前
操作系统 :进程概念
linux·笔记·ubuntu
GISer_Jing3 小时前
前端常问的宏观“大”问题详解(二)
linux·前端·ubuntu
Learn-Share_HY14 小时前
[Python]如何利用Flask搭建一個Web服務器,並透過Ngrok訪問來實現LINE Bot功能?
linux·人工智能·python·ubuntu·flask·ollama·ngrok
Levin__NLP_CV_AIGC16 小时前
Nvidia Driver英伟达驱动安装-Ubuntu-CUDA
linux·运维·ubuntu·计算机视觉·自然语言处理
编程就是如此16 小时前
Ubuntu桌面环境下网络设置选项缺失问题解决
网络·ubuntu
noravinsc16 小时前
ubuntu如何安装conda
linux·ubuntu·conda
手打猪大屁1 天前
Ubuntu和Windows实现文件互传
linux·windows·ubuntu
Hey! Hey!1 天前
Ubuntu与CentOS操作指令的主要区别详解
linux·ubuntu·centos
encoding-console1 天前
Centos与Ubuntu系统的对比分析
linux·ubuntu·centos
Strugglingler1 天前
【VirtualBox 安装 Ubuntu 22.04】
ubuntu·虚拟机·vitrualbox