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

相关推荐
超级土豆粉4 小时前
从0到1写一个适用于Node.js的User Agent生成库
linux·ubuntu·node.js
抠脚学代码10 小时前
Ubuntu18.6 学习QT问题记录以及虚拟机安装Ubuntu后的设置
qt·学习·ubuntu
Sapphire~17 小时前
Linux-07 ubuntu 的 chrome 启动不了
linux·chrome·ubuntu
啵啵学习17 小时前
Linux 里 su 和 sudo 命令这两个有什么不一样?
linux·运维·服务器·单片机·ubuntu·centos·嵌入式
FREEDOM_X20 小时前
新版NANO下载烧录过程
ubuntu·机器人
好多知识都想学1 天前
Linux 文件处理器 sed 和 awk 详细讲解
linux·运维·ubuntu
自动驾驶小卡1 天前
ubuntu 常用操作指令(与域控制器交互相关)
linux·ubuntu·操作指令
心之语歌1 天前
ubuntu24.04 搭建 java 环境服务,以及mysql数据库
linux·ubuntu
y1x2y32 天前
【HITCSAPP 哈工大计算机系统期末大作业】 程序人生-Hello’s P2P
linux·程序人生·ubuntu
后端木木2 天前
一键 Ubuntu、Debian、Centos 换源(阿里源、腾讯源等)
ubuntu·centos·debian