惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
雷峰网
雷峰网
博客园 - 叶小钗
V
V2EX
博客园 - Franky
博客园_首页
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
S
SegmentFault 最新的问题
B
Blog RSS Feed
博客园 - 【当耐特】
D
Docker
N
Netflix TechBlog - Medium

Linux – Ed_'s Blog

给 Debian 开了自动安全更新 – yywr's Blog UPower – 将笔记本电池当成UPS使用 – yywr's Blog Crontab 使用笔记 – yywr's Blog Linux 程序开机启动并保活:Systemd 进程守护管理工具 – yywr's Blog Linux 下自动挂载 Samba /CIFS 共享文件夹 – yywr's Blog Ubuntu 开机自动挂载第二块硬盘 – yywr's Blog 重装了家里的服务器系统 – yywr's Blog Ubuntu 笔记本合盖子不休眠的方法 – yywr's Blog
Samba 服务基本用法 – yywr's Blog
yywr · 2023-08-27 · via Linux – Ed_'s Blog

Skip to content

Linux下开机挂载SMB目录已经会了,配置服务端 samba 也做下记录,能实现最基本的需求 – 跑起来 

基本来说就三块内容,能保证基本的使用,一是Samba服务的安装启用,二共享目录的配置,三是账户的管理

安装服务包 (Ubutnu):  apt install samba

启用服务 systemctl start smbd

查看服务状态 systemctl status smbd

配置共享目录

编辑设置目录共享目录 /etc/samba/smb.conf , 添加下面配置,Path 设置为需要共享的路径

[filerun]
   path = /mnt/DataDisk/ed
   browseable = yes
   writeable = yes
   guest ok = no

管理账户

  • 增/改密码:sudo pdbedit -a username 
  • 删:sudo pdbedit -x username
  • 查:sudo pdbedit -L
  • 重置密码错误次数 sudo pdbedit -z -u username

其它

设置端口与防火墙,默认端口:445 , Ubuntu 下参考UFW 的使用防火墙配置工具 UFW

账户名称,建议配置成文件夹默认的Linux账户

用户端测试命令: smbclient -L//192.168.1.2

参考1:https://www.cnblogs.com/sinlang5778/articles/2120712.html

参考2:https://linux.die.net/man/8/pdbedit

参考3:https://linux.die.net/man/7/samba

本文是 居家服务器折腾笔记 的一部分