Bug 16765 - Vertrauensstellung: Windows -> UCS
Vertrauensstellung: Windows -> UCS
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba
UCS 2.3
Other Linux
: P5 normal (vote)
: UCS 2.3
Assigned To: Arvid Requate
Andreas Büsching
:
Depends on:
Blocks: 16806
  Show dependency treegraph
 
Reported: 2009-12-08 14:05 CET by Andreas Büsching
Modified: 2009-12-21 08:49 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Büsching univentionstaff 2009-12-08 14:05:09 CET
Bei der Einrichtung eines Vertrauenstellungskontos unter Windows NT wird eine Meldung angezeigt, dass das Konto nicht verifiziert werden konnte. Im Samba-Log der UCS-Domäne sind dazu die folgenden Meldungen zu finden.

[2009/12/08 21:33:04,  5] auth/auth_util.c:is_trusted_domain(2173)
  is_trusted_domain: Checking for domain trust with [TESTDOMAIN]
[2009/12/08 21:33:04,  5] lib/smbldap.c:smbldap_search_ext(1261)
  smbldap_search_ext: base => [sambaDomainName=TESTDOMAIN,sambaDomainName=UCS,cn=samba,dc=ucs,dc=test], filter => [(&(objectClass=sambaTrustedDomainPassword)(sambaDomainName=TESTDOMAIN))], scope => [2]
[2009/12/08 21:33:04,  5] lib/smbldap.c:smbldap_close(1163)
  The connection to the LDAP server was closed
[2009/12/08 21:33:04,  3] lib/smbldap.c:smb_ldap_start_tls(660)
  StartTLS issued: using a TLS connection
[2009/12/08 21:33:04,  2] lib/smbldap.c:smbldap_open_connection(856)
  smbldap_open_connection: connection opened
[2009/12/08 21:33:04,  3] lib/smbldap.c:smbldap_connect_system(1067)
  ldap_connect_system: successful connection to the LDAP server
[2009/12/08 21:33:04,  4] lib/smbldap.c:smbldap_open(1143)
  The LDAP server is successfully connected
[2009/12/08 21:33:04,  3] smbd/sec_ctx.c:pop_sec_ctx(432)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2009/12/08 21:33:04,  5] libsmb/trustdom_cache.c:trustdom_cache_fetch(183)
  no entry for trusted domain TESTDOMAIN found.

Scheinbar wird hier mit einem LDAP-Filter nach dem Trustaccount gesucht, der nicht auf unserer Konto zutrifft. Der Trustdom Account unter UCS ist allerdings vorhanden:

dn: cn=TESTDOMAIN,cn=computers,dc=ucs,dc=test
uid: TESTDOMAIN$
objectClass: top
objectClass: person
objectClass: sambaSamAccount
sambaAcctFlags: [I          ]
sambaSID: S-1-5-21-3793870911-1713067525-1580583430-5012
sn: TESTDOMAIN
sambaLMPassword: 3CC16AE8CE3F6C8A31283C286CD09B63
sambaNTPassword: CAA1239D44DA7EDF926BCE39F5C65D0F
cn: TESTDOMAIN
Comment 1 Andreas Büsching univentionstaff 2009-12-08 15:05:50 CET
Mit Windows 2k3 tritt das gleiche Problem auf
Comment 2 Stefan Gohmann univentionstaff 2009-12-08 15:28:32 CET
Arvid, bitte mal prüfen. Ich denke das ist ein Blocker für das Release, zumindest die NT4-Vertrauensstellung muss gehen.
Comment 3 Arvid Requate univentionstaff 2009-12-08 16:51:35 CET
Die Objectclass sambaTrustedDomainPassword ist schon in SAMBA_3_0 eingecheckt worden und sollte das Passwort speichert, dass in "net rpc trustdom establish" auf Samba-Seite eingegeben werden muss, um eine unidirektionale Vertrauensstellung zwischen Windows und Samba (Samba-Domäne vertraut Windows-Domäne) herzustellen:

http://lists.samba.org/archive/samba-technical/2007-January/051108.html
und Schema-Änderung in SAMBA_3_2_0
http://www.mail-archive.com/samba-cvs@lists.samba.org/msg45504.html
Comment 4 Arvid Requate univentionstaff 2009-12-08 18:01:38 CET
A) Bei der Vertrauensstellung Samba <- Windows NT4 (Windows vertraut Samba) erhält man eine Fehlermeldung von Windows NT bei der Eingabe des Passworts des 'TESTDOMAIN' Trust Accounts:
"Die Vertrauensstellung konnte zu diesem Zeitpunkt nicht überprüft werden. Falls keine Vertrauensstellung eingerichtet wurde, wenden Sie sich an den Administrator der Domäne UCS, und stellen Sie sicher, daß diese Domäne die Domäne TESTDOMAIN berechtigt hat, ihr zu vertrauen."

