PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : smbldap-tools



morpheus2001
28.11.05, 14:09
Hi,

ich habe samba, ldap mit smbldap tools aufgesetzt. Weiterhin benutze ich phpldapadmin um den Inhalt meiner LDAP Datenbank zu kontrollieren. Alles läuft bestens und ich kann smbldap-tools zum verwalten meiner Benutzer verwenden. (Auch smbldap-passwd zum Passwort ändern funktioniert in der Shell bestens).

Dann hab ich einen Testbenutzer eingerichtet. Mit diesem bin ich auf einem Windows Rechner der Samba Domain beigetreten. Auch hier alles super! Anmeldung und Profilmanagement funktioniert ebenfalls!

Mein Problem ist, wenn ich versuche über die Windows Workstation das Passwort von testuser zu ändern. Ich bekomme die Windows meldung (Win 2000 Pro) dass ich das Passwort nicht ändern darf! Weiterhin erhalte ich folgende Meldung in der Samba Log:


setting group sid S-1-5-21-*********-*********-*********-513 from rid 513
[2005/11/19 17:05:49, 4] passdb/pdb_ldap.c:ldapsam_update_sam_account(1693)
ldapsam_update_sam_account: user testuser to be modified has dn: uid=testuser,ou=Users,dc=****,dc=****
[2005/11/19 17:05:49, 2] passdb/pdb_ldap.c:init_ldap_from_sam(912)
init_ldap_from_sam: Setting entry for user: testuser
[2005/11/19 17:05:49, 1] passdb/pdb_ldap.c:ldapsam_modify_entry(1495)
ldapsam_modify_entry: Failed to modify user dn= uid=testuser,ou=Users,dc=****,dc=****with: Insufficient access
[2005/11/19 17:05:49, 0] passdb/pdb_ldap.c:ldapsam_update_sam_account(1720)
ldapsam_update_sam_account: failed to modify user with uid = testuser, error: (Success)

Die Paramater sind meiner Meinung nach richtig gesetzt:
in smb.conf


(...)
# Alternative script for handling the samba users when using
# remote tools for user and group administration
add machine script = /usr/sbin/smbldap-useradd -w "%u"
add user script = /usr/sbin/smbldap-useradd -m "%u"
delete user script = /usr/sbin/smbldap-userdel "%u"
add group script = /usr/sbin/smbldap-groupadd -p "%g"
delete group script = /usr/sbin/smbldap-groupdel "%g"
add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
passwd program = /usr/sbin/smbldap-passwd %u
(...)




# -A 1 sets sambaPwdCanChange timestamp to 0 so that
# the user can change his password!
fileserver:~# smbldap-usermod -A 1 testuser
fileserver:~# smbldap-usershow testuser
dn: uid=morlock,ou=Users,dc=***,dc=***
objectClass: top,inetOrgPerson,posixAccount,shadowAccount,samba SamAccount
cn: Heinz Mustermann
uid: testuser
uidNumber: 524
gidNumber: 513
gecos: Heinz Mustermann
description: Heinz Mustermann
sambaLogonTime: 0
sambaLogoffTime: 2147483647
displayName: Heinz Mustermann
sambaSID: S-1-5-21-*********-*********-*********-2048
sambaPrimaryGroupSID: S-1-5-21-*********-*********-*********-513
sambaLogonScript: testuser.bat
sambaHomeDrive: P:
sambaLMPassword: *****************************
sambaAcctFlags: [U]
sambaNTPassword: *****************************
sambaPwdMustChange: 1140962305
sambaHomePath: \\fileserver\testuser
homeDirectory: /files/samba/homes/testuser
sambaProfilePath: \\fileserver\testuser\profile
sambaPwdLastSet: 1130799600
sambaPwdCanChange: 0
fileserver:~#


Eventuell hat jemand eine Idee!

Regards,
Daniel Morlock

ramsys
28.11.05, 14:43
aus aktuellem anlass: Poste mal deine slapd.conf

Gruß

morpheus2001
28.11.05, 14:55
# This is the main slapd configuration file. See slapd.conf(5) for more
# info on the configuration options.

################################################## #####################
# Global Directives:

# Features to permit
#allow bind_v2

# Schema and objectClass definitions
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/samba.schema

