20.4. 自動マウントマップの保存と取得に LDAP を使用するように autofs を設定する


LDAP ディレクトリーに保存されている自動マウントマップを取得するように autofs サービスを設定できます。

前提条件

  • autofs および openldap パッケージがインストールされている。
  • セキュアな認証のために Kerberos 対応サービスが実行中である。

手順

  1. LDAP アクセスを設定するには、/etc/openldap/ldap.conf ファイルを変更します。自動マウントエントリーを見つけるための適切なサーバーおよびベースを反映するために、BASE および URI オプションが設定されていることを確認します。
  2. /etc/autofs.conf ファイルで、自動マウントマップの LDAP スキーマを設定します。デフォルトでは、autofs は頻繁に使用されるスキーマを設定ファイルに指定された順序でチェックします。

    #
    # Define the LDAP schema to used for lookups
    #
    # If no schema is set autofs will check each of the schemas
    # below in the order given to try and locate an appropriate
    # basdn for lookups. If you want to minimize the number of
    # queries to the server set the values here.
    #
    #map_object_class = nisMap
    #entry_object_class = nisObject
    #map_attribute = nisMapName
    #entry_attribute = cn
    #value_attribute = nisMapEntry
    #
    # Other common LDAP naming
    #
    #map_object_class = automountMap
    #entry_object_class = automount
    #map_attribute = ou
    #entry_attribute = cn
    #value_attribute = automountInformation
    #
    #map_object_class = automountMap
    #entry_object_class = automount
    #map_attribute = automountMapName
    #entry_attribute = automountKey
    #value_attribute = automountInformation
    Copy to Clipboard Toggle word wrap
    注記

    これらの値を明示的に設定して、LDAP クエリーをわずかに減らすこともできます。/etc/autofs.conf ファイルに小文字と大文字の両方で属性を書き込むことができます。

  3. 自動マウント機能マップを LDAP に格納するためにデフォルトされた最新のスキーマが、rfc2307bis ドラフトに記載されています。このスキーマを使用するには、/etc/autofs.conf ファイルでコメントを解除し、ldap_schema オプションに適切な値を設定してスキーマを設定します。たとえば、標準以外のスキーマを使用している場合や、デフォルトの動作をオーバーライドする必要がある場合は、/etc/autofs.conf ファイルで関連するスキーマ属性を指定できます。次の値は、rfc2307bis ドラフトなどの一般的に使用されるスキーマ設定に対応しています。

    default_map_object_class = automountMap
    default_entry_object_class = automount
    default_map_attribute = automountMapName
    default_entry_attribute = automountKey
    default_value_atrribute = automountInformation
    Copy to Clipboard Toggle word wrap

    autofs は、標準スキーマを自動的に検出します。通常、カスタムまたは混合スキーマ環境の場合にのみこれらの設定を指定する必要があります。使用する場合、スキーマ定義の完全なセットを 1 つだけアクティブにする必要があります。

  4. 設定でカスタムスキーマを指定する場合は、スキーマ関連のエントリーの完全なセットが 1 つだけアクティブになっていることを確認してください。競合を避けるため、その他はコメントアウトします。rfc2307bis スキーマでは、automountKey 属性が、古い rfc2307 スキーマで使用されていた cn 属性に置き換わります。以下は、対応する LDAP データ交換フォーマット (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/&
    Copy to Clipboard Toggle word wrap
  5. LDAP サーバーからの認証を許可するには、/etc/autofs_ldap_auth.conf ファイルを編集します。

    1. authrequired を yes に変更します。
    2. プリンシパルを LDAP サーバー (host/FQDN@REALM) の Kerberos ホストプリンシパルに設定します。プリンシパル名は、GSS クライアント認証の一部としてディレクトリーへの接続に使用されます。

      <autofs_ldap_sasl_conf
           usetls="no"
           tlsrequired="no"
           authrequired="yes"
           authtype="GSSAPI"
      clientprinc="host/server.example.com@EXAMPLE.COM"/>
           secret="<ldap password>"/>
      Copy to Clipboard Toggle word wrap

      ホストプリンシパルの詳細は、IdM での正規化された DNS ホスト名の使用 を参照してください。正確なホストプリンシパル情報を取得するために、klist -k を実行することもできます。

トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat