「Idmap config ad」の版間の差分

提供:雑廉堂Wiki
編集の要約なし
 
(同じ利用者による、間の1版が非表示)
108行目: 108行目:




'''Before Samba version 4.6.0:'''
'''Samba バージョン 4.6.0より前:'''


* To configure the <code>ad</code> back end using the <code>10000-999999</code> ID range for the <code>SAMDOM</code> domain, set the following in the <code>[global]</code> section of your <code>smb.conf</code> file:
* <code>SAMDOM</code>ドメインのIDの範囲を<code>10000-999999</code>を使用するように<code>ad</code>バックエンドを設定するには、<code>smb.conf</code>ファイルの<code>[global]</code>セクションに次のように設定します。:


  security = ADS
  security = ADS
138行目: 138行目:




'''From Samba version 4.6.0:'''
'''Samba バージョン 4.6.0から:'''


* To configure the <code>ad</code> back end using the <code>10000-999999</code> ID range for the <code>SAMDOM</code> domain, set the following in the <code>[global]</code> section of your <code>smb.conf</code> file:
* <code>SAMDOM</code>ドメインのIDの範囲を<code>10000-999999</code>を使用するように<code>ad</code>バックエンドを設定するには、<code>smb.conf</code>ファイルの<code>[global]</code>セクションに次のように設定します。:


  security = ADS
  security = ADS
168行目: 168行目:


{{Imbox
{{Imbox
| type = important
| type = content
| text = Setting the default back end is mandatory.
| style = margin:4px 2%;
| text = デフォルトのバックエンドを設定することは必須です。
}}
}}


{{Imbox
{{Imbox
| type = important
| type = content
| text = You must set the range for every domain, including the <code>*</code> default domain. You must set the back end and schema mode for every domain, except the <code>*</code> default domain. The ID ranges of all domains configured in the smb.conf file must not overlap.
| style = margin:4px 2%;
| text = デフォルトのドメイン<code>*</code>を含め、すべてのドメインに範囲を設定する必要があります。 デフォルトドメイン<code>*</code>を除くすべてのドメインに対してバックエンドとスキーマモードを設定する必要があります。 smb.confファイルに設定されているすべてのドメインのID範囲は重複してはいけません。
}}
}}




* Configure the Winbind NSS info mode:
* Winbind NSS info mode を設定する:


:* To enable the <code>template</code> mode and set, for example, <code>/bin/bash</code> as shell and <code>/home/%U</code> as home directory path:
:* 例えば、シェルを<code>/bin/bash</code>、そしてホームディレクトリパスを<code>/home/%U</code>として、<code>template</code>を有効にして設定するには:


  # Template settings for login shell and home directory
  # Template settings for login shell and home directory
186行目: 188行目:
  template homedir = /home/%U
  template homedir = /home/%U


:: The settings are applied to all users in each domain that has the <code>schema_mode = rfc2307</code> parameter set. From Samba 4.6.0, the global template settings can be overwritten on a domain-basis by enabling the <code>idmap config ''domain_name'':unix_nss_info</code> parameter.
:: 設定は、<code>schema_mode = rfc2307</code>のパラメータセットを持つ、各ドメインの全てのユーザに適用されます。Samba 4.6.0からは、グローバルのテンプレート設定は、<code>idmap config ''domain_name'':unix_nss_info</code>パラメータを有効にすることによって、ドメインベースで上書きすることができます。


:: Samba resolves the <code>%U</code> variable to the session user name. For details, see the <code>VARIABLE SUBSTITUTIONS</code> section in the <code>smb.conf(5)</code> man page.
:: Samba は変数<code>%U</code>をセッションユーザー名で置き換えます。詳細は、 マニュアルページの<code>smb.conf(5)</code><code>VARIABLE SUBSTITUTIONS</code>セクションを参照してください。


* By default, Samba sets the Windows primary group as primary group for mapped domain user entries on Unix. The Windows primary group is retrieved from the <code>primaryGroupID</code> attribute of each user entry, this is usually set to the <code>Domain Users</code> group RID. This RID is then used to obtain the <code>gidNumber</code> attribute from the Windows primary group.
* デフォルトで、SambaはUnixでマップされている、ドメインユーザーエントリーのプライマリグループとして、Windowsプライマリグループを設定します。Windowsプライマリグループはそれぞれのユーザエントリの<code>primaryGroupID</code>属性から取得され、これは、通常<code>Domain Users</code>グループのRIDが設定されます。このRIDは、Windowsプライマリグループから<code>gidNumber</code>属性を取得するために使用されます。


