PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Samba LDAP deaktiviert Accounts ?



morpheus2001
03.02.06, 13:53
Hi,

ich habe vor kurzem Samba 3 mit LDap Backend eingerichtet. Dabei habe ich mich auf die Dokumentationen http://howto.hopto.org/HowTos/Samba/SmbLDAP/SmbLdapHowTo/
und http://www.idealx.org/prj/samba/smbldap-howto.en.html#htoc16
gestützt.

Das System läuft soweit Fehlerfrei. Eine Sache jedoch macht mich etwas stuzig. Mir ist bereits mehrmals aufgefallen, dass sowohl Benutzereinträge, als auch Accounteinträge "deaktiviert" werden, wenn diese über eine längere Zeit nicht benutzt wurden. Sind die Benutzer "deaktiviert" so ist der Benutzereinträg in der LDAP Datenbank immer noch zu finden, ein Login an der Domain bzw. ein Aufruf von "pdbedit -vu <benutzername>" ist nicht möglich. Ich habe die "sambaKickoffTime" nicht gesetzt, nach http://gertranssmb3.berlios.de/output/passdb.html#id2530328 sollte das Konto also nie auslaufen.

Eventuell hat jemand ein Vorschlag ?

Gruß
D.Morlock

emba
03.02.06, 15:37
wenn das fehlschlägt "pdbedit -vu <benutzername>", hast du ein ernsthaftes problem. das hat dann nichts mehr mit irgendeiner policy zu tun.

hänge bitte mal an das pdbedit -d5 an und poste das log

greez

morpheus2001
06.02.06, 14:51
Hi,

