我有一个 Samba 共享,每个用户都可以访问该共享,并且在该共享中,服务器上设置的每个组都有目录,因此它看起来像这样:
ls -l
drwsrws--- 11 root p_01 4096 2018-01-17 Share1
drwsrws--- 13 root p_02 4096 2018-01-17 Share2
设置 SUID 后,当用户在该目录中创建新文件/目录时,它将继承其权限以及所属组。这在本地计算机和 Samba 共享(Linux 和 Windows 上)上都可以正常工作。
问题是,当用户将文件从 Share1 复制到 Share2 时,它也会复制权限(具有所属组)。
当我在服务器本地复制相同的文件时,它将根据需要从父目录获取权限。
2018-10-15 编辑:这是 smb.conf 的相关部分:
[global]
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = No
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
netbios name = SERVER
security = user
wins support = Yes
workgroup = NORDPRIM
[NORDPRIM]
inherit acls = Yes
path = /data/NORDPRIM
read only = No
inherit permissions = Yes
force create mode = 774
create mask = 774
directory mask = 2775
force directory mode = 2775
vfs objects = recycle