# Schema check allows for forcing entries to
# match schemas for their objectClasses's
schemacheck on

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile /var/run/slapd/slapd.pid

# List of arguments that were passed to the server
argsfile /var/run/slapd.args

# Read slapd.conf(5) for possible values
loglevel 0

# Where the dynamically loaded modules are stored
modulepath /usr/lib/ldap
#moduleload back_bdb
moduleload back_ldbm

################################################## #####################
# Specific Backend Directives for bdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
#backend bdb
#checkpoint 512 30
backend ldbm

################################################## #####################
# Specific Backend Directives for 'other':
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
#backend <other>

################################################## #####################
# Specific Directives for database #1, of type bdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
#database bdb
database ldbm

# The base of your directory in database #1
suffix "dc=***,dc=***"
rootdn "*******************************"
rootpw *********************************

# Where the database file are physically stored for database #1
directory "/var/lib/ldap"

# Indexing options for database #1
index objectClass,uidNumber,gidNumber eq
index cn,sn,uid,displayName pres,sub,eq
index memberUid,mail,givenname eq,subinitial
index sambaSID,sambaPrimaryGroupSID,sambaDomainName eq

# Save the time that the entry gets modified, for database #1
lastmod on

# Where to store the replica logs for database #1
# replogfile /var/lib/ldap/replog

# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# These access lines apply to database #1 only
#access to attrs=userPassword,sambaLMPassword,sambaNTPassword
# by self write
# by anonymous auth
# by * none
#access to *
# by * read

# users can authenticate and change their password
access to attrs=userPassword,sambaNTPassword,sambaLMPassword ,sambaPwdLastSet,sambaPwdMustChange
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by dn="cn=nssldap,ou=DSA,dc=***,dc=***" write
by self write
by anonymous auth
by * none

# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,gecos,homeDirectory,uid,ui dNumber,gidNumber,cn,memberUid
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * read

# somme attributes can be writable by users themselves
access to attrs=description,telephoneNumber
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by self write
by * read

# some attributes need to be writable for samba
access to attrs=cn,sambaLMPassword,sambaNTPassword,sambaPwdL astSet,sambaLogonTime,sambaLogoffTime,sambaKickoff Time,samb by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by self write
by * none

# samba need to be able to create the samba domain account
access to dn.base="dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# samba need to be able to create new users account
access to dn="ou=Users,dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# samba need to be able to create new groups account
access to dn="ou=Groups,dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# samba need to be able to create new computers account
access to dn="ou=Computers,dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# this can be omitted but we leave it: there could be other branch
# in the directory
access to *
by self read
by * none


Das fett markierte habe ich verändert, hier war vorher "by self read" eingetragen! Leider kann ich das momentan nicht testen, muss auf den Feierabend warten!

Dennoch bin ich für Anmerkungen etc. offen!!!
Gruß
Daniel

ramsys
28.11.05, 16:25
Ohne den rest der acls zu lesen kannst du das letzte none mal zum test in write ändern.
Wenn es dann immernoch nicht geht kann man zumindest schon mal die slapd.conf acls als fehlerquelle ausschliessen.

morpheus2001
03.12.05, 14:46
Hi, ich habe jetzt ein wenig herumprobiert! Es geht mit folgender slap.conf:


# This is the main slapd configuration file. See slapd.conf(5) for more
# info on the configuration options.

################################################## #####################
# Global Directives:

# Features to permit
#allow bind_v2

# Schema and objectClass definitions
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/samba.schema

# Schema check allows for forcing entries to
# match schemas for their objectClasses's
schemacheck on

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile /var/run/slapd/slapd.pid

# List of arguments that were passed to the server
argsfile /var/run/slapd.args

# Read slapd.conf(5) for possible values
loglevel 0

# Where the dynamically loaded modules are stored
modulepath /usr/lib/ldap
#moduleload back_bdb
moduleload back_ldbm

################################################## #####################
# Specific Backend Directives for bdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
#backend bdb
#checkpoint 512 30
backend ldbm

################################################## #####################
# Specific Backend Directives for 'other':
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
#backend <other>

################################################## #####################
# Specific Directives for database #1, of type bdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
#database bdb
database ldbm

# The base of your directory in database #1
suffix "dc=***,dc=***"
rootdn *****************************************
rootpw *****************************************

