web-dev-qa-db-ja.com

Sambaツールnetまたはrealm / sssdを使用してドメインに参加できません

Rhel7サーバーでサーバーをドメインに参加させようとしていますが、次のエラーが発生します。

net ads join -S domain.example.org -U name
Enter name's password:
Failed to join domain: failed to set machine kerberos encryption types: Insufficient access

Pam、krb5、samba、dns、およびリモートActive Directoryサーバー内のオブジェクトに関連する設定が正しく構成されているため、システムはrhel6とubuntu 14.04を使用して正常にバインドします。

発生している特定のエラーに関する多くの情報を見つけることができませんでした。 allow_weak_crypto = trueをkrb5.confに設定して、何かする必要があるかどうかを確認しようとしましたそれで、それは効果がありませんでした。

https://technet.Microsoft.com/en-us/library/bb463167.aspx でいくつかのトラブルシューティングのヒントを実行しましたが、運が悪かったため、試したものはうまく機能しているようです。

具体的には次のことができます。つまり、ユーザーの初期認証情報を取得できますname

kinit name
Password for [email protected]: 

ktutilを使用してkeytabファイルを生成することもでき、それを/etc/krb5.keytabに移動したときklist -e正しい内容を表示します。しかし、net ads joinが失敗し続けます。

編集:rhel7 sambaソースパッケージを調べたところ、README.dcで次のことがわかりました。

DC Kerberos KDCのサポートが準備でき次第、Samba AD MIT機能を提供します。

私はそれが問題であると思うので、準備ができるまで待つ必要があります。

Edit2:代わりにレルムとsssdを使用すると、同じ問題が発生するようです。実行後:

realm -v join --user=example ad.example.org

次のエラーが見つかりました。

* LANG=C /usr/sbin/adcli join --verbose --domain ad.example.org --domain-realm AD.EXAMPLE.ORG --domain-controller 192.0.2.11 --login-type user --login-user example --stdin-password
! Insufficient permissions to set encryption types on computer account: CN=example,OU=w,OU=x,DC=ad,DC=example,DC=org: 00002098: SecErr: DSID-03150BB9, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0

これはrhel6で動作することに注意してください。また、ADサーバーまたはそこで私のアカウントを変更する権限もありません。

Rhelバージョンは7.2であり、関連するパッケージは次のバージョンです。

Name        : realmd
Version     : 0.16.1
--
Name        : adcli
Version     : 0.7.5
--
Name        : krb5-workstation
Version     : 1.13.2
--
Name        : samba-common
Version     : 4.2.3

