1.9.3. 添加使用 Windows ACL 的共享


您可以创建一个名为 example 的共享,其共享 /srv/samba/example/ 目录的内容,并使用 Windows ACL 。

流程

  1. 如果不存在,请创建文件夹。例如:

    # mkdir -p /srv/samba/example/
  2. 如果您在enforcing模式下运行 SELinux,请在目录中设置samba_share_t上下文:

    # semanage fcontext -a -t samba_share_t "/srv/samba/example(/.*)?"
    # restorecon -Rv /srv/samba/example/
  3. 将共享示例添加到 /etc/samba/smb.conf 文件中。例如,添加启用了共享的写操作:

    [example]
    	path = /srv/samba/example/
    	read only = no
    注意

    无论文件系统 ACL 是什么;如果您没有设置read only = no,Samba 会以只读模式共享该目录。

  4. 如果您还没有在 [global] 部分中启用 Windows ACL 支持,请在 [example] 部分中添加以下参数以启用此功能:

    vfs objects = acl_xattr
    map acl inherit = yes
    store dos attributes = yes
  5. 验证/etc/samba/smb.conf文件:

    # testparm
  6. 打开所需的端口并使用firewall-cmd工具重新载入防火墙配置:

    # firewall-cmd --permanent --add-service=samba
    # firewall-cmd --reload
  7. 重启 smb 服务:

    # systemctl restart smb
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部