da der Betroffene Account benötigt wurde, hab ich ihn erneut in die LDAP Datenbank eingetragen. Danach war er wieder erreichbar und das Problem gelöst. Das ist natürlich keine Endgültige Lösung. Da ich das Problem nicht rekonstruieren kann, muss ich auf ein erneutes Auftreten warten :(

Danke für die Hilfe,

Gruß
Daniel

morpheus2001
09.02.06, 13:54
Ok, da ist das Phänomen wieder:



fileserver:/# pdbedit -d5 k2lpc33$
INFO: Current debug levels:
all: True/5
tdb: False/0
printdrivers: False/0
lanman: False/0
smb: False/0
rpc_parse: False/0
rpc_srv: False/0
rpc_cli: False/0
passdb: False/0
sam: False/0
auth: False/0
winbind: False/0
vfs: False/0
idmap: False/0
quota: False/0
acls: False/0
locking: False/0
msdfs: False/0
lp_load: refreshing parameters
Initialising global parameters
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
doing parameter security = user
doing parameter enable privileges = yes
doing parameter share modes = yes
doing parameter encrypt passwords = true
doing parameter netbios name = fileserver
handle_netbios_name: set global_myname to: FILESERVER
doing parameter server string = Fileserver
doing parameter passdb backend = ldapsam:ldap://127.0.0.1/
doing parameter include = /etc/samba/ldap.conf
params.c:pm_process() - Processing configuration file "/etc/samba/ldap.conf"
doing parameter ldap passwd sync = no
doing parameter ldap admin dn = cn=samba,ou=DSA,dc=k2l,dc=com
doing parameter ldap suffix = dc=k2l,dc=com
doing parameter ldap group suffix = ou=Groups
doing parameter ldap user suffix = ou=Users
doing parameter ldap machine suffix = ou=Computers
doing parameter ldap ssl = no
doing parameter ldap delete dn = Yes
doing parameter add machine script = /usr/sbin/smbldap-useradd -w "%u"
doing parameter add user script = /usr/sbin/smbldap-useradd -m "%u"
doing parameter delete user script = /usr/sbin/smbldap-userdel "%u"
doing parameter add group script = /usr/sbin/smbldap-groupadd -p "%g"
doing parameter delete group script = /usr/sbin/smbldap-groupdel "%g"
doing parameter add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
doing parameter delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
doing parameter set primary group script = /usr/sbin/smbldap-usermod -g "%g" "%u"
doing parameter passwd program = /usr/sbin/smbldap-passwd "%u"
doing parameter domain logons = yes
doing parameter workgroup = k2l.com
doing parameter os level = 65
doing parameter log level = 1
doing parameter local master = yes
doing parameter preferred master = yes
doing parameter domain master = yes
doing parameter wins support = yes
doing parameter hosts allow = 192.168.1.0/255.255.255.0
doing parameter interfaces = eth0
doing parameter map hidden = no
doing parameter map system = no
doing parameter map archive = no
doing parameter map readonly = no
doing parameter map read only = no
doing parameter store dos attributes = yes
doing parameter name resolve order = lmhosts host wins bcast
pm_process() returned Yes
Attempting to register new charset UCS-2LE
Registered charset UCS-2LE
Attempting to register new charset UTF-16LE
Registered charset UTF-16LE
Attempting to register new charset UCS-2BE
Registered charset UCS-2BE
Attempting to register new charset UTF-16BE
Registered charset UTF-16BE
Attempting to register new charset UTF8
Registered charset UTF8
Attempting to register new charset UTF-8
Registered charset UTF-8
Attempting to register new charset ASCII
Registered charset ASCII
Attempting to register new charset 646
Registered charset 646
Attempting to register new charset ISO-8859-1
Registered charset ISO-8859-1
Attempting to register new charset UCS2-HEX
Registered charset UCS2-HEX
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Substituting charset 'ISO-8859-15' for LOCALE
Trying to load: ldapsam:ldap://127.0.0.1/
Attempting to register passdb backend ldapsam
Successfully added passdb backend 'ldapsam'
Attempting to register passdb backend ldapsam_compat
Successfully added passdb backend 'ldapsam_compat'
Attempting to register passdb backend NDS_ldapsam
Successfully added passdb backend 'NDS_ldapsam'
Attempting to register passdb backend NDS_ldapsam_compat
Successfully added passdb backend 'NDS_ldapsam_compat'
Attempting to register passdb backend smbpasswd
Successfully added passdb backend 'smbpasswd'
Attempting to register passdb backend tdbsam
Successfully added passdb backend 'tdbsam'
Attempting to register passdb backend guest
Successfully added passdb backend 'guest'
Attempting to find an passdb backend to match ldapsam:ldap://127.0.0.1/ (ldapsam)
Found pdb backend ldapsam
Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=K2L.COM) )]
smbldap_search_ext: base => [dc=k2l,dc=com], filter => [(&(objectClass=sambaDomain)(sambaDomainName=K2L.COM) )], scope => [2]
The connection to the LDAP server was closed
smbldap_open_connection: connection opened
smbldap_check_root_dse: LDAP Server does not support any supportedControl
ldap_connect_system: succesful connection to the LDAP server
The LDAP server is succesfully connected
pdb backend ldapsam:ldap://127.0.0.1/ has a valid init
Attempting to find an passdb backend to match guest (guest)
Found pdb backend guest
pdb backend guest has a valid init
Netbios name list:-
my_netbios_names[0]="FILESERVER"
Trying to load: ldapsam:ldap://127.0.0.1/
Attempting to find an passdb backend to match ldapsam:ldap://127.0.0.1/ (ldapsam)
Found pdb backend ldapsam
Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=K2L.COM) )]
smbldap_search_ext: base => [dc=k2l,dc=com], filter => [(&(objectClass=sambaDomain)(sambaDomainName=K2L.COM) )], scope => [2]
The connection to the LDAP server was closed
smbldap_open_connection: connection opened
smbldap_check_root_dse: LDAP Server does not support any supportedControl
ldap_connect_system: succesful connection to the LDAP server
The LDAP server is succesfully connected
pdb backend ldapsam:ldap://127.0.0.1/ has a valid init
Attempting to find an passdb backend to match guest (guest)
Found pdb backend guest
pdb backend guest has a valid init
smbldap_search_ext: base => [dc=k2l,dc=com], filter => [(&(uid=k2lpc33$)(objectclass=sambaSamAccount))], scope => [2]
ldapsam_getsampwnam: Unable to locate user [k2lpc33$] count=0
Username not found!
fileserver:/#


In der LDAP Datenbank:



version: 1

# LDIF Export for: uid=k2lpc33$,ou=Computers,dc=k2l,dc=com
# Generated by phpLDAPadmin ( http://phpldapadmin.sourceforge.net/ ) on February 9, 2006 2:48 pm
# Server: K2L LDAP Server (127.0.0.1)
# Search Scope: base
# Search Filter: (objectClass=*)
# Total Entries: 1