* If you are running Samba 4.6.0 or later, you can optionally configure Samba to use the primary group set in the <code>gidNumber</code> attribute in the users entry instead. For example, when using the <code>Active Directory Users and Computers</code> application, this attribute is displayed in the <code>UNIX Attributes</code> tab. To use the group ID set in the users <code>gidNumber</code> attribute as primary group for each user instead of the Windows primary group, enable the following parameter in the <code>[global]</code> section in your <code>smb.conf</code> file:
* もし、Samba 4.6.0以降の実行している場合、任意でユーザーエントリーの、<code>gidNumber</code>属性のプライマリグループセットを、代わりに使用するように、Sambaを設定することができます。例えば、<code>Active Directory ユーザーとコンピュータ</code>を使用する時、この属性は<code>UNIX属性</code>タブで表示されます。Windowsプライマリグループの代わりに、ユーザーの<code>gidNumber</code>属性でセットされたグループIDを、各ユーザーのプライマリグループとして使用するには、<code>smb.conf</code>ファイルの<code>[global]</code>セクションの、次のパラメータを有効にしてください:


  idmap config SAMDOM:unix_primary_group = yes
  idmap config SAMDOM:unix_primary_group = yes


{{Imbox
{{Imbox
| type = important
| type = content
| text = Whichever setting you use, the group (or groups) set as the users primary group must have the <code>gidNumber</code> attribute set. For example, if you only use the <code>Domain Users</code> group as the primary group for all accounts, then the <code>Domain Users</code> group must have a <code>gidNumber</code> attribute set. Winbind is unable to map accounts that use primary groups that do not have the <code>gidNumber</code> attribute set.
| style = margin:4px 2%;
| text = どちらの設定を使用する場合でも、ユーザーのプライマリグループとして設定されたグループは、<code>gidNumber</code>属性を持っていなければいけません。例えば、全てのアカウントのプライマリグループとして、<code>Domain Users</code>グループのみ使用する場合、<code>Domain Users</code>グループは<code>gidNumber</code>属性を持つ必要があります。Winbindは<code>gidNumber</code>属性を持たないプライマルグループを使用するアカウントをマップすることができません。
}}
}}


{{Imbox
{{Imbox
| type = important
| type = content
| text = Whichever setting you use, do not change the users <code>primaryGroupID</code> attribute, Windows relies on all users being a member of <code>Domain Users</code>. If you require your Unix users to have a primary group other than <code>Domain Users</code>, you should use Samba version 4.6.0 or later.
| style = margin:4px 2%;
| text = どちらの設定を使用する場合でも、ユーザーの<code>primaryGroupId</code>属性を変更しないでください。Windowsはすべてのユーザーが<code> Domain Users </code>のメンバーであることに依存しています。Unixユーザーに<code>Domain Users</code>以外のプライマリグループを持つことを要求する場合は、Sambaバージョン4.6.0以降を使うべきです。
}}
}}


* Reload Samba:
* Sambaをリロード:


  # smbcontrol all reload-config
  # smbcontrol all reload-config


For further details, see the <code>smb.conf(5)</code> and <code>idmap_ad(5)</code> man page.
詳しくは、<code>smb.conf(5)</code><code>idmap_ad(5)</code>のマニュアルページを参照してください。





2019年3月1日 (金) 18:49時点における最新版

前書き

ad IDマッピングバックエンドは、Active Directory(AD)からアカウントおよびグループ情報を読み取るための読み取り専用API を実装します。 バックエンドはRFC 2307に基づいています。 詳細については、https://www.rfc-editor.org/rfc/rfc2307.txtを参照してください。

代替案については、アイデンティティマッピングバックエンドを参照してください。