# Where the database file are physically stored for database #1
directory "/var/lib/ldap"

# Indexing options for database #1
index objectClass,uidNumber,gidNumber eq
index cn,sn,uid,displayName pres,sub,eq
index memberUid,mail,givenname eq,subinitial
index sambaSID,sambaPrimaryGroupSID,sambaDomainName eq

# Save the time that the entry gets modified, for database #1
lastmod on

# Where to store the replica logs for database #1
# replogfile /var/lib/ldap/replog

# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# Thesx e access lines apply to database #1 only
#access to attrs=userPassword,sambaLMPassword,sambaNTPassword
# by self write
# by anonymous auth
# by * none
#access to *
# by * read

# users can authenticate and change their password
access to attrs=userPassword,sambaNTPassword,sambaLMPassword ,sambaPwdLastSet,sambaPwdMustChange,sambaPwdCanCha nge
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by dn="cn=nssldap,ou=DSA,dc=***,dc=***" write
by self write
by users write
by anonymous auth
by * none


# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,gecos,homeDirectory,uid,ui dNumber,gidNumber,cn,memberUid
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * read

# somme attributes can be writable by users themselves
access to attrs=description,telephoneNumber
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by self write
by * read

# some attributes need to be writable for samba
access to attrs=cn,sambaLMPassword,sambaNTPassword,sambaPwdL astSet,sambaLogonTime,sambaLogoffTime,sambaKickoff Time,sambaPwdCanChange,sambaPwdMustChange,sambaAcc tFlags,displayName,sambaHomePath,sambaHomeDrive,sa mbaLogonScript,sambaProfilePath,description,sambaU serWorkstations,sambaPrimaryGroupSID,sambaDomainNa me,sambaSID,sambaGroupType,sambaNextRid,sambaNextG roupRid,sambaNextUserRid,sambaAlgorithmicRidBase
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by self read
by users write
by * none

# samba need to be able to create the samba domain account
access to dn.base="dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# samba need to be able to create new users account
access to dn="ou=Users,dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# samba need to be able to create new groups account
access to dn="ou=Groups,dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# samba need to be able to create new computers account
access to dn="ou=Computers,dc=***,dc=***"
by dn="cn=samba,ou=DSA,dc=***,dc=***" write
by dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" write
by * none

# this can be omitted but we leave it: there could be other branch
# in the directory
access to *
by users write
by * none

Wobei das rot hinterlegte by users write nicht funktioniert hat, und das blau hinterlegte by * none ich auch einmal in by * write umgeändert hab und das auch nichts gebracht hat! Aus Letzterem schließe ich, dass ich noch weitere Attribute für "users" schreibbar machen muss! Jemand ne gebründete Idee, welche??
Hierzu: Das gelb hinterlegte hab ich auch versucht, hat auch nix gebracht!

Wie gesagt das einzigste mit dem es funktioniert ist das grün hinterlegte by * write, was aber sicherheitstechnisch absolut unzureichend ist!

Weiterhin hab ich noch ein Schmankerl aus der syslog:

Dec 3 14:31:28 fileserver smbd[2690]: [2005/12/03 14:31:28, 0] passdb/pdb_ldap.c:ldapsam_update_sam_account(1720)
Dec 3 14:31:28 fileserver smbd[2690]: ldapsam_update_sam_account: failed to modify user with uid = morlock, error: (Success) was uns aber hier nicht viel weiter bringt.

Im Prinzip sollte ich nur wissen, auf welche Attribute ich zugreifen muss um das Passwort zu ändern! Aus der Samba Referenz ist nicht viel herauszuholen, im Samba IRC herrscht hierzu auch Stille :-(

So weit,
hoffe auf Hilfe ;-)

Gruß
Daniel

emba
04.12.05, 15:46
what about this?
http://www.idealx.org/prj/samba/smbldap-howto.en.html#htoc33

hab ich so implementiert

greez

morpheus2001
05.12.05, 11:38
Naja, meine ACL's sind identisch mit denen vom Idelx Samba OpenLdap Howto. Leider funktioniert es dennoch nicht.

Frage: Kannst du als Samba Benutzer in einer Windows 2k Workstation dein Passwort ändern?

