![Samba 与 Windows AD 同步,未设置只读属性](https://linux22.com/image/997832/Samba%20%E4%B8%8E%20Windows%20AD%20%E5%90%8C%E6%AD%A5%EF%BC%8C%E6%9C%AA%E8%AE%BE%E7%BD%AE%E5%8F%AA%E8%AF%BB%E5%B1%9E%E6%80%A7.png)
连接到 Samba 服务器的 Windows 计算机无法设置只读标志。用户在设置该属性时不会收到错误消息。但是,当您重新打开文件属性时,只读属性又被取消设置。
将标志设置为文件所有者没有什么区别。
[global]
# No .tld
workgroup = ERT
netbios name= ertdrp
name resolve order = bcast lmhosts host wins
# Active Directory System
security = ads
# With .tld
realm = ERT.LOCAL
# Just a member server
domain master = no
local master = no
preferred master = no
# Disable printing error log messages when CUPS is not installed.
printcap name = /etc/printcap
load printers = no
# Works both in samba 3.2 and 3.6.
idmap backend = tdb
idmap uid = 10000-99999
idmap gid = 10000-99999
# no .tld
idmap config ERT:backend = rid
idmap config ERT:range = 10000-9999
winbind enum users = yes
winbind enum groups = yes
# This way users log in with username instead of [email protected]
winbind use default domain = yes
# Inherit groups in groups
winbind nested groups = yes
winbind refresh tickets = yes
winbind offline logon = true
# Becomes /home/example/username
template homedir = /home/%D/%U
# No shell access
template shell = /bin/false
client use spnego = yes
client ntlmv2 auth = yes
encrypt passwords = yes
restrict anonymous = 2
log file = /var/log/samba/samba.log
log level = 3
[data]
comment = data
path = "/media/x"
valid users = ERT\xx, @ERT\gebruikers
force group = gebruikers
writable = yes
read only = no
force create mode = 0777
create mask = 0777
directory mask = 0777
force directory mode = 0777
access based share enum = yes
hide unreadable = yes
文件和文件夹都是777。
我错过了什么?
答案1
我通过允许 Windows ACL 并应用 Windows 的权限来修复此问题。
我将其添加到我的配置中
vfs objects = acl_xattr
map acl inherit = yes
store dos attributes = yes
并删除
#orce create mode = 0777
create mask = 0777
#directory mask = 0777
force directory mode = 0777
force group = Domeingebruikers