journalctl -e SYSLOG_IDENTIFIER = realmdのサニタイズされた出力:

Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using domain name: example.org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using computer account name: Host
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using domain realm: example.org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Calculated computer account name from fqdn: Host
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Generated 120 character computer password
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using keytab: FILE:/etc/krb5.keytab
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using fully qualified name: Host.example.org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using domain name: example.org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using computer account name: Host
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Using domain realm: example.org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Looked up short domain name: AD
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Found computer account for Host$ at: CN=Host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Set computer password
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Retrieved kvno '87' for computer account in directory: CN=Host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 Host.example.org realmd[25796]:  ! Insufficient permissions to set encryption types on computer account: CN=Host,OU=w,OU=x,DC=ad,DC=example,DC=org: 00002098: SecErr: DSID-03150BB9, problem 4003 (INSUFF_ACCESS_RIGHTS),  
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Modifying computer account: userAccountControl
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Modifying computer account: operatingSystem, operatingSystemVersion, operatingSystemServicePack
Jan 21 14:56:20 Host.example.org realmd[25796]:  ! Couldn't set operatingSystem, operatingSystemVersion, operatingSystemServicePack on computer account: CN=Host,OU=w,OU=x,DC=ad,DC=example,DC=org: Insufficient access
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Updated existing computer account: CN=Host,OU=w,OU=x,DC=ad,DC=example,DC=org
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Discovered which keytab salt to use
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Added the entries to the keytab: [email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Added the entries to the keytab: Host/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:20 Host.example.org realmd[25796]:  * Added the entries to the keytab: Host/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 Host.example.org realmd[25796]:  * Added the entries to the keytab: RestrictedKrbHost/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 Host.example.org realmd[25796]:  * Added the entries to the keytab: RestrictedKrbHost/[email protected]: FILE:/etc/krb5.keytab
Jan 21 14:56:21 Host.example.org realmd[25796]: process exited: 25879
Jan 21 14:56:21 Host.example.org realmd[25796]:  * /usr/bin/systemctl enable sssd.service
Jan 21 14:56:21 Host.example.org realmd[25796]: process started: 25880
Jan 21 14:56:21 Host.example.org realmd[25796]: Created symlink from /etc/systemd/system/multi-user.target.wants/sssd.service to /usr/lib/systemd/system/sssd.service.
Jan 21 14:56:21 Host.example.org realmd[25796]: process exited: 25880
Jan 21 14:56:21 Host.example.org realmd[25796]:  * /usr/bin/systemctl restart sssd.service
Jan 21 14:56:21 Host.example.org realmd[25796]: process started: 25894
Jan 21 14:56:22 Host.example.org realmd[25796]: process exited: 25894
Jan 21 14:56:22 Host.example.org realmd[25796]:  * /usr/bin/sh -c /usr/sbin/authconfig --update --enablesssd --enablesssdauth --enablemkhomedir --nostart && /usr/bin/systemctl enable oddjobd.service && /usr/bin/systemctl start oddjobd.se
Jan 21 14:56:22 Host.example.org realmd[25796]: process started: 25901
Jan 21 14:56:23 Host.example.org realmd[25796]: process exited: 25901
Jan 21 14:56:23 Host.example.org realmd[25796]:  * Successfully enrolled machine in realm
Jan 21 14:56:23 Host.example.org realmd[25796]: released daemon: current-invocation
Jan 21 14:56:23 Host.example.org realmd[25796]: client gone away: :1.3100
Jan 21 14:56:23 Host.example.org realmd[25796]: released daemon: :1.3100
Jan 21 14:57:23 Host.example.org realmd[25796]: quitting realmd service after timeout
Jan 21 14:57:23 Host.example.org realmd[25796]: stopping service

net ads -P statusのサニタイズ出力:

objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
objectClass: computer
cn: Host
distinguishedName: CN=Host,OU=w,OU=x,DC=ad,DC=example,DC=org
instanceType: 4
whenCreated: 2012
whenChanged: 2016
uSNCreated: 1687590
memberOf: CN=group,OU=groups,OU=w,DC=ad,DC=example,DC=org
uSNChanged: 1212121212
name: Host
objectGUID: x
userAccountControl: 6
badPwdCount: 0
codePage: 0
countryCode: 0
badPasswordTime: 1
lastLogoff: 0
lastLogon: 1
localPolicyFlags: 0
pwdLastSet: 1
primaryGroupID: 600
objectSid: S-1-5-21
accountExpires: 9
logonCount: 1
sAMAccountName: Host$
sAMAccountType: 8
dNSHostName: Host.ad.example.org
servicePrincipalName: RestrictedKrbHost/Host
servicePrincipalName: RestrictedKrbHost/Host.ad.example.org
servicePrincipalName: Host/host.ad.example.org
servicePrincipalName: Host/HOST
objectCategory: CN=Computer,CN=Schema,CN=Configuration,DC=ad,DC=example,DC=org
isCriticalSystemObject: FALSE
dSCorePropagationData: 2
dSCorePropagationData: 3
dSCorePropagationData: 4
dSCorePropagationData: 5
dSCorePropagationData: 6
lastLogonTimestamp: 1
3
aseq

この問題は、sambaが4.1から4.3のマイナーバージョンにアップグレードされた後、debianおよびubuntuでも発生するように見えました。つまり、Redhat固有ではありませんでした。余談ですが、私はredhatサポートに連絡しました。

解決策を見つけることはできませんでしたが、十分な回避策を見つけました。何らかの理由で特定の障害が発生すると、キータブが作成されないか、誤ったキータブが作成されます。 Active Directoryサーバーへのバインドは実際には成功しており、動作させるには新しいキータブを作成する必要があります。

ドメインに参加できませんでした:マシンのkerberos暗号化タイプを設定できませんでした:アクセスが不十分です

これを実行してキータブを作成します。

net -P ads keytab create

私はsambaを使い続けることを選択しましたが、レルムを使用するときは、この回避策も使用できると思います。

1
aseq

なぜネットを使うのですか? samba-toolでドメインに参加する必要があります

samba-tool domain join domain.example.org DC -Uadministrator --realm=domain.example.org

netは、共有やその他のことを除いて、samba 4では実際には使用されていません。
ケルベロス暗号設定をいじらないでください。

3

同じ問題がありました。realmプラスadcliが解決策でした。 realmはデフォルトでsamba-commonバックエンドを使用します。 realmdおよびadcliパッケージを取得して使用する

# realm join --membership-software=adcli -U <username> <domain>

adcliを直接使用する必要さえありません。同じアクセス許可エラーが発生しますが、暗号化タイプの拒否で失敗するのではなく、ドメインに参加し続けることに注意してください。

これは私に何週間も縛られました。私がそれを理解することができるまで、プロジェクトは結局遅れました私の痛みから学ぶ。

残念ながら、私が知る限り、adcliには、ADを変更せずに結合を確認する方法がないようです。確認するには、/ etc/samba/smb.confをバックアップして、(だけ)で置き換えます。

realm = <REALM>
workgroup = <WORKGROUP>

次に、net ads -P statusを実行して、新しく登録されたマシンアカウントに関する豊富な情報をADから取得します。 DCに対してldapsearchを使用して、Windowsツールで検索するか、AD管理者に尋ねることで同じことができますが、LDAPにどのオプションを使用すればよいかわからないので、自給自足を望みます。

多くの場合、adcli/netはマシンを登録しますが、sssd_adは、そのままではID管理に正しく機能しません。特に、RIDSが200000を超えるエンタープライズAD環境や、はるかに古いバージョンから数回更新されたエンタープライズAD環境では、一般的に問題が発生します。 net ads statusコマンドから結果を取得してもユーザー情報を取得できない場合は、sssdおよびsssd_adの問題を探します。 systemctl status sssd.serviceから始めるのが良いでしょう。ただし、sssd_adのマッピングと認証のトラブルシューティングは、元の質問の範囲外です。

追加のクレジット読み取り:

領域のドキュメント freedesktop.org。

adcliのドキュメント freedesktop.org。

sssd_adのマニュアルページ

3
doombird