{{#invoke:Message box|imbox}}

{{#invoke:Message box|imbox}}

adバックエンドのメリットとデメリット

利点:

  • Active Directory(AD)内のIDの集中管理。
  • adバックエンドを使用するすべてのSambaクライアントとサーバ上の一貫したID。
  • 必要な属性は一度作成するだけで済みます。これはユーザーまたはグループの作成時に行うことができます
  • IDはローカルにのみキャッシュされ、DCのADデータベースに格納されます。 つまり、ローカルキャッシュが破損してもファイルの所有権は失われません。

欠点:

  • Windowsの「Active Directoryユーザーとコンピュータ」(ADUC)プログラムが使用されていない場合、重複を避けるためにID値を手動で追跡する必要があります。
  • RFC2307属性の値は手動で設定する必要があります。

Winbind NSS infoモード固有の機能:

  • rfc2307:ユーザの個々のログインシェルとホームディレクトリパス。
  • template:ログインシェルとホームディレクトリのベースパスはすべてのユーザで同じです。

ID範囲の計画

smb.confファイルでadバックエンドを設定する前に、ドメインごとに一意のID範囲を選択する必要があります。 Sambaがドメイン内に作成された将来のすべてのユーザーおよびグループにIDを割り当てることができるように、範囲は連続的かつ十分に大きくなければなりません。

{{#invoke:Message box|imbox}}

前提条件

SambaがActive Directory(AD)からユーザ情報とグループ情報を取得できるようにするには:

  • ユーザーは少なくともuidNumber属性セットを持っている必要があります。 rfc2307 winbind NSS infoモードを使用する場合、ユーザーアカウントにもloginShellunixHomeDirectoryを設定する必要があります。
  • グループには、少なくともgidNumber属性セットが必要です。
  • コンピュータ、または 'machine network accounts'は、sambaドメインメンバーの共有にアクセスするためにuidNumber属性を設定する必要があります。
  • ユーザーとコンピュータのプライマリグループには、gidNumber属性を設定する必要があります。
  • ユーザー、コンピュータ、およびグループIDは、このドメインの smb.conf に設定されている範囲内でなければなりません。
  • ユーザーIDとコンピュータIDはすべてのユーザーとコンピュータに対して一意である必要があり、グループIDはすべてのグループに対して一意である必要があります。重複したID、または以前に削除されたアカウントのIDを再利用することで、新しいユーザー、コンピュータ、またはグループは、他のまたは以前のID所有者によって作成されたファイルにアクセスできます。 ADUCユーティリティを使用すると、ユーザーIDとグループIDはAD内で自動的に追跡され、新しいユーザーまたはグループを作成するときに増加します。
  • コンピュータID(uidNumber属性)はAD内で自動的に追跡されないため、コンピュータがドメインに参加しているときはADUC Attribute Editorタブで手動で設定する必要があります。

{{#invoke:Message box|imbox}}

RFC2307templateモードのオプション

Sambaバージョン4.6.0より前:


adIDマッピングバックエンドは、smb.conf[global]セクションのwinbind nss infパラメータににセットされた2つのモードをサポートしています:

  • winbind nss info = rfc2307: Active Directory(AD)からすべての情報が読み込まれます。
  • Users: アカウント名、UID、ログインシェル、ホームディレクトリのパス、およびプライマリグループ。
  • Groups:グループ名とGID
  • winbind nss info = template: ADから次の値のみ読み込まれます。
  • Users:アカウント名、UID、およびプライマリグループ。
ログインシェルとホームディレクトリは、smb.conf内にユーザーから独立した設定によって自動的にセットされます。
  • Groups:グループ名とGID


Samba バージョン 4.6.0から:

すでにwinbind nss infoパラメータは使用しなくなり、すでにidmap config DOMAIN:unix_nss_infoに置き換えられました。

ad IDマッピングバックエンドはsmb.confファイルの [global]セクションの idmap config DOMAIN:unix_nss_infoパラメータにセットされた2つのモードをサポートしています:

  • idmap config DOMAIN:unix_nss_info = yes: すべての情報がActive Directory(AD)から読み込まれます:
  • Users: アカウント名、UID、ログインシェル、ホームディレクトリパス、およびプライマリグループ。
  • Group: グループ名とGID。
  • これらの設定はDOMAIN単位で設定されます。つまり、DOMAINごとに異なる設定を行うことができます。
  • ユーザがRFC2307の属性を欠いている場合、ログインシェルとホームディレクトリは、 smb.confファイルのユーザに依存しない設定によって自動的に設定されます。
  • idmap config DOMAIN:unix_nss_info = no: 次の値だけがADから読み込まれます。
  • Users: アカウント名、UID、およびプライマリグループ。
ログインシェルとホームディレクトリは、smb.confファイルのユーザーに依存しない設定によって自動的に設定されます。
  • Group: グループ名とGID
  • これがデフォルト設定です。

新しい設定 unix_primary_groupが追加されました。これにより、ドメインユーザーの代わりにユーザーのプライマリグループに別のグループを使用することができます。

  • これがunix_primary_group = yesで設定されている場合、ユーザープライマリグループは、ユーザーADオブジェクトにあるgidNumber属性から取得されます。
  • これがunix_primary_group = noで設定されている場合、ユーザープライマリグループは「primaryGroupID」属性を使用して計算されます。
  • デフォルトは 'no'です。

adバックエンドの設定

Samba バージョン 4.6.0より前:

  • SAMDOMドメインのIDの範囲を10000-999999を使用するようにadバックエンドを設定するには、smb.confファイルの[global]セクションに次のように設定します。:
security = ADS
workgroup = SAMDOM
realm = SAMDOM.EXAMPLE.COM

log file = /var/log/samba/%m.log
log level = 1

winbind nss info = rfc2307

# Default ID mapping configuration for local BUILTIN accounts
# and groups on a domain member. The default (*) domain:
# - must not overlap with any domain ID mapping configuration!
# - must use a read-write-enabled back end, such as tdb.
idmap config * : backend = tdb
idmap config * : range = 3000-7999
# - You must set a DOMAIN backend configuration
# idmap config for the SAMDOM domain
idmap config SAMDOM:backend = ad
idmap config SAMDOM:schema_mode = rfc2307
idmap config SAMDOM:range = 10000-999999

vfs objects = acl_xattr
map acl inherit = yes
store dos attributes = yes


Samba バージョン 4.6.0から:

  • SAMDOMドメインのIDの範囲を10000-999999を使用するようにadバックエンドを設定するには、smb.confファイルの[global]セクションに次のように設定します。:
security = ADS
workgroup = SAMDOM
realm = SAMDOM.EXAMPLE.COM

log file = /var/log/samba/%m.log
log level = 1

# Default ID mapping configuration for local BUILTIN accounts
# and groups on a domain member. The default (*) domain:
# - must not overlap with any domain ID mapping configuration!
# - must use a read-write-enabled back end, such as tdb.
idmap config * : backend = tdb
idmap config * : range = 3000-7999
# - You must set a DOMAIN backend configuration
# idmap config for the SAMDOM domain
idmap config SAMDOM:backend = ad
idmap config SAMDOM:schema_mode = rfc2307
idmap config SAMDOM:range = 10000-999999
idmap config SAMDOM:unix_nss_info = yes

vfs objects = acl_xattr
map acl inherit = yes
store dos attributes = yes


{{#invoke:Message box|imbox}}

{{#invoke:Message box|imbox}}


  • Winbind NSS info mode を設定する:
  • 例えば、シェルを/bin/bash、そしてホームディレクトリパスを/home/%Uとして、templateを有効にして設定するには:
# Template settings for login shell and home directory
template shell = /bin/bash
template homedir = /home/%U
設定は、schema_mode = rfc2307のパラメータセットを持つ、各ドメインの全てのユーザに適用されます。Samba 4.6.0からは、グローバルのテンプレート設定は、idmap config domain_name:unix_nss_infoパラメータを有効にすることによって、ドメインベースで上書きすることができます。
Samba は変数%Uをセッションユーザー名で置き換えます。詳細は、 マニュアルページのsmb.conf(5)VARIABLE SUBSTITUTIONSセクションを参照してください。
  • デフォルトで、SambaはUnixでマップされている、ドメインユーザーエントリーのプライマリグループとして、Windowsプライマリグループを設定します。WindowsプライマリグループはそれぞれのユーザエントリのprimaryGroupID属性から取得され、これは、通常Domain UsersグループのRIDが設定されます。このRIDは、WindowsプライマリグループからgidNumber属性を取得するために使用されます。
  • もし、Samba 4.6.0以降の実行している場合、任意でユーザーエントリーの、gidNumber属性のプライマリグループセットを、代わりに使用するように、Sambaを設定することができます。例えば、Active Directory ユーザーとコンピュータを使用する時、この属性はUNIX属性タブで表示されます。Windowsプライマリグループの代わりに、ユーザーのgidNumber属性でセットされたグループIDを、各ユーザーのプライマリグループとして使用するには、smb.confファイルの[global]セクションの、次のパラメータを有効にしてください:
idmap config SAMDOM:unix_primary_group = yes

{{#invoke:Message box|imbox}}

{{#invoke:Message box|imbox}}

  • Sambaをリロード:
# smbcontrol all reload-config

詳しくは、smb.conf(5)idmap_ad(5)のマニュアルページを参照してください。