![Samba Share 对每个人都可写](https://linux22.com/image/1169722/Samba%20Share%20%E5%AF%B9%E6%AF%8F%E4%B8%AA%E4%BA%BA%E9%83%BD%E5%8F%AF%E5%86%99.png)
我无法使我的 samba 共享正常工作。我的目的是托管一个可供所有人(包括来宾)写入的目录。为此,我创建了一个拥有相应目录的用户和组:
drwxrwsr-x 19 transferuser transfergroup 4096 Dez 14 12:43 Transfer
在我的 smb.conf 中,我尝试了在多个线程中找到的数十种配置组合。我可以浏览目录并读取所有文件,但没有写权限。我使用 Dolphin 从运行 Kubuntu 19.10 的机器浏览目录。该服务器也运行 Kubuntu 19.10。最初我是这样认为的,fource user
并force group
会自动为该用户应用 unix 权限。但是由于该用户拥有该目录,因此他拥有完全访问权限。我如何允许每个用户(和来宾)拥有写权限?这是我目前的 smb.conf:
[global]
security = user
map to guest = bad user
unix extensions = no
[...]
[Transfer]
path=/media/shared/6TB2/Transfer/
read only = no
comment=
force user = transferuser
force group = transfergroup
writable = yes
browsable = yes
public = yes
create mask = 775
force create mode = 775
security mask = 775
force security mode = 775
directory mask = 2775
force directory mode = 2775
directory security mask = 2775
force directory security mode = 2775
inherit permissions = yes
编辑 1:通过编辑 smb.conf 创建共享。输出net usershare info --long
为空的. 的输出testparm -s
为:
Load smb config files from /etc/samba/smb.conf
Unknown parameter encountered: "usershare_acl"
Ignoring unknown parameter "usershare_acl"
Unknown parameter encountered: "usershare_acl"
Ignoring unknown parameter "usershare_acl"
Loaded services file OK.
Server role: ROLE_STANDALONE
# Global parameters
[global]
log file = /var/log/samba/log.%m
logging = file
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
security = USER
server min protocol = SMB2
server role = standalone server
server string = %h server (Samba, Ubuntu)
unix password sync = Yes
usershare allow guests = Yes
idmap config * : backend = tdb
[printers]
browseable = No
comment = All Printers
create mask = 0700
path = /var/spool/samba
printable = Yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[Transfer]
comment = Transfer for all
force group = transfergroup
force user = transferuser
guest ok = Yes
path = /media/shared/6TB2/Transfer/
read only = No
[...]