Theoretisch vermute ich nein, denn schau dir die erste ACL an:
access to attrs=userPassword,sambaNTPassword,sambaLMPassword ,sambaPwdLastSet,sambaPwdMustChange
by dn="cn=samba,ou=DSA,dc=idealx,dc=org" write
by dn="cn=smbldap-tools,ou=DSA,dc=idealx,dc=org" write
by dn="cn=nssldap,ou=DSA,dc=idealx,dc=org" write
by self write
by anonymous auth
by * none Um dein Benutzer zu ändern, wird aber auch das sambaPwdChange Attribute geschrieben, woraus der Benutzer hier scheinbar keine Rechte hat!

Ich vermute mein Problem ist ein Missverständnis, was "by self" betrifft. Ich habe in der Manual nachgelesen, da steht:


The keyword self means access to an entry is allowed to the entry itself
The keyword users means access is granted to authenticated clients.

Eventuell kann mir hier jemand verständlich machen, wass mit "by self" gemeint ist: Soll das heißen, dass den jeweiligen Eintrag nur derjenige Lesen darf, der ihn auch getätigt hat?

Danke für Eure Bemühungen,
Gruß Daniel Morlock

emba
05.12.05, 14:35
was ist denn deine ldap samba dn (ldap admin dn)?

greez

morpheus2001
05.12.05, 14:38
ldap admin dn = cn=samba,ou=DSA,dc=***,dc=***

emba
05.12.05, 15:34
und deine dn hast du hoffentlich in der slapd.conf bei den ACLs auch so angepasst, oder?

greez

morpheus2001
08.12.05, 14:30
Hi,


by dn="cn=samba,ou=DSA,dc=***,dc=***" write jop, habe ich! Hab ja meine slap.conf oben gepostet, da kannst du ja sehen, dass ich sie angepasst habe :(

Leider habe ich immer noch keine Fortschritte gemacht! :confused:

Hoffe auch Hilfe! :o

Gruß
D.Morlock

emba
08.12.05, 15:08
wieso setzt du dein ein passwd program?
habe hier mehrere DCs im einsatz ohne diesen parameter mit smbldap-tools und ldap backend. änder bitte mal

greez

morpheus2001
08.12.05, 15:35
hmmm laut man smb.conf hat der passwd program Parameter keinen Default Wert. Deshalb denke ich, wenn du den Parameter nicht angibst, dann wird das smbpasswd Programm benutzt und nicht das smbldap-passwd Programm!
Was aber im Prinzip egal ist, ich werde das mal versuchen, eventuell klappt es mit dem smbpasswd Programm besser! :)

Danke & Gruß
Daniel

emba
08.12.05, 16:23
wieso sollte smbpasswd genutzt werden? es ist doch dann leer?
und setze bitte auch ldap passwd sync = yes

greez

morpheus2001
08.12.05, 17:10
wieso sollte smbpasswd genutzt werden? es ist doch dann leer? Samba selbst kann meines Wissens das Passwort nicht ändern, sondern ruft hierfür ein Programm auf. Das Standardprogramm ist "smbpasswd". Du kannst hierfür ein eigenens Programm benutzen, dass du dann mit dem "passwd program" Parameter definierst.


und setze bitte auch ldap passwd sync = yes ich verwalte ausschließlich SAMBA Benutzer in meiner Ldap Datenbank, keine UNIX Systembenutzer, somit ist für jeden Benutzer in der LDAP Datenbank nur "lmPassword" und "ntPassword" relevant ("password" für UNIX Benutzer nicht). Diese beiden Attribute werden laut smb.conf auch dann aktualisiert, wenn "ldap passwd sync = NO" gesetzt ist. Wenn ich "ldap passwd sync = YES" setze, dann wird auch das "password" Feld meiner Benutzer gesetzt, was aber nur für UNIX Systembenutzer sinnvoll ist, nicht aber für meine Zwecke!

Gruß

emba
08.12.05, 17:15
zu letzterem: ich wusste nicht, dass du nur samba attribute pflegen möchtest. ignorier mein post dazu.

zum smbpasswd: du kannst sicherlich im quellcode irgendeine angabe dazu finden. laut doku ist dieses feld, wenn leer, nicht besetzt. mag sein, dass ein paar routinen vom smbpasswd code genutzt werden. selbst wenn: versuchs doch einfach mal ;) (ich mein, leer lassen)

