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

相关推荐
在肯德基吃麻辣烫8 小时前
Netdata在Ubuntu环境下的安装与配置:构建实时系统监控与性能分析平台
linux·运维·ubuntu
LunarCod10 小时前
Ubuntu使用Docker搭建SonarQube企业版(含破解方法)
linux·运维·服务器·ubuntu·docker·开源·sonarqube
南棱笑笑生14 小时前
20250512给NanoPi NEO core开发板在Ubuntu core20.04系统更新boot.img
linux·运维·ubuntu
xiaobin8899919 小时前
【2025最新版】VMware虚拟机下载安装教程 保姆级图文详解(附安装包+常用镜像Linux,win11,ubuntu,centos)
linux·其他·ubuntu·centos
ALex_zry20 小时前
Ubuntu 20.04 C++开发环境搭建指南(2025版)
linux·c++·ubuntu
Eric.Lee20211 天前
Ubuntu shell指定conda的python环境启动脚本
python·ubuntu·conda·shell
dubochao_xinxi2 天前
✅ TensorRT Python 安装精简流程(适用于 Ubuntu 20.04+)
开发语言·python·ubuntu
yangshuo12812 天前
风车OVF镜像:解放AI开发限制的Ubuntu精简系统
linux·人工智能·ubuntu
flypig哗啦啦2 天前
ubuntu服务器版启动卡在start job is running for wait for...to be Configured
linux·运维·ubuntu
子非衣2 天前
Ubuntu系统挂载磁盘并配置开机自动挂载
linux·运维·ubuntu