Authentifizierung der UCS Benutzer an der NT Domäne TESTDOMAIN geht trotzdem. Der Grund für die Fehlermeldung ist noch unklar.

B) Die Vertrauensstellung Samba -> Windows NT4 (Samba vertraut Windows) konnte mit 'net rpc trustdom establish' eingerichtet werden, nachdem Doku Bug 16775 behoben wurde.
Nach Installation von winbind (und samba restart; winbind restart) kann man die Benutzer per winbind auflösen, ssh login geht aber noch nicht:

root@m110:~# wbinfo -i TESTDOMAIN+robin
TESTDOMAIN+robin:*:55000:55000:Robin Hood:/home/TESTDOMAIN-robin:/bin/bash

root@m110:~# ssh localhost -l 'TESTDOMAIN+robin'
TESTDOMAIN+robin@localhost's password:
Permission denied, please try again.
TESTDOMAIN+robin@localhost's password:

In auth.log steht dazu:
Dec  8 19:30:19 m110 sshd[16393]: pam_winbind(sshd:auth): getting password (0x00000010)
Dec  8 19:30:19 m110 sshd[16393]: pam_winbind(sshd:auth): pam_get_item returned a password
Dec  8 19:30:19 m110 sshd[16393]: pam_winbind(sshd:auth): request wbcLogonUser failed: WBC_ERR_AUTH_ERROR, PAM error: PAM_AUTH_ERR (7), NTSTATUS: NT_STATUS_WRONG_PASSWORD, Error message was: Wrong Password
Dec  8 19:30:19 m110 sshd[16393]: pam_winbind(sshd:auth): user 'TESTDOMAIN+robin' denied access (incorrect password or invalid membership)
Dec  8 19:30:21 m110 sshd[16393]: Failed password for invalid user TESTDOMAIN+robin from 127.0.0.1 port 50349 ssh2
Comment 5 Arvid Requate univentionstaff 2009-12-08 18:43:53 CET
Zu B) Vertrauensstellung Samba -> Windows NT4 (Samba vertraut Windows):

Mit neuem NT-User und samba stop; winbind stop; samba start; winbind start funktioniert
root@m110:~# smbclient -L localhost -U "TESTDOMAIN+arvid"

aber ein SSH-Login hängt nach der Passwort-Überprüfung mit folgender Meldung im auth.log:

Dec  8 19:46:27 m110 sshd[17634]: pam_winbind(sshd:auth): internal module error (retval = PAM_AUTHINFO_UNAVAIL(9), user = 'TESTDOMAIN+arvid')
Dec  8 19:46:29 m110 sshd[17634]: Failed password for invalid user TESTDOMAIN+arvid from 127.0.0.1 port 43410 ssh2

und der obige smbclient-Aufruf hängt danach ebenfalls. Im log.smbd findet man
-----------------------------
  check_ntlm_password:  Checking password for unmapped user [TESTDOMAIN]\[arvid]
@[M110] with the new password interface
[2009/12/08 20:09:31,  3] auth/auth.c:check_ntlm_password(223)
  check_ntlm_password:  mapped user is: [TESTDOMAIN]\[arvid]@[M110]
[2009/12/08 20:09:31,  3] smbd/sec_ctx.c:push_sec_ctx(224)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2009/12/08 20:09:31,  3] smbd/uid.c:push_conn_ctx(440)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2009/12/08 20:09:31,  3] smbd/sec_ctx.c:set_sec_ctx(324)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2009/12/08 20:09:31,  3] smbd/sec_ctx.c:pop_sec_ctx(432)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2009/12/08 20:09:31,  0] auth/auth_winbind.c:check_winbind_security(101)
  check_winbind_security: ERROR!  my_private_data == NULL!
[2009/12/08 20:09:31,  2] auth/auth.c:check_ntlm_password(318)
  check_ntlm_password:  Authentication for user [arvid] -> [arvid] FAILED with e
rror NT_STATUS_LOGON_FAILURE
-----------------------------

Winbind scheint hier Probleme zu haben:

 invoke-rc.d samba stop; wait 5; invoke-rc.d samba start; net rpc trustdom list

geht, aber wenn man winbind neu gestartet hat, antwortet samba nicht mehr richtig

 invoke-rc.d winbind restart; sleep 3; net rpc trustdom list

und es hängt mit 'Receiving SMB: Server stopped responding'.
Comment 6 Arvid Requate univentionstaff 2009-12-08 19:17:15 CET
Zu A) Vertrauensstellung Samba <- Windows NT4 (Windows vertraut Samba)

Man sieht in log.smbd zwei Auffälligkeiten beim Anlegen der Vertauensstellung im NT User Manager:
 1. Ein erster Versuch wird anscheinend mit NT_STATUS_PASSWORD_MUST_CHANGE beantwortet (keinen Ahnung ob das für Trust-Accounts normal ist, das hatte ich auch schon im Test mit "smbclient -L localhost -U TESTDOMAIN$" beobachtet).

 2. Nach einen Anonymen Logon erhält man im dritten Block des Protokolls unten wieder die Meldung 'check_winbind_security: ERROR!' (Ich hatte vor diesem Test aber winbind extra gestoppt, um auszuschliessen, dass sie durch ein winbind-Problem verursacht wird).

-----------------------<gekürztes Log>----------------------------------
[2009/12/08 20:25:38,  2] smbd/reply.c:reply_special(499)
  netbios connect: local=m110 remote=nt4server, name type = 0
[2009/12/08 20:25:39,  3] auth/auth.c:check_ntlm_password(220)
  check_ntlm_password:  Checking password for unmapped user [UCS]\[TESTDOMAIN$]@
[nt4server] with the new password interface
[2009/12/08 20:25:39,  3] auth/auth.c:check_ntlm_password(223)
  check_ntlm_password:  mapped user is: [UCS]\[TESTDOMAIN$]@[nt4server]
[2009/12/08 20:25:39,  0] passdb/pdb_get_set.c:pdb_get_group_sid(210)
  pdb_get_group_sid: Failed to find Unix account for TESTDOMAIN$
2009/12/08 20:25:39,  4] libsmb/ntlm_check.c:ntlm_password_check(328)
  ntlm_password_check: Checking NT MD4 password
[2009/12/08 20:25:39,  4] auth/auth_sam.c:sam_account_ok(137)
  sam_account_ok: Checking SMB password for user TESTDOMAIN$
[2009/12/08 20:25:39,  1] auth/auth_sam.c:sam_account_ok(172)
  sam_account_ok: Account for user 'TESTDOMAIN$' password must change!.
[2009/12/08 20:25:39,  3] auth/auth_winbind.c:check_winbind_security(54)
  check_winbind_security: Not using winbind, requested domain [UCS] was for this SAM.
[2009/12/08 20:25:39,  2] auth/auth.c:check_ntlm_password(318)
  check_ntlm_password:  Authentication for user [TESTDOMAIN$] -> [TESTDOMAIN$] FAILED with error NT_STATUS_PASSWORD_MUST_CHANGE

[2009/12/08 20:25:39,  2] smbd/reply.c:reply_special(499)
  netbios connect: local=m110 remote=nt4server, name type = 0
[2009/12/08 20:25:39,  3] smbd/process.c:switch_message(1393)
  switch message SMBnegprot (pid 21135) conn 0x0
[2009/12/08 20:25:39,  3] smbd/sesssetup.c:reply_sesssetup_and_X(1627)
  sesssetupX:name=[]\[]@[nt4server]
[2009/12/08 20:25:39,  3] smbd/service.c:make_connection_snum(1119)
  nt4server (::ffff:10.200.15.64) connect to service IPC$ initially as user nobo
dy (uid=65534, gid=65534) (pid 21135)

[2009/12/08 20:25:39,  2] smbd/reply.c:reply_special(499)
  netbios connect: local=m110 remote=nt4server, name type = 0
[2009/12/08 20:25:39,  3] smbd/sesssetup.c:reply_sesssetup_and_X(1627)
  sesssetupX:name=[TESTDOMAIN]\[Administrator]@[nt4server]
[2009/12/08 20:25:39,  3] auth/auth.c:check_ntlm_password(220)
  check_ntlm_password:  Checking password for unmapped user [TESTDOMAIN]\[Admini
strator]@[nt4server] with the new password interface
[2009/12/08 20:25:39,  3] auth/auth.c:check_ntlm_password(223)
  check_ntlm_password:  mapped user is: [TESTDOMAIN]\[Administrator]@[nt4server]
[2009/12/08 20:25:39,  0] auth/auth_winbind.c:check_winbind_security(101)
  check_winbind_security: ERROR!  my_private_data == NULL!
[2009/12/08 20:25:39,  2] auth/auth.c:check_ntlm_password(318)
  check_ntlm_password:  Authentication for user [Administrator] -> [Administrato
r] FAILED with error NT_STATUS_LOGON_FAILURE
-----------------------</gekürztes Log>----------------------------------
Comment 7 Arvid Requate univentionstaff 2009-12-09 19:54:02 CET
Zu A) Vertrauensstellung Samba <- Windows NT4 (Windows vertraut Samba):

Die Fehlermeldung tritt auch auf bei Tests mit UCS 2.2-2 (Samba 3.2.13) UCS 2.2-0 (Samba 3.2.8) und UCS 2.1-0 (Samba 3.0.30).
Login der UCS Benutzer am NT Server ist anscheinend trotzdem problemlos möglich.

Zu B) Vertrauensstellung Samba -> Windows NT4 (Samba vertraut Windows):

Die Ursache für die Fehlfunktion von Winbind scheint hier darin zu liegen, dass die Konfiguration für winbind idmap in Samba 3.3.0 erneut geändert wurde.
Dadurch scheinen sowohl SID-Suche als auch UID-Allozierung in der Samba-Voreinstellung mit einem anonymen LDAP-Bind zu verlaufen.

Das Template smb.conf.d/21univention-samba_winbind wurde so angepasst, dass sowohl SID-Suche als auch UID-Allozierung mit dem DN durchgeführt wird, der auch in 'ldap admin dn' eingetragen ist. Für die SID-Suche scheint leider jeweils die Domäne mit angegeben werden zu müssen, daher gibt es eine neue UCR-Variable 'samba/idmap/domains', in der die Domänen eingetragen werden müssen, für die das SID-mapping über idmap_ldap gegen den UCS Verzeichnis aufgelöst werden soll. Falls die Variable während der Ausführung des univention-samba Join-Scripts noch leer ist, werden die Domain Trust Accounts, die im UCS-Verzeichnis gefunden werden, in die UCS-Variable eingetragen.
Bei jedem Join wird für alle Domänen in 'samba/idmap/domains' mit 'net idmap secret' das Passwort für den 'ldap admin dn' in einer TDB hinterlegt.
Die UCS-Domäne wird da zur Zeit nicht eingetragen.

Changelog:

\item Die Konfiguration für winbind idmap wurde auf die Änderungen in Samba 3.3.x angepasst. Für Vertrauensstellungen, in denen UCS Samba so konfiguriert wurde, dass Benutzer einer Windows Domäne Ressourcen der UCS Domäne nutzen können, muss nun der Domänenname in die neue \ucsUCRV{samba/idmap/domains} eingetragen werden. Beim Ausführen des Join Scripts des neuen Paketes \ucsName{univention-samba} werden die Domain Trust Accounts aus dem UCS Verzeichnisdienst abgefragt und in die UCR Variable eingetragen, falls die \ucsUCRV{} zu dem Zeitpunkt noch leer ist. (Bug 16765)
Comment 8 Arvid Requate univentionstaff 2009-12-10 11:53:41 CET
Die Initialisierung von samba/idmap/domains wurde nochmal angepasst, weil da die Domänen rein müssen, denen UCS vertraut. Falls Winbind beim Join läuft werden diese jetzt per wbinfo ermittelt. Das Changelog ist entsprechend angepasst.

Winbind wird in diesem Fall danach für den Verlauf des Join Scripts gestoppt und am Ende des Join Scripts erneut gestartet (auf einen anschliessenden nscd restart wird bisher verzichtet).

Per Dokumentation wird darauf hingewiesen, dass für einen korrekten Betrieb von winbind auf Master, Backup und Slave 'net join MEMBER -U Administrator' ausgeführt werden sollte (Auf Member Servern ist das schon der Fall).
Comment 9 Andreas Büsching univentionstaff 2009-12-10 12:39:51 CET
/usr/lib/univention-install/26univention-samba.inst: command substitution: line 56: syntax error near unexpected token `('
/usr/lib/univention-install/26univention-samba.inst: command substitution: line 56: `grep -vxF -f <(wbinfo --own-domain) <(wbinfo -m) | grep -v BUILTIN'
Comment 10 Arvid Requate univentionstaff 2009-12-10 14:36:47 CET
Die Syntax geht anscheinend mit  /bin/sh nicht. Workaround ist eingechecked und gebaut.
Comment 11 Andreas Büsching univentionstaff 2009-12-10 15:03:24 CET
(In reply to comment #10)
> Die Syntax geht anscheinend mit  /bin/sh nicht. Workaround ist eingechecked und
> gebaut.

Funktioniert jetzt
Comment 12 Stefan Gohmann univentionstaff 2009-12-21 08:49:16 CET
UCS 2.3 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden: "Clone This Bug".