搜索

19.6. 使用 LDAP 存储自动挂载器映射

download PDF

此流程将 autofs 配置为将自动挂载程序映射存储在 LDAP 配置中,而不是存储在 autofs 映射文件中。

先决条件

  • 必须在所有配置的系统中安装 LDAP 客户端程序库,以便从 LDAP 检索自动挂载程序映射。在 Red Hat Enterprise Linux 上,openldap 软件包应作为 autofs 软件包的依赖项自动安装。

流程

  1. 要配置 LDAP 访问,请修改 /etc/openldap/ldap.conf 文件。确保为您的站点正确设置了 BASEURIschema 选项。
  2. rfc2307bis 草案中描述了最近建立的用于在 LDAP 中存储自动映射的模式。要使用此模式,请在 /etc/autofs.conf 配置文件中通过删除模式定义中的注释字符来设置它。例如:

    例 19.6. 设置 autofs 配置

    DEFAULT_MAP_OBJECT_CLASS="automountMap"
    DEFAULT_ENTRY_OBJECT_CLASS="automount"
    DEFAULT_MAP_ATTRIBUTE="automountMapName"
    DEFAULT_ENTRY_ATTRIBUTE="automountKey"
    DEFAULT_VALUE_ATTRIBUTE="automountInformation"
  3. 确保配置中所有其他模式条目都被注释了。rfc2307bis 模式的 automountKey 属性替换 rfc2307 模式的 cn 属性。以下是 LDAP 数据交换格式(LDIF)配置的一个示例:

    例 19.7. LDIF 配置

    # auto.master, example.com
    dn: automountMapName=auto.master,dc=example,dc=com
    objectClass: top
    objectClass: automountMap
    automountMapName: auto.master
    
    # /home, auto.master, example.com
    dn: automountMapName=auto.master,dc=example,dc=com
    objectClass: automount
    automountKey: /home
    automountInformation: auto.home
    
    # auto.home, example.com
    dn: automountMapName=auto.home,dc=example,dc=com
    objectClass: automountMap
    automountMapName: auto.home
    
    # foo, auto.home, example.com
    dn: automountKey=foo,automountMapName=auto.home,dc=example,dc=com
    objectClass: automount
    automountKey: foo
    automountInformation: filer.example.com:/export/foo
    
    # /, auto.home, example.com
    dn: automountKey=/,automountMapName=auto.home,dc=example,dc=com
    objectClass: automount
    automountKey: /
    automountInformation: filer.example.com:/export/&

其它资源

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.