1.9.3. 添加使用 Windows ACL 的共享
您可以创建一个名为 example 的共享,其共享 /srv/samba/example/ 目录的内容,并使用 Windows ACL 。
流程
如果不存在,请创建文件夹。例如:
# mkdir -p /srv/samba/example/如果您在
enforcing模式下运行 SELinux,请在目录中设置samba_share_t上下文:# semanage fcontext -a -t samba_share_t "/srv/samba/example(/.*)?"# restorecon -Rv /srv/samba/example/将共享示例添加到
/etc/samba/smb.conf文件中。例如,添加启用了共享的写操作:[example] path = /srv/samba/example/ read only = no注意无论文件系统 ACL 是什么;如果您没有设置
read only = no,Samba 会以只读模式共享该目录。如果您还没有在 [global] 部分中启用 Windows ACL 支持,请在 [example] 部分中添加以下参数以启用此功能:
vfs objects = acl_xattr map acl inherit = yes store dos attributes = yes验证
/etc/samba/smb.conf文件:# testparm打开所需的端口并使用
firewall-cmd工具重新载入防火墙配置:# firewall-cmd --permanent --add-service=samba# firewall-cmd --reload重启
smb服务:# systemctl restart smb