greez

morpheus2001
08.12.05, 17:21
werde den Tipp mit dem passwd program Parameter auf jeden Fall am Wochenende testen, und hier das Resultat posten. (Ich kann momentan keine Tests durchführen, muss auf das Wochenende warten, bist keine Mitarbeiter den Server benutzen)

Meine Vermuting: Eventuell wird (mit gesetztem passwd program Parameter) ein falscher Benutzer verwendet um das Passwort zu aktualisieren! Deshalb denke ich, dass die Lösung meines Problem hier liegen könnte!

Bin gespannt auf das WE ;)
Danke dir für deine schnelle Hilfestellung! :)

emba
09.12.05, 08:43
jep, diese vermutung habe ich auch

greez

morpheus2001
10.12.05, 18:44
Ich habe den "passwd Parameter" wie besprochen aus der smb.conf herausgenommen und eine Passwortänderung versucht. Leider kam stets die selbe Fehlermeldung! :mad: Und genau das hat mich stuzig gemacht, normalerweise wird ja im entsprechenden Log Level auch noch der vollständige Befehl angezeigt, welcher ausgeführt wird um ein Passwort zu ändern: "smbldap-passwd my_user" u.ä. Naja auf jeden Fall hab ich danach manuell versucht mit smbpasswd mein Passwort zu ändern, was fehl schlug und was mir die selbe Fehlermeldung brachte, wie sie die ganze Zeit in der Log Datei von Samba erschien! Also hab ich etwas am "ldap admin dn" Parameter in der smb.conf herumgespielt und bemerkt, dass der smbpasswd und somit die Passwortänderung über Windows funktioniert, wenn ich hier den LDAP Master angebe! Natürlich auch nicht Sinn der Sache!
Daraufhin hab ich den loglevel in meiner slapd.conf auf 265 gesetzt und fand in der LDAP Log Datei die Lösung meines Problems:


Dec 10 17:52:52 fileserver slapd[2353]: conn=0 fd=9 ACCEPT from IP=127.0.0.1:33002 (IP=0.0.0.0:389)
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=0 BIND dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" method=128
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=0 BIND dn="cn=smbldap-tools,ou=DSA,dc=***,dc=***" mech=SIMPLE ssf=0
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=0 RESULT tag=97 err=0 text=
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=1 SRCH base="" scope=0 deref=0 filter="(objectClass=*)"
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=1 SRCH attr=supportedControl
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=2 SRCH base="dc=***,dc=***" scope=2 deref=0 filter="(&(objectClass=sambaDomain)(sambaDomainName=***.***) )"
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=2 SRCH attr=sambaDomainName sambaNextRid sambaNextUserRid sambaNextGroupRid sambaSID sambaAlgorithmicRidBase objectClass
Dec 10 17:52:52 fileserver slapd[2356]: conn=0 op=2 SEARCH RESULT tag=101 err=0 nentries=1 text=
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 op=3 SRCH base="dc=***,dc=***" scope=2 deref=0 filter="(&(uid=morlock)(objectClass=sambaSamAccount))"
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 op=3 SRCH attr=uid uidNumber gidNumber homeDirectory sambaPwdLastSet sambaPwdCanChange sambaPwdMustChange sambaLogonTime sambaLogoffTime sambaKickoffTime cn displayName sambaHomeDrive sambaHomePath sambaLogonScript sambaProfilePath description sambaUserWorkstations sambaSID sambaPrimaryGroupSID sambaLMPassword sambaNTPassword sambaDomainName objectClass sambaAcctFlags sambaMungedDial sambaBadPasswordCount sambaBadPasswordTime sambaPasswordHistory modifyTimestamp sambaLogonHours modifyTimestamp
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 op=3 SEARCH RESULT tag=101 err=0 nentries=1 text=
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 op=4 MOD dn="uid=morlock,ou=Users,dc=***,dc=***"
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 op=4 MOD attr=sambaPwdCanChange sambaPwdCanChange sambaPasswordHistory sambaPwdLastSet sambaPwdLastSet
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 op=4 RESULT tag=103 err=50 text=
Dec 10 17:52:59 fileserver slapd[2356]: conn=0 fd=9 closed

In der slapd.conf wurde dem "samba" Benutzer keine Schreibrechte für sambaPasswordHistory gewährt! Nachdem ich die Schreibrechte für das fehlende Attribut gesetzt habe, dann hat das ganze funktioniert :D

Zu Guter Letzt bleiben noch 1 Frage:
Wieso benutzt Samba trotz dass ich beim "passwd program" Parameter das smbldap-passwd Tool angegeben habe, immer noch das smbpasswd Programm?

Soweit, bedanke ich mich für Deine Hilfe!!
Gruß

Daniel

emba
11.12.05, 16:01
hättest du den link, den ich oben gepostet habe (hier nochmal: http://www.idealx.org/prj/samba/smbldap-howto.en.html#htoc33) gleich befolgt, dann wärst du schneller zum ziel gekommen, denn da steht genau das drin, was du nun geändert hast - egal...

zum smbpasswd programm:
wenn du dir die man genau durchliest, wirst du sehen, dass passwd program nicht das programm zum ändern des NT-Passwords ist, sondern das programm zum ändern des unix passwords


passwd program (G)

The name of a program that can be used to set UNIX user password
...



zur änderung des NT-Passwords nutzt samba (anscheinend) teile des smbpasswd programms. es wäre unsinnig, wenn sie smbpasswd komplett nutzen würden, da es interaktiv ist (zumindest ohne -s)

greez

greez

morpheus2001
11.12.05, 19:19
Ich hab mich an dieses Howto gehalten: http://howto.hopto.org/HowTos/Samba/SmbLDAP/SmbLdapHowTo/050000/050100, was im Nachhinein ungünstig war, das es nur so von Fehlern wimmelt, die ich jetzt gottseidank alle ausgemärzt habe! Die ACL's stimmen überall überein, nur der sambaPasswordHistory Parameter fehlte in diesem Howto, warum auch immer :mad:

Jo, das mit dem smbpasswd macht Sinn! Hätte ich die Manual aufmerksamer gelesen, dann hätte ich das bestimmt früher bemerkt ... :o

Gestern Nachmittag kam mir noch eine weitere Frage auf: Es wäre günstig, wenn es möglich ist, den Maschinenname zu ändern. Dafür habe ich folgendes ausprobiert:

Windows: Samba Domäne beitreten mit Machine "PC001", Neustart, Test!
Windows: Login als lokaler Administrator, versuche "PC001" in "PC001a" zu ändern. Nach Abfrage des Benutzernamens und Passwortes bekomme ich auf Windows: "Zugriff verweigert". In der Samba Log folgende Meldung:


[2005/12/10 18:00:08, 2] passdb/pdb_ldap.c:init_sam_from_ldap(499)
init_sam_from_ldap: Entry found for user: Administrator
[2005/12/10 18:00:08, 2] auth/auth.c:check_ntlm_password(305)
check_ntlm_password: authentication for user [Administrator] -> [Administrator] -> [Administrator] succeeded
[2005/12/10 18:00:08, 2] lib/access.c:check_access(324)
Allowed connection from (192.168.1.227)
[2005/12/10 18:00:08, 2] rpc_server/srv_samr_nt.c:_samr_lookup_domain(2580)
Returning domain sid for domain ***.*** -> S-1-5-21-1372503016-2141159300-2613394277
[2005/12/10 18:00:08, 2] passdb/pdb_ldap.c:init_sam_from_ldap(499)
init_sam_from_ldap: Entry found for user: pc001$
[2005/12/10 18:00:08, 2] passdb/pdb_ldap.c:init_sam_from_ldap(499)
init_sam_from_ldap: Entry found for user: pc001$
[2005/12/10 18:00:08, 2] rpc_server/srv_samr_nt.c:access_check_samr_function(220)
_samr_set_userinfo2: ACCESS DENIED (granted: 0x000d04e4; required: 0x000000b0)

Googeln bracht bisher noch nicht viel! Eventuell hast du eine Idee! Es scheint sich diesmal nicht um ein LDAP ACL Problem zu handeln!

Gruß
D.Morlock

emba
12.12.05, 08:04
dieses verhalten ist "normal" - jedenfalls habe ich über ähnliches gelesen und keine lösung dafür entdeckt. für mich auch nicht relevant.

du musst die maschine also vorher "disconnecten" von der domäne
sicherlich kann man das auch skriptgesteuert machen

greez