「Idmap config ad」の版間の差分
107行目: | 107行目: | ||
== adバックエンドの設定 == | == adバックエンドの設定 == | ||
'''Before Samba version 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: | |||
security = ADS | |||
idmap config SAMDOM:backend = ad | workgroup = SAMDOM | ||
idmap config SAMDOM:schema_mode = rfc2307 | realm = SAMDOM.EXAMPLE.COM | ||
idmap config SAMDOM:range = 10000-999999 | |||
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 | |||
'''From Samba version 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: | |||
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 | |||
{{Imbox | |||
| type = important | |||
| text = Setting the default back end is mandatory. | |||
}} | }} | ||
{{Imbox | |||
| type = important | |||
| 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. | |||
}} | |||
* Configure the 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: | ||
template | |||
# Template settings for login shell and home directory | |||
template shell = /bin/bash | |||
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. | ||
< | :: 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. | ||
* 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. | |||
* | |||
< | * 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: | ||
{{ | idmap config SAMDOM:unix_primary_group = yes | ||
| type = | |||
{{Imbox | |||
| text = | | type = important | ||
| 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. | |||
}} | }} | ||
* | {{Imbox | ||
| type = important | |||
| 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. | |||
}} | |||
* Reload Samba: | |||
# smbcontrol all reload-config | |||
For further details, see the <code>smb.conf(5)</code> and <code>idmap_ad(5)</code> man page. | |||
---- | |||
[[Category:Active Directory]] | |||
[[Category:Domain Members]] |
2019年3月1日 (金) 17:11時点における版
前書き
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
モードを使用する場合、ユーザーアカウントにもloginShell
とunixHomeDirectory
を設定する必要があります。 - グループには、少なくとも
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}}
RFC2307
とtemplate
モードのオプション
Sambaバージョン4.6.0より前:
ad
IDマッピングバックエンドは、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バックエンドの設定
Before Samba version 4.6.0:
- To configure the
ad
back end using the10000-999999
ID range for theSAMDOM
domain, set the following in the[global]
section of yoursmb.conf
file:
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
From Samba version 4.6.0:
- To configure the
ad
back end using the10000-999999
ID range for theSAMDOM
domain, set the following in the[global]
section of yoursmb.conf
file:
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}}
- Configure the Winbind NSS info mode:
- To enable the
template
mode and set, for example,/bin/bash
as shell and/home/%U
as home directory path:
- To enable the
# Template settings for login shell and home directory template shell = /bin/bash template homedir = /home/%U
- The settings are applied to all users in each domain that has the
schema_mode = rfc2307
parameter set. From Samba 4.6.0, the global template settings can be overwritten on a domain-basis by enabling theidmap config domain_name:unix_nss_info
parameter.
- The settings are applied to all users in each domain that has the
- Samba resolves the
%U
variable to the session user name. For details, see theVARIABLE SUBSTITUTIONS
section in thesmb.conf(5)
man page.
- Samba resolves the
- 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
primaryGroupID
attribute of each user entry, this is usually set to theDomain Users
group RID. This RID is then used to obtain thegidNumber
attribute from the Windows primary group.
- If you are running Samba 4.6.0 or later, you can optionally configure Samba to use the primary group set in the
gidNumber
attribute in the users entry instead. For example, when using theActive Directory Users and Computers
application, this attribute is displayed in theUNIX Attributes
tab. To use the group ID set in the usersgidNumber
attribute as primary group for each user instead of the Windows primary group, enable the following parameter in the[global]
section in yoursmb.conf
file:
idmap config SAMDOM:unix_primary_group = yes
{{#invoke:Message box|imbox}}
{{#invoke:Message box|imbox}}
- Reload Samba:
# smbcontrol all reload-config
For further details, see the smb.conf(5)
and idmap_ad(5)
man page.