# Entry 1: uid=k2lpc33$,ou=Computers,dc=k2l,dc=com
dn: uid=k2lpc33$,ou=Computers,dc=k2l,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: sambaSamAccount
cn: k2lpc33$
sn: k2lpc33$
uid: k2lpc33$
uidNumber: 579
gidNumber: 515
homeDirectory: /dev/null
loginShell: /bin/false
description: Machine Account for Martin Barth (24)
gecos: Machine Account for Martin Barth (24)
sambaSID: S-1-5-21-1372503016-2141159300-2613394277-2158
sambaPrimaryGroupSID: S-1-5-21-1372503016-2141159300-2613394277-515
displayName: Workstation Martin Barth
sambaAcctFlags: [WX ]
structuralObjectClass: inetOrgPerson
entryUUID: d29454c0-2453-102a-91ee-e1b5caaafe08
creatorsName: cn=smbldap-tools,ou=DSA,dc=k2l,dc=com
createTimestamp: 20060128141213Z
sambaPwdCanChange: 1139210474
sambaPwdMustChange: 2147483647
sambaNTPassword: ****************************
sambaPwdLastSet: 1139210474
entryCSN: 20060206072114Z#000001#00#000000
modifiersName: cn=samba,ou=DSA,dc=k2l,dc=com
modifyTimestamp: 20060206072114Z
subschemaSubentry: cn=Subschema
hasSubordinates: FALSE


Was tun ? Ich kann jetzt einfach den obigen Export wieder einfügen, dann funktioniert wieder alles :mad: Nur das ist natürlich keine Endlösung!

Gruß
Daniel

emba
09.02.06, 15:59
arbeitest du mit ACLs bzw. indizes in der slapd.conf?
wie sieht die nsswitch.conf aus?
das prob tritt nur sporadisch mit den machine accounts auf?

greez

morpheus2001
09.02.06, 16:03
hi,

ich arbeite nicht mit ACL's.


# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: files ldap
group: files ldap
shadow: files ldap

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis


Das Problem tritt sporadisch sowohl bei Computerkonten, als auch bei Benutzernamen auf. Wenn solch ein Benutzername "ausfällt" kann auch die UID im Linux Dateisystem nicht mehr aufgelöst werden und angezeigt werden.

Gruß

emba
09.02.06, 20:23
ich hatte das gleiche problem, als es probleme mit dem datenbank backend (ldbm) von openldap gab.

workaround:
- die datenbank mit slapcat abziehen
- alle indizes in der slapd.conf deaktivieren.
- alle files im datenbankordner von openldap loeschen
- umstellen auf berkeley db, falls noch nicht geschehen
- die datenbank neu initialisieren (slapadd ...)
- openldap als root laufen lassen

falls wieder so ein fehler auftritt, versuche mittels ldapsearch mal den account zu finden, den samba nicht findet, du aber sicher bist, dass es diesen gibt

greez

morpheus2001
09.02.06, 22:42
hi,

meine slapd.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 **************************
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 users write
# by anonymous auth
# by * none

#access to *
# by * read

(...)


Jetzt noch ein paar Fragen zum Workaround:
1.) Kann ich davon ausgehen, dass ich mit "tar -czf backup.tar.gz /var/lib/ldap/*" alle relevanten Daten der Datenbank gesichert habe ? Und auch einfach durch zurückpacken in das Verzeichnis wieder herstellen kann ?

2.) Eine Umstellung zur Berkeley Datenbank kann ich durch das löschen der rot markierten Parameter und ein einkommentieren der grünen Parameter erreichen - richtig?

3.) Kann ich die Indizes einfach durch auskommentieren der Index-Parameter erreichen?

4.) Datenbankdump erstellen: "slapcat >> dumpfile" Und Datenbank neu initialisieren: "slapadd -l dumpfile" - Richtig?

Vielen Dank & Grüße,
Daniel Morlock

emba
10.02.06, 07:42
1) jep, evtl. noch /var/spool/slurpd wenn slurpd im einsatz (aber eher unwichtig, pfad abhängig von distri)

2) jep

3) jep

4) jep

ich gehe davon aus, dass ihr bis jetzt immer ldbm genutzt habt?
bitte vorher in einer testumgebung umstellung simulieren

greez

morpheus2001
10.02.06, 12:35
ok, habe getestet und ausgeführt. Hat alles soweit wunderbar geklappt. Jetzt heißt es abwarten, ob das Problem weiterhin besteht :rolleyes:

Vielen Dank.
Grüße