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

推荐订阅源

V
Visual Studio Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
MyScale Blog
MyScale Blog
H
Help Net Security
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏

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

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