Active Directory(AD)の各種ディレクトリ情報の取得はLDAPにより行なわれています。ADのドメインコントローラ(DC)は、LDAPのディレクトリサーバとしても機能しています。
標準の構成では、LDAPへアクセスする際の認証はKerberos(もしくはNTLM)により行なわれるため、Linuxなどで実装されている、いわゆるLDAP認証を行うことはできません。しかし、DCにSFU(Services for UNIX)もしくはSUA(Subsystem for UNIX-based Applications)を追加することにより、LDAPのuserPassword属性相当の属性にパスワード情報が書き込まれるようになるため、ADのDCを用いてLDAP認証を実現し、認証を統合することが可能です。
図1 SFU(SUA)によるLDAP認証の統合
なお、NISサーバ機能を提供する形態は表1のように変遷し、無償/有償の別や名称が変わっていますが、基本的な提供機能は変更ありません。以降ではWindows Server 2008のSUAを例に、設定方法を説明しますが、基本的にはSFU 3.0をインストールしたWindows 2000 Server以降において、ほぼ同等の設定で同様の機能が実現します。
# Your LDAP server. Must be resolvable without using LDAP.
# Multiple hosts may be specified, each separated by a
# space. How long nss_ldap takes to failover depends on
# whether your LDAP client library supports configurable
# network or connect timeouts (see bind_timelimit).
host 192.168.135.111 ← LDAPサーバ(DC)のIPアドレスやホスト名
# The distinguished name of the search base.
base dc=w2k8ad1,dc=local ← 検索の際の基本となるDN。良くわからない場合は、左のように、ADのドメイン名の各パートを「dc=」で区切って設定しておけばよい。
...
# The distinguished name to bind to the server with.
# Optional: default is to bind anonymously.
binddn cn=administrator,cn=users,dc=w2k8ad1,dc=local
← LDAPサーバに検索を行うときに用いるユーザのDN
# The credentials to bind with.
# Optional: default is no credential.
bindpw password ← 上記DNのパスワード
...
# The search scope.
#scope sub ←設定がコメントになっているか、明示的に「scope sub」が設定されていることを確認する
#scope one
#scope base
#ssl no ←設定がコメントになっているか、明示的に「ssl no」が設定されていることを確認する
...
# Services for UNIX 3.5 mappings ← 以下はSFU 3.0/3.5を用いる場合のLinux側とAD側との属性の対応付け設定など
#nss_map_objectclass posixAccount User
#nss_map_objectclass shadowAccount User
#nss_map_attribute uid msSFU30Name
#nss_map_attribute uniqueMember msSFU30PosixMember
#nss_map_attribute userPassword msSFU30Password
#nss_map_attribute homeDirectory msSFU30HomeDirectory
#nss_map_attribute homeDirectory msSFUHomeDirectory
#nss_map_objectclass posixGroup Group
#pam_login_attribute msSFU30Name
#pam_filter objectclass=User
#pam_password ad
...
# RFC 2307 (AD) mappings ←以下はSUAを用いる場合のLinux側とAD側との属性の対応付け設定など
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_attribute uid sAMAccountName
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute shadowLastChange pwdLastSet
nss_map_objectclass posixGroup group
nss_map_attribute uniqueMember member
pam_login_attribute sAMAccountName
pam_filter objectclass=User
pam_password ad
$ telnet 192.168.135.146
Trying 192.168.135.146...
Connected to 192.168.135.146.
Escape character is '^]'.
CentOS release 5.2 (Final)
Kernel 2.6.18-92.el5 on an i686
login: nis1
Password:
Last login: Sat Apr 18 17:07:01 from localhost.localdomain
No directory /home/nis1!
Logging in with home = "/".
-bash-3.2$ id
uid=10101(nis1) gid=10001 groups=10001