Hallo,

ich steh hier vor dem Problem, daß die Anmeldung mit einem
Windows-Benutzer nicht funktioniert, also winbind scheinbar noch nicht
korrekt läuft.

Ein w2k-Server (DC,Fileserver) und ein w2k3-Terminalserver und Clients
(w2k/XP/Vista/W7) sind am Start.
Auf dem TS wird zwingend ADS benötigt und der w2k soll durch einen
Linux-Server (Squeeze) ersetzt werden, der das ADS leider nicht
übernehmen kann.
Deshalb wurde das ADS-Schema des w2k entsprechend angehoben und der TS
als DC (dc.workgroup.local) hinzugefügt. So der aktuelle Stand auf der
Windows-Seite.

Auf der Linux-Seite wurde Kerberos konfiguriert und Samba konnte der
Domäne beitreten.
> net ads join -S dc.workgroup.local -U administrator%<PASS>
> net ads testjoin
Join is OK

mit 'net usersidlist' sehe ich auch die Benutzer aus dem ADS:
SAMBA-SERVER\administrator
 S-1-5-21-SAMBA-SID-500
 S-1-1-0
 S-1-5-2
 S-1-5-11
 S-1-5-21-SAMBA-SID-512

gast
 S-1-5-21-DOMAIN-SID-501
 S-1-1-0
 S-1-5-2
 S-1-5-11

winuser1
 S-1-5-21-DOMAIN-SID-1002
 S-1-1-0
 S-1-5-2
 S-1-5-11


'getent passwd' zeigt leider nichts davon.
> getent passwd
root:x:0:0:root:/root:/bin/bash
...
ldapuser1:*:10001:10001:<gecos>:/home/ldapuser1:/bin/bash
Administrator:*:20000:20001:Administrator:/home/Administrator:/bin/false
nobody:*:65534:65534:nobody:/nonexistent:/bin/sh

Die letzten 3 Einträge stammen aus dem LDAP-Verzeichnis. Ich kann mich
mit einem LDAP-User sowohl auf der Console, als auch mit smbclient am
Samba-Server anmelden.

> grep winbind /etc/nsswitch.conf
passwd:         compat winbind ldap
group:          compat winbind ldap

> cat /etc/pam.d/common-* |grep -v ^#
###################################################################
account [success=2 new_authtok_reqd=done default=ignore] pam_unix.so
account [success=1 new_authtok_reqd=done default=ignore] pam_winbind.so
account requisite                       pam_deny.so
account required                        pam_permit.so
account [success=ok new_authtok_reqd=done ignore=ignore
user_unknown=ignore authinfo_unavail=ignore default=bad] pam_ldap.so
minimum_uid=1000

auth    [success=3 default=ignore]      pam_unix.so nullok_secure
auth    [success=2 default=ignore]      pam_winbind.so krb5_auth
krb5_ccache_type=FILE cached_login try_first_pass debug
auth    [success=1 default=ignore]      pam_ldap.so minimum_uid=1000 
use_first_pass
auth    requisite                       pam_deny.so
auth    required                        pam_permit.so

password [success=3 default=ignore]     pam_unix.so obscure sha512
password [success=2 default=ignore]     pam_winbind.so use_authtok
try_first_pass
password [success=1 default=ignore]     pam_ldap.so minimum_uid=1000
try_first_pass
password requisite                      pam_deny.so
password required                       pam_permit.so

session [default=1]                     pam_permit.so
session requisite                       pam_deny.so
session required                        pam_permit.so
session required        pam_unix.so
session optional                        pam_winbind.so
session [success=ok default=ignore]     pam_ldap.so minimum_uid=1000
session required        pam_mkhomedir.so skel=/etc/skel umask=0022
###################################################################

Die Secrets für LDAP und winbind wurden erfolgreich eingetragen mit:
> smbpasswd -w <PASS>
> net idmap secret WORKGROUP <PASS>
> net idmap secret alloc <PASS>

Verdächtig ist nur eine Zeile in der log.winbindd nach einem restart:
  connection_ok: Connection to  for domain WORKGROUP is not connected

log.winbindd:
################################################
[2011/04/20 16:07:49.985165,  0]
winbindd/winbindd_cache.c:3076(initialize_winbindd_cache)
  initialize_winbindd_cache: clearing cache and re-creating with version
number 1
[2011/04/20 16:07:49.993073,  2]
winbindd/winbindd_util.c:221(add_trusted_domain)
  Added domain BUILTIN  S-1-5-32
[2011/04/20 16:07:49.993127,  2]
winbindd/winbindd_util.c:221(add_trusted_domain)
  Added domain SAMBA-SERVER  S-1-5-21-SAMBA-SID
[2011/04/20 16:07:49.993181,  2]
winbindd/winbindd_util.c:221(add_trusted_domain)
  Added domain WORKGROUP WORKGROUP.LOCAL S-1-5-21-DOMAIN-SID
[2011/04/20 16:07:55.008881,  3] winbindd/winbindd_cm.c:1633(connection_ok)
  connection_ok: Connection to  for domain WORKGROUP is not connected
[2011/04/20 16:07:55.010095,  3]
libsmb/cliconnect.c:991(cli_session_setup_spnego)
  Doing spnego session setup (blob length=109)
[2011/04/20 16:07:55.010143,  3]
libsmb/cliconnect.c:1020(cli_session_setup_spnego)
  got OID=1.2.840.48018.1.2.2
  got OID=1.2.840.113554.1.2.2
  got OID=1.2.840.113554.1.2.2.3
  got OID=1.3.6.1.4.1.311.2.2.10
[2011/04/20 16:07:55.010170,  3]
libsmb/cliconnect.c:1030(cli_session_setup_spnego)
  got [email protected]
[2011/04/20 16:07:55.015985,  2]
libsmb/cliconnect.c:795(cli_session_setup_kerberos)
  Doing kerberos session setup
[2011/04/20 16:07:55.018529,  3]
libsmb/clikrb5.c:622(ads_cleanup_expired_creds)
  ads_cleanup_expired_creds: Ticket in ccache[MEMORY:cliconnect]
expiration Do, 21 Apr 2011 02:07:54 CEST
[2011/04/20 16:07:55.018563,  3] libsmb/clikrb5.c:840(ads_krb5_mk_req)
  ads_krb5_mk_req: server marked as OK to delegate to, building
forwardable TGT
################################################

Als idmap-Backend wird LDAP verwendet, die entsprechenden OUs sind
angelegt.
Die nachfolgende ldapsam:editposix-Konfiguration stammt aus dem Buch
OpenLDAP 2.4, 2. Auflage von Oliver Liebel (Galileo Computing).

smb.conf:
############################################
[global]
    workgroup = WORKGROUP
    server string = %h server
    wins support = no
    dns proxy = no
    log file = /var/log/samba/log.%m
    log level = 3
    max log size = 1000
    syslog = 1
    panic action = /usr/share/samba/panic-action %d
    obey pam restrictions = no

    security = ads
    realm = WORKGROUP.LOCAL
    encrypt passwords = yes
    unix password sync = yes

    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n
*Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    pam password change = yes
    password server = dc.workgroup.local

    passdb backend = ldapsam:ldap://127.0.0.1/
    ldap ssl = no
    ldapsam:trusted = yes
    ldapsam:editposix = yes
    ldap admin dn = cn=admin,dc=workgroup,dc=local
    ldap suffix = dc=workgroup,dc=local
    ldap user suffix = ou=people
    ldap group suffix = ou=group
    ldap machine suffix = ou=hosts
    ldap idmap suffix = ou=idmap
    ldap passwd sync = yes

    idmap backend = ldap:ldap://127.0.0.1/
    idmap config WORKGROUP:default = yes
    idmap config WORKGROUP:backend = ldap
    idmap config WORKGROUP:ldap_base_dn = ou=idmap,dc=workgroup,dc=local
    idmap config WORKGROUP:ldap_user_dn = cn=admin,dc=workgroup,dc=local
    idmap config WORKGROUP:ldap_url = ldap://127.0.0.1/
    idmap config WORKGROUP:range = 20000 - 29999

    idmap alloc backend = ldap
    idmap alloc config:ldap_base_dn = ou=idmap,dc=workgroup,dc=local
    idmap alloc config:ldap_user_dn = cn=admin,dc=workgroup,dc=local
    idmap alloc config:ldap_url = ldap://127.0.0.1/
    idmap alloc config:range = 20000 - 29999

    domain logons = no
    domain master = no
    preferred master = no
    time server = yes
    client use spnego = yes
    client schannel = no

    idmap uid = 20000-29999
    idmap gid = 20000-29999
    winbind enum users = yes
    winbind enum groups = yes
    winbind use default domain = yes
    template shell = /bin/false
    template homedir = /home/%u

[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S

[netlogon]
   comment = Network Logon Service
   path = /srv/daten/netlogon
   guest ok = yes
   read only = yes

[profiles]
   comment = Users profiles
   path = /srv/daten/profiles
   guest ok = no
   browseable = no
   create mask = 0600
   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
;   write list = root, @lpadmin
################################################

Hat jemand einen Ansatz, wo der Fehler stecken könnte?
Mir fehlen momentan neue Denkansätze.

Gruß
Rico

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Lug-dd maillist  -  [email protected]
https://ssl.schlittermann.de/mailman/listinfo/lug-dd

Antwort per Email an