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

相关推荐
MIXLLRED1 分钟前
Ubuntu22.04 + ROS2 Humble + RealSense D435i 部署VINS-Fusion视觉惯性SLAM
ubuntu·slam·d435i·ros2·humble·vins
Gary Studio1 小时前
ubuntu 16.04一键换源
linux·运维·ubuntu
拾贰_C2 小时前
【node.js | Ubuntu | update】如何升级旧的nodejs本版至最新;如何升级npm
ubuntu·npm·node.js
有谁看见我的剑了?2 小时前
ubuntu 22.04 /etc/fstab 文件修改有误导致无法进入系统处理
linux·运维·ubuntu
天疆说3 小时前
Ubuntu 安装微软核心字体
ubuntu·microsoft·php
XX風3 小时前
三维点云处理环境相关-ubuntu安装numpy、open3d
linux·ubuntu·numpy
乌托邦的逃亡者3 小时前
Ubuntu主机中,为一个网卡设置多个IP地址
服务器·网络·ubuntu
Wmenghu5 小时前
Ubuntu 安装 MySQL 8.0 + Redis 并开启远程访问
redis·mysql·ubuntu
Ujimatsu14 小时前
虚拟机安装Debian 13.x及其常用软件(2026.4)
linux·运维·ubuntu
拾贰_C17 小时前
【Agent | openai | Streaming | 】流式输出Streaming
ubuntu·面试·prompt