237 字
1 分钟
ArchLinux Plasma 6 开启Samba服务(文件共享)
2025-04-24

在 Plasma 6 中的 Dolphin 使用文件共享

安装相关的插件#

Terminal window
pacman -Sy kdenetwork-filesharing

编辑 Samba 配置文件#

文件路径 /etc/samba/smb.conf

[global]
 usershare path = /var/lib/samba/usershares
 usershare max shares = 100
 # usershare allow guests = yes
 usershare owner only = no
 workgroup = WORKGROUP
 security = user
 passdb backend = smbpasswd
 name resolve order = lmhosts bcast host wins
 unix charset = UTF-8
 load printers = no
 printing = bsd
 printcap name = /dev/null
 disable spoolss = yes
 show add printer wizard = no
 server string = Samba Server
 log file = /var/log/samba/log.%m
 # Put a capping on the size of the log files (in Kb).
 max log size = 50
 dns proxy = no
#============================ Share Definitions ==============================
#
#[homes]
# 启用这个块会默认共享对应用户的home目录
#  comment = Home Directories
#  browsable = no
#  writable = yes

配置用户组和文件夹#

Terminal window
mkdir /var/lib/samba/usershares
groupadd fileshare
usermod -a -G fileshare $(whoami)
chown root:fileshare /var/lib/samba/usershares
chmod 1771 /var/lib/samba/usershares

启动 Samba 服务#

Terminal window
systemctl restart smb nmb
systemctl enable smb nmb

将Linux用户添加到Samba数据库#

这一步可以为Samba用户设置独立的密码

Terminal window
smbpasswd -a $(whoami)

重启#

Terminal window
reboot
ArchLinux Plasma 6 开启Samba服务(文件共享)
https://memo.moieo.net/2025/04/24/220548/
作者
Moieo
发布于
2025-04-24
许可协议
CC BY-NC-SA 4.0