22.6.3. ドメインコントローラー
Windows NT のドメインコントローラーは、Linux 環境の Network Information Service (NIS)サーバーと機能的に似ています。ドメインコントローラーと NIS サーバーは、ホストユーザー/グループ情報データベースと関連サービスの両方を提供します。ドメインコントローラーは主にセキュリティーに使用されます。これには、ドメインリソースにアクセスするユーザーの認証が含まれます。ユーザー/グループデータベースの整合性を維持するサービスは、Security Account Manager (SAM)と呼ばれます。SAM データベースは Windows と Linux の Samba ベースのシステム間で異なる方法で保存されるため、SAM レプリケーションは実現できず、プラットフォームを PDC/BDC 環境で混在させることはできません。
Samba 環境では、1 つの PDC と 0 個以上の BDC しか存在できません。
重要な影響
Samba は、Samba/Windows ドメインコントローラーの混合環境では存在できません(Samba は Windows PDC の BDC にすることも、その逆もできません)。または、Samba PDC と BDC を共存させる こともでき ます。
22.6.3.1. tdbsamを使用したプライマリードメインコントローラー(PDC)
Samba PDC の最も単純な実装で最も一般的な実装は、tdbsam パスワードデータベースバックエンドを使用します。エージング smbpasswd バックエンドを置き換えることが予定されています。tdbsam には、「Samba アカウント情報データベース」 で詳細に説明されている多くの改良点があります。passdb backend ディレクティブは、PDC に使用するバックエンドを制御します。
[global]
workgroup = DOCS
netbios name = DOCS_SRV
passdb backend = tdbsam
security = user
add user script = /usr/sbin/useradd -m "%u"
delete user script = /usr/sbin/userdel -r "%u"
add group script = /usr/sbin/groupadd "%g"
delete group script = /usr/sbin/groupdel "%g"
add user to group script = /usr/sbin/usermod -G "%g" "%u"
add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null -g machines "%u"
# The following specifies the default logon script
# Per user logon scripts can be specified in the user
# account using pdbedit logon script = logon.bat
# This sets the default profile path.
# Set per user paths with pdbedit
logon drive = H:
domain logons = Yes
os level = 35
preferred master = Yes
domain master = Yes
[homes]
comment = Home Directories
valid users = %S
read only = No
[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon/scripts
browseable = No
read only = No
# For profiles to work, create a user directory under the
# path shown.
mkdir -p /var/lib/samba/profiles/john
[Profiles]
comment = Roaming Profile Share
path = /var/lib/samba/profiles
read only = No
browseable = No
guest ok = Yes
profile acls = Yes
# Other resource shares ... ...
tdbsam を使用する機能 PDC システムを提供するには、以下の手順に従います。
- 上記の例で示すように、
smb.conf
ファイルの設定を使用します。 - root ユーザーを Samba パスワードデータベースに追加します。
smbpasswd -a root Provide the password here.
- smb サービスを起動します。
- すべてのプロファイル、ユーザー、および netlogon ディレクトリーが作成されていることを確認します。
- ユーザーがメンバーになることができるグループを追加します。
groupadd -f users groupadd -f nobody groupadd -f ntadmins
- UNIX グループをそれぞれの Windows グループに関連付けます。
net groupmap add ntgroup="Domain Users" unixgroup=users net groupmap add ntgroup="Domain Guests" unixgroup=nobody net groupmap add ntgroup="Domain Admins" unixgroup=ntadmins
- ユーザーまたはグループにアクセス権限を付与します。たとえば、Samba ドメインコントローラーのドメインにクライアントマシンを追加する権利を Domain Admins グループのメンバーに付与するには、以下のコマンドを実行します。
net rpc rights grant 'DOCS\Domain Admins' SetMachineAccountPrivilege -S PDC -U root
Windows システムは、ドメインユーザー などのドメイングループにマッピングされるプライマリーグループを使用することが推奨されます。
Windows グループとユーザーは同じ名前空間を使用するため、UNIX の場合のようにグループと同じ名前のユーザーが存在することはできません。
注記
複数のドメインコントローラーが必要な場合や、250 以上のユーザーがある場合は、tdbsam 認証バックエンドを使用し ない でください。この場合、LDAP が推奨されます。