SAMBA - LDAP unter Debian Etch 4 HOWTO

nach x Versuchen mit nochmehr HowTos in Deutsch hatte ich es fast aufgegeben zu versuchen einen Sambaserver mit LDAP ans laufen zu bekommen, dann habe ich hier den link zu der Spanischen Seite gefunden und mir diese übersetzt (mehr schlecht als recht) und damit endlich ohne Schwirigkeiten meinen PDC unter Debian ans laufen bekommen, hier mal meine Version des HowTos:

SAMBA-LDAP DEBIAN 4.0 ETCH
NOTWENDIGE ABHÄNGIGKEITEN
#apt-get install make gcc gcc++ gengetopt libpopt-dev python-crypto

LDAP INSTALLATION
#apt-get install slapd ldap-utils
Kennwort von admin : 123456
Confirm das Kennwort von admin : 123456

NEUKONFIGURATION
#dpkg-reconfigure slapd

Abfrage:

Soll die OpenLDAP-Server-Konfiguration ausgelassen werden? : nein
DNS Name : samba.local
Name seiner Organisation : samba.local
Admin Kennwort : 123456
Kennwort wiederholen : 123456
Zu verwenden Datenbankmaschine : BDB
soll die Datenbank entfernt werden, wenn slapd vollständig gelöscht wird? :NO
Es möchte die alte Datenbank verschieben: ja
LDAPV2 : ja
DIE INSTALLATION ÜBERPRÜFEN
# ldapsearch -x -b “dc=samba,dc=local”

KORREKTES RESULTAT

# ldapsearch -x -b "dc=samba,dc=local"
# extended LDIF
#
# LDAPv3
# base with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# samba.local
dn: dc=samba,dc=local
objectClass: top
objectClass: dcObject
objectClass: organization
o: samba.local
dc: samba

# admin, samba.local
dn: cn=admin,dc=samba,dc=local
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2

APACHE INSTALLATION
# apt-get install apache2

SMBLDAP-TOOLS INSTALLATION
#apt-get install smbldap-tools

PHPLDAPADMIN INSTALLATION
#apt-get install phpldapadmin

MKNTPWD INSTALLATION

$ cd /opt/
$ wget http://www.silcom.com.pe/soft/mkntpwd.tar.gz
$ tar -zxf mkntpwd.tar.gz
$ cd mkntpwd
$ make
$ cp mkntpwd /usr/local/bin

ÜBERPRÜFEN

#/opt/mkntpwd# mkntpwd
muss ausgegeben werden:

Usage: mkntpwd [-L lanmgrpwd] [-N ntpasswd]
mkntpwd password
mkntpwd -f [-] [filename]

-L lanmgrpasswd LanManager cleartextpwd <= 14 chars
-N ntpasswd NT cleartextpwd <=128 chars (usually <=14)

with both options present the encrypted LanManager-Pwd is
printed first, followed by a ':' and the encrypted NT-Pwd.

The second usage behaves like mkntpwd -L pwd -N pwd

The third usage reads the password from STDIN or a File. Printout
is the same as second.

anton@genua.de

#/opt/mkntpwd

SAMBA INSTALLATION
#apt-get install samba samba-doc

WORKGROUPname: samba
Soll smb.conf so abgeändert werden, dass per DHCP angebotene WINS Einstellungen verwendet werden? : no

Erstellen der Ordner für SAMBA

#mkdir /home/samba/
#mkdir /home/samba/netlogon
#mkdir /home/samba/profiles

LDAP KONFIGURATION

# cd /usr/share/doc/samba-doc/examples/LDAP
# gunzip samba.schema.gz
# cp samba.schema /etc/ldap/schema
# vi /etc/ldap/slapd.conf

DAS SCHEMA DER SAMBA smb.conf HINZUFÜGEN
nano /etc/samba/smb.conf

include /etc/ldap/schema/samba.schema

LDAP Neustart
#/etc/init.d/slapd restart

KREATION DES BAUMS LDAP (mit Firefox oder IE)

URL : http://IP_des_SAMBASERVERS/phpldapadmin/
Login DN : cn=admin,dc=samba,dc=local
Passwod : 123456

--> Create new entry here

users (zwecks die Konten der Benutzer anfassen).
machines (zwecks die Konten der Maschinen anfassen)
groups (zwecks die Konten der Gruppen anfassen)

--> Notiz:

Vorlage Organisational Unit auswählen
VON DER FOLGENDEN FORM :

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

Ergebniss:

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

SAMBA-KONFIGURATION
# cd /etc/samba
# cp smb.conf smb.conf.bkp
# rm smb.conf
# vi smb.conf

DIE AKTE MUSS VON DER FOLGENDEN FORM SEIN
# nano /etc/samba/smb.conf

[global]
# configuracion basica del servidor
workgroup = silcom
netbios name = pdc
server string = Samba PDC Version %v
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
# configuracion para que la maquina sea el PDC master
os level = 65
preferred master = yes
local master = yes
domain master = yes
domain logons = yes
# configuracion de seguridad y conexion
security = user
guest ok = no
encrypt passwords = yes
null passwords = no
# hosts allow es para que solo permita las maquinas de la LAN (192.168.0.x)
hosts allow = 127.0.0.1 192.168.0.0/255.255.255.0
wins support = yes
name resolve order = wins lmhosts host bcast

dns proxy = no
# otras configuraciones varias para SAMBA
log file = /var/log/samba/log.%m
log level = 2
max log size = 50
hide unreadable = yes
hide dot files = yes
# parametros para el soporte de LDAP
passdb backend = ldapsam:ldap://127.0.0.1
ldap suffix = dc=silcom,dc=com
ldap machine suffix = ou=machines
ldap user suffix = ou=users
ldap group suffix = ou=groups
ldap admin dn = cn=admin,dc=silcom,dc=com
ldap delete dn = no
enable privileges = yes
# para permitir a los usuarios cambiar su clave desde Windows
ldap password sync = yes
# perfiles moviles de usuario, carpeta home y script de inicio
logon home = \\%L\%U\.profile
logon drive = H:
logon path = \\%L\profiles\%U
logon script = netlogon.bat OR %U.bat
# script para automatizar la adicion de cuentas de maquinas
# al arbol LDAP cuando estas se unan por primera vez al dominio
add machine script = /usr/sbin/smbldap-useradd -w "%u"
unix charset = ISO8859-15

#=== Recursos SAMBA ===
# ruta en donde se alojaran el(los) script(s) de inicio
[netlogon]
path = /home/samba/netlogon
guest ok = no
read only = yes
browseable = no
# carpetas home de los usuarios
[homes]
path = /home/%U
comment = Carpetas HOME
browseable = no
writeable = yes
valid users = %S
read only = no
guest ok = no
inherit permissions = yes
# carpeta en donde se guardan los perfiles de los usuarios
[profiles]
path = /home/samba/profiles
writeable = yes
browseable = no
default case = lower
preserve case = no
short preserve case = no
case sensitive = no
hide files = /desktop.ini/ntuser.ini/NTUSER.*/
create mask = 0600
directory mask = 0700
csc policy = disable
# este es un recurso que solo debe ser accesible
[public]
comment = Public Stuff
path = /home/public
read only = No
create mask = 0777
directory mask = 0777
guest ok = no

[software]
comment = Public Stuff
path = /home/software
read only =yes
write list = goliat
create mask = 0755
directory mask = 0755

ANMERKUNG:
- Beispiel anpassen
- ÄNDERUNGEN :
chmod u-x smb.conf chmod g+r smb.conf chmod o+r smb.conf

DIE KONFIGURATION PRÜFEN
# testparm

muss anzeigen:

Load smb config files from /etc/samba/smb.conf
Processing section “[netlogon]”
Processing section “[homes]”
Processing section “[profiles]”
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

Wenn dies nicht so angezeigt wird, dann muss man die Einstellungen in der smb.conf nochmals überprüfen

WIR GEBEN KENNWORT VON LDAP ZUR SAMBA

#smbpasswd -w 123456

SAMBA neustart
# /etc/init.d/samba restart

ZU PHPLDAPADMIN ZURÜCKGEHEN UND DEN EINGANG ÜBERPRÜFEN
muss jetzt eingetragen sein:

+sambaDomainName=SAMBA

--> vorher einmal ausloggen und wieder neu einloggen zur Aktualisierung

Anschliesend nach „ou=Groups“ gehen und „create new entry here“ auswählen
„Samba3 Group Mapping” wählen

Group Windows Name Gid samba sid
sambaadmins Domain Admins 20000 512
sambausers Domain Users 20001 513
sambaguests Domain Guests 20002 514
sambamachines Domain Computers 20003 515

Bild :

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

Bild:

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

INSTALLATION NSS LDAP

#apt-get install libnss-ldap
#dpkg-reconfigure libnss-ldap

Eingabeaufforderung beantworten mit:

Server LDAP : 127.0.0.1
(DN) : dc=samba,dc=local
LDAP Version : 3
Datenbankanbindung : No
Besondere Berechtigung für root : yes
besondere Lese und Schreibrechte für den Eigentümer : yes
LDAP Zugang für root : cn=admin,dc=samba,dc=local
Passwort für root : 123456

KONFIGURATION
#vi /etc/nsswitch.conf

KOMMENTIEREN:

passwd: compat
group: compat
shadow: compat

Zu:

passwd: compat ldap
group: compat ldap
shadow: compat ldap

ÜBERPRÜFEN
# getent group

ES MUSS DARSTELLEN


sambaadmins:*:20000:
sambausers:*:20001:
sambaguests:*:20002:
sambamachines:*:20003:

Wenn das alles stimmt, dann:

INSTALLATION PAM LDAP
# apt-get install libpam-ldap
# dpkg-reconfigure libpam-ldap

Fragen beantworten mit:

URI ldap : 127.0.0.1
DN : dc=samba,dc=local
LDAP Version : 3
lokalen root zum Datenbankadmin machen? : si
benötigt die LDAP Datenbank eine Anmeldung : no
Ldap Zugang für root : cn=admin,dc=samba,dc=local
LDAP root Passwort : 123456
Verschlüsselungsmethode des passwords : md5

dann:

# vi /etc/pam.d/common-account

KOMMENTIEREN
--> #account required pam_unix.so

UND HINZUFÜGEN
account sufficient pam_ldap.so
account required pam_unix.so try_first_pass

dann:

#vi /etc/pam.d/common-auth

KOMMENTIEREN
--> #auth required pam_unix.so nullok_secure

UND HINZUFÜGEN
auth sufficient pam_ldap.so
auth required pam_unix.so nullok_secure use_first_pass

danach:

# vi /etc/pam.d/common-password

KOMMENTIEREN
--> #password required pam_unix.so nullok obscure min=4 max=8 md5

UND IM ENDE HINZUFÜGEN
password sufficient pam_ldap.so
password required pam_unix.so nullok obscure min=4 max=8 md5 use_first_pass

NSCD INSTALLATION

# apt-get install nscd

SAMBA neu starten:

/etc/init.d/samba restart

BENUTZER HINZUFÜGEN
OU Users -->
"create new entry here"
dann "SAMBA3 Account"

ausfüllen mit:

Fist Name : Administrator
Last Name : Global
Comon Name : administrator
User ID : administrator
UID Number : 0
Samba SID : 512
Password : 123456
Verify Password : 123456
Home Directory : /home/administrator

anlegen, dann noch folgenden oder anderen Benutzer anlegen:

Fist Name : Juan
Last Name : User
Comon Name : juan
User ID : juan
UID Number : 10000
Samba SID : 512
Password : zaqwsx
Verify Password : zaqwsx
Home Directory : /home/juan

Fist Name : Sebastian
Last Name : User
Comon Name : sebastian
User ID : sebastian
UID Number : 10001
Samba SID : 513
Password : 147852
Verify Password : 147852
Gid number : sambausers
Primary Group ID : sambausers
Home Directory : /home/sebastian
Die Kreation ist hier so :

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

[BILD] von hier nehmen http://jroliva.wordpress.com/samba-ldap-debian-40-etch/
das ging hier nicht einzusetzen

DIE KREATION DER BENUTZER IN LINUX ÜBERPRÜFEN
# getent passwd
muss dann anzeigen:

administrator:*:0:20000:administrator:/home/administrator:
juan:*:10000:20000:juan:/home/juan:
sebastian:*:10001:20001:sebastian:/home/sebastian:

HOME DIRECTORIES ANLEGEN

# mkdir /home/juan
# cp /etc/skel/.* /home/juan/
# chown -R juan /home/juan
# chgrp -R sambaadmins /home/juan

AUTOMATISIEREN DES EINGANGS DER KONTO-MASCHINE ZU LDAP

# cd /usr/share/doc/smbldap-tools/examples
# cp smbldap.conf.gz smbldap_bind.conf /etc/smbldap-tools
# cd /etc/smbldap-tools
# gunzip smbldap.conf.gz
# chown root:root *
# chmod 600 *

dann:

#vi /etc/smbldap-tools/smbldap_bind.conf


slaveDN=”cn=admin,dc=silcom,dc=com”
slavePw=”123456″
masterDN=”cn=admin,dc=silcom,dc=com”
masterPw=”123456″
smbldap.conf

danach:

#vi /etc/smbldap-tools/smbldap.conf


# $Source: /opt/cvs/samba/smbldap-tools/smbldap.conf,v $
# $Id: smbldap.conf,v 1.18 2005/05/27 14:28:47 jtournier Exp $
#
# smbldap-tools.conf : Q & D configuration file for smbldap-tools

# This code was developped by IDEALX (http://IDEALX.org/) and
# contributors (their names can be found in the CONTRIBUTORS file).
#
# Copyright (C) 2001-2002 IDEALX
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.

# Purpose :
# . be the configuration file for all smbldap-tools scripts

##############################################################################
#
# General Configuration
#
##############################################################################

# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
SID="S-1-5-21-94669559-3115132172-2268991497"

!! SID anpassen

# Domain name the Samba server is in charged.
# If not defined, parameter is taking from smb.conf configuration file
# Ex: sambaDomain="IDEALX-NT"
sambaDomain="SILCOM"

anpassen!!

##############################################################################
#
# LDAP Configuration
#
##############################################################################

# Notes: to use to dual ldap servers backend for Samba, you must patch
# Samba with the dual-head patch from IDEALX. If not using this patch
# just use the same server for slaveLDAP and masterLDAP.
# Those two servers declarations can also be used when you have
# . one master LDAP server where all writing operations must be done
# . one slave LDAP server where all reading operations must be done
# (typically a replication directory)

# Slave LDAP server
# Ex: slaveLDAP=127.0.0.1
# If not defined, parameter is set to "127.0.0.1"
slaveLDAP="127.0.0.1"

# Slave LDAP port
# If not defined, parameter is set to "389"
slavePort="389"

# Master LDAP server: needed for write operations
# Ex: masterLDAP=127.0.0.1
# If not defined, parameter is set to "127.0.0.1"
masterLDAP="127.0.0.1"

# Master LDAP port
# If not defined, parameter is set to "389"
masterPort="389"

# Use TLS for LDAP
# If set to 1, this option will use start_tls for connection
# (you should also used the port 389)
# If not defined, parameter is set to "1"
ldapTLS="0"

auf “0” setzen

# How to verify the server's certificate (none, optional or require)
# see "man Net::LDAP" in start_tls section for more details
verify="none"

# CA certificate
# see "man Net::LDAP" in start_tls section for more details
#cafile="/etc/opt/IDEALX/smbldap-tools/ca.pem"

# certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
#clientcert="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.pem"

# key certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
#clientkey="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.key"

# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
suffix="dc=silcom,dc=com"

anpassen

# Where are stored Users
# Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for usersdn
usersdn="ou=users,${suffix}"

# Where are stored Computers
# Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for computersdn
computersdn="ou=machines,${suffix}"

# Where are stored Groups
# Ex: groupsdn="ou=Groups,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for groupsdn
groupsdn="ou=groups,${suffix}"

# Where are stored Idmap entries (used if samba is a domain member server)
# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn
#idmapdn="ou=Idmap,${suffix}"

# Where to store next uidNumber and gidNumber available for new users and groups
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
sambaUnixIdPooldn="sambaDomainName=SILCOM,${suffix}"

# Default scope Used
scope="sub"

# Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA, CLEARTEXT)
hash_encrypt="MD5"

anpassen

# if hash_encrypt is set to CRYPT, you may set a salt format.
# default is "%s", but many systems will generate MD5 hashed
# passwords if you use "$1$%.8s". This parameter is optional!
crypt_salt_format="%s"

##############################################################################
#
# Unix Accounts Configuration
#
##############################################################################

# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"
userLoginShell="/bin/bash"

# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"

# Default mode used for user homeDirectory
userHomeDirectoryMode="700"

# Gecos
userGecos="System User"

# Default User (POSIX and Samba) GID
defaultUserGid="512"
anpassen

# Default Computer (Samba) GID
defaultComputerGid="20003"

anpassen

# Skel dir
skeletonDir="/etc/skel"

# Default password validation time (time in days) Comment the next line if
# you don't want password to be enable for defaultMaxPasswordAge days (be
# careful to the sambaPwdMustChange attribute's value)
#defaultMaxPasswordAge="45"

##############################################################################
#
# SAMBA Configuration
#
##############################################################################

# The UNC path to home drives location (%U username substitution)
# Just set it to a null string if you want to use the smb.conf 'logon home'
# directive and/or disable roaming profiles
# Ex: userSmbHome="\\PDC-SMB3\%U"
userSmbHome=""

# The UNC path to profiles locations (%U username substitution)
# Just set it to a null string if you want to use the smb.conf 'logon path'
# directive and/or disable roaming profiles
# Ex: userProfile="\\PDC-SMB3\profiles\%U"
userProfile=""

# The default Home Drive Letter mapping
# (will be automatically mapped at logon time if home directory exist)
# Ex: userHomeDrive="H:"
userHomeDrive="H:"

# The default user netlogon script name (%U username substitution)
# if not used, will be automatically username.cmd
# make sure script file is edited under dos
# Ex: userScript="startup.cmd" # make sure script file is edited under dos
userScript="logon.bat"

# Domain appended to the users "mail"-attribute
# when smbldap-useradd -M is used
# Ex: mailDomain="idealx.com"
#mailDomain="samba.local"

##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################

# Allows not to use smbpasswd (if with_smbpasswd == 0 in smbldap_conf.pm) but
# prefer Crypt::SmbHash library
with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"

# Allows not to use slappasswd (if with_slappasswd == 0 in smbldap_conf.pm)
# but prefer Crypt:: libraries
with_slappasswd="0"
slappasswd="/usr/sbin/slappasswd"

# comment out the following line to get rid of the default banner
# no_banner="1"

dann noch:

# chmod u-x smbldap.conf

ZUM SCHLUSS:

#cp smbldap_bind.conf /etc/
#cp smbldap.conf /etc/

funktionierte bei mir sofort, bis auf die LOGON Scripte, da bin ich gerade noch dran.

Da ich lange gesucht habe und mir mehrere Tage dei Zähne ausgebissen hatte, denke ich, das das so mansch einem evtl. weiterhelfen könnte

Irgendwie kommte ich an der

Irgendwie kommte ich an der Stelle:

SAMBA neustart
# /etc/init.d/samba restart

ZU PHPLDAPADMIN ZURÜCKGEHEN UND DEN EINGANG ÜBERPRÜFEN
muss jetzt eingetragen sein:

+sambaDomainName=SAMBA

nicht weiter, der Unterpunkt +sambaDomainName=SAMBA erscheint einfach nicht bei mir. Und diese Seite:
http://blog.netsys-online.de/
ist nicht mehr verfügbar. Hat jemand ein Backup davon, oder hat noch jemand das Problem, dass sambaDomainName=SAMBA nicht unter PHPLDAPADMIN erscheint.
Danke schon mal für jede Antwort

Hallo Chaosworld, hast du zu

Hallo Chaosworld,
hast du zu deiner Frage:

SAMBA neustart
# /etc/init.d/samba restart
ZU PHPLDAPADMIN ZURÜCKGEHEN UND DEN EINGANG ÜBERPRÜFEN
muss jetzt eingetragen sein:
+sambaDomainName=SAMBA
nicht weiter, der Unterpunkt +sambaDomainName=SAMBA erscheint einfach nicht bei mir.

schon eine Antwort erhalten, oder selber eine Lösung gefunden?

Ich kann unter Lenny, Samba 3.2.x und phpldapadmin 1.1.0.5 (Firefox / XP) machen was ich will, der Eintrag erscheint auch hier nicht.

Danke im Vorraus für Anregungen.

Moin Moin! Erstmal möchte

Moin Moin!

Erstmal möchte ich sagen, dass ich absolut neu in diesem Gebiet bin. Also bitte nicht wundern, wenn ich jetzt vllt auch dumme Fragen stelle... :(

Naja, also zum Thema.
Soll diese ganze Geschichte einmal für die Arbeit/Ausbildung machen.
Habe mir also dieses HowTo vorgenommen. Doch schon beim ersten Befehl
# apt-get install make gcc gcc++ gengetopt libpopt-dev python-crypto
bekomme ich gleich eine Fehlermeldung:
Reading package lists... Done
Building dependency tree... Done
make is already the newest version.
gcc is already the newest version.
gcc is already the newest version.
gengetopt is already the newest version.
libpopt-dev is already the newest version.
python-crypto is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Setting up slapd (2.2.26-5ubuntu2.4) ...
Backing up /etc/ldap/slapd.conf in /var/backups/slapd-2.2.26-5ubuntu2.2... done.
Starting OpenLDAP: slapd - failed.
The operation failed but no output was produced. For hints on what went
wrong please refer to the system's logfiles (e.g. /var/log/syslog) or
try running the daemon in Debug mode like via "slapd -d 16383" (warning:
this will create copious output).

Below, you can find the command line options used by this script to
run slapd and slurpd. Do not forget to specify those options if you
want to look to debugging output:
slapd -4
invoke-rc.d: initscript slapd, action "start" failed.
dpkg: error processing slapd (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
slapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

Ich schließe aus dieser Meldung, dass ich das mit slap wohl schon mal installiert habe (habe auch schon andere HowTo's ausprobiert), aber dass das mit Installation nicht richtig funktioniert hat.

Kann mir vielleicht jemand helfen?
Wäre Euch echt sehr dankbar! Bin am verzeifeln...

MfG Matze

erstmal vielen dank für das

erstmal vielen dank für das howto.

soweit funktioniert mein samba server nun auch. allerdings mit dem kleinen problem, das meine in phpldapadmin erstellten benutzer und gruppen nicht automatisch mit in /etc/passwd bzw. /etc/group eingetragen werden. ein 'getent passwd' bringt mir also nicht die gewünschte antwort.
ich vermute, das der fehler mit diesem bug
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=375077
zusammenhängen könnte. um das system booten zu können und den dc überhaupt in gang zu bekommen, habe ich in /etc/nsswitch.conf diese einträge gemacht:
passwd: files ldap [UNAVAIL=return]
group: files ldap [UNAVAIL=return]
trage ich die eingerichteten user per hand in die /etc/passwd ein, funktioniert alles weitere und ich kann mich von windowsrechnern aus, an der domain anmelden.
eventuell hat hier jemand eine bessere lösung gefunden und mir auf die sprünge helfen.

grüße

Hallo goliat, vielen Dank,

Hallo goliat,

vielen Dank, das du dieses HowTo bei uns online stellst, wenn du Lust und Zeit hast, wir können immer gute Leute brauchen.

Benjamin Biel
Geschäftsführer

sigmos GmbH

Hallo! Erst einmal Danke

Hallo!
Erst einmal Danke für die Anleitung. Ich habe sie gerade ausprobiert und habe noch ein paar Fragen dazu:
---schnipp anfang---
# vi /etc/ldap/slapd.conf
DAS SCHEMA DER SAMBA smb.conf HINZUFÜGEN
nano /etc/samba/smb.conf
include /etc/ldap/schema/samba.schema
---schnipp ende---
Ich kenne es eigentlich nur so, dass die include Anweisung in der slapd.conf reinkommt. In der smb.conf auch??? Reicht nicht ein Editor, oder wirklich vi und nano gleichzeitig :-) ?

--schnipp anfang--
Anschliesend nach „ou=Groups“ gehen und „create new entry here“ auswählen
„Samba3 Group Mapping” wählen

Group Windows Name Gid samba sid
sambaadmins Domain Admins 20000 512
sambausers Domain Users 20001 513
sambaguests Domain Guests 20002 514
sambamachines Domain Computers 20003 515
---schnipp ende---

In meiner Eingabemaske im phpldapadmin kann ich nicht "Domain" auswählen und nicht die "Samba Sid" eingeben. Habe ich etwas vergessen??

Der Versuch mit WinXP sich anzumelden funktionierte zum Schluß leider nicht. Welchen User muss ich zum Anmelden benutzen "root" oder "administrator"?

Vielleicht hast Du ja ein paar Tipps für mich... ;-)

Deine Anleitung war die erste, die ich im Netz gefunde habe und genau das abdeckt was ich benötige. DANKE!!!

Gruß, Wolfram

Hi, einer der Editoren

Hi,

einer der Editoren reicht natürlich, das HowTo ist zum großen Teil eine Übersetzung eines Spanischen HowTos, ich bevorzuge hier klar den nano aber das ist Geschmackssache.

zur SSID, die musst du mit:
#: net getlocalsid

auf dem Server abfragen und dann unter /etc/smbldap-tools/smbldap.conf einfügen.

zum Schema,
include /etc/ldap/schema/samba.schema
muss in die ldap.conf rein, damit der LDAP Server mit den SAMBA Anfragen was anzufangen weis, einfach
in der /etc/ldap/slapd.conf unter die anderen Schemas schreiben.

du kannst auch mal hier schauen: http://blog.netsys-online.de da habe ich das HowTo teils nochmal überarbeitet und noch andere HowTos hinzugefügt. Ich habe das HowTo ansich hier gepostet, da Samba-LDAP.de mir die entscheidenden Hinweise gegeben hat, damit ich den Samba/LDAP Server überhaupt unter Debian Etch zum laufen gebracht habe.

zu:
Anschliesend nach „ou=Groups“ gehen und „create new entry here“ auswählen
„Samba3 Group Mapping” wählen

im HowTo steht der Link zu den Bildern, da ich die noch nicht erstellt habe, die sind aber sehr hilfreich bei der Beantwortung deiner Frage.

zu:
Der Versuch mit WinXP sich anzumelden funktionierte zum Schluß leider nicht. Welchen User muss ich zum Anmelden benutzen "root" oder "administrator"?

das kommt auf den Benutzer an, welchen du mit Domainadminrechten erstellt hast, aber, wenn der PDC schon nicht korrekt funktioniert (siehe deine Fragen oben) dann funktioniert das auch nicht :-(
Du darfst auch auf keinen Fall vergessen mit #:smbpasswd -a [USER] die User nach dem anlegen im phpLDAPAdmin noch in den Samba zu übernehmen.

Ich hatte nach dem ich den PC in die Domain eingehängt habe das Problem, das ich mit meinem User trotzdem keine Domainanmeldung hinbekam, ich habe dann den User nochmal aus dem LDAP entfernt, neu angelegt, dem Samba bekannt gemacht und dann gings auch, auch wenn dich dein WindowsPC fragt, welchen User er in die Domain übernehmen soll, das funktioniert nicht, also erst PC in die Domain mit nem anderen lokal angelegtem User einfahren und dann im LDAP die User festlegen die sich an der Domain anmelden können sollen, dann sollte das auch funktionieren.

ich werde unter meinem Blog nochmal meinen WIN Vista 64bit Rechner in die Domain intergrieren, damit man mal ein Beispiel dafür hat, bei mir laufen jetzt sowohl WinXP als auch Vista PCs in der Domain, ich beschäftige mich zur Zeit mit Windows Scripting Host, um per Registryeinträgen die Benutzer zu verwalten gehen,
auch hier werde ich dann in meinem Blog etwas dazu schreiben.

ich werde mir das aber heute abend nochmal genau anschauen und eigene Bilder erstellen soweit möglich, da ich gerade nicht zu hause im büro bin

Hallo Goliat! Heute bin ich

Hallo Goliat!

Heute bin ich Deiner anderen Anleitung gefolgt. Ich habe Deine obigen Hinweise berücksichtigt. Ich habe sogar daran gedacht mittels #:smbpasswd -a [USER] die Passwörter für die angelegten User zu hinterlegen.

Versuche ich nun meine XP-Maschine anzumelden, bekomme ich folgendes Log-File:


[2007/10/08 16:48:51, 2] lib/smbldap.c:smbldap_open_connection(788)
smbldap_open_connection: connection opened
[2007/10/08 16:48:51, 2] passdb/pdb_ldap.c:init_sam_from_ldap(541)
init_sam_from_ldap: Entry found for user: root
[2007/10/08 16:48:51, 2] passdb/pdb_ldap.c:init_group_from_ldap(2140)
init_group_from_ldap: Entry found for group: 20001
[2007/10/08 16:48:51, 2] auth/auth.c:check_ntlm_password(309)
check_ntlm_password: authentication for user [root] -> [root] -> [root] succeeded
[2007/10/08 16:48:51, 2] lib/access.c:check_access(323)
Allowed connection from (192.168.181.94)
[2007/10/08 16:48:51, 2] smbd/reply.c:reply_tcon_and_X(711)
Serving IPC$ as a Dfs root
[2007/10/08 16:48:51, 2] rpc_server/srv_samr_nt.c:_samr_lookup_domain(2797)
Returning domain sid for domain EMC -> S-1-5-21-1976481809-3694456711-1784923942
Error looking for next uid at /usr/share/perl5/smbldap_tools.pm line 1044.
[2007/10/08 16:48:52, 0] passdb/pdb_interface.c:pdb_default_create_user(368)
_samr_create_user: Running the command `/usr/sbin/smbldap-useradd -w "xpdomain$"' gave 255

Hast Du eine Idee woran das liegen könnte?

Bei Deiner Anleitung auf http://blog.netsys-online.de/ ist mir folgendes aufgefallen. Du schreibst:


BENUTZER HINZUFÜGEN

im phpLDAPAdmin auf OU=sambausers gehen "create new entry here" auswählen, dann in der nächsten Registerkarte User Account wählen und nach unten stehenden Schema die gewünchten User anlegen:

Die Gruppe OU=sambausers gibt es nicht, d.h. sie wurde nicht angelegt. Ich nehme mal an Du meinst die Gruppe OU=users, oder?

Sorry, wollte das auf Deiner Seite posten, konnte aber keinen Kommentar hinzufügen... :-(

Gruß, Wolfram

Hallo, ich habe heute

Hallo,

ich habe heute den/die Fehler gefunden. Zunächst ist in der Datei smbldap.conf ein kleiner Tippfehler.


...
verify="none"
Suffix="dc=samba,dc=local"
usersdn="ou=users,${suffix}"
....

Das Wort "Suffix" muss konsequent klein geschrieben werden. Es muss also richtig so lauten:


...
verify="none"
suffix="dc=samba,dc=local"
usersdn="ou=users,${suffix}"
....

Versucht man danach einen Computer der Domäne hinzuzufügen scheitert das mit einer ähnlichen Fehlermeldungen, wobei die Zeilenangabe einen höheren Wert hat. Dies konnte ich beheben in dem ich den Hinweis von http://sourceforge.net/docman/display_doc.php?docid=33543&group_id=16610... Kapitel 6.13 "Typical errors on creating a new user or a new group" berücksichtigt habe. Genauer gesagt, habe ich noch einmal den Befehl smbldap-populate ausgeführt. Danach ging die Domänanmeldung einen Schritt weiter.

Die nächste Fehlermeldung lautete dann: "Die Vertrauensstellung zwischen der Arbeitsstation und der primären Domäne konnte nicht hergestellt werden"
Hier half nur der Griff zu regedit unter Windows. Hier muss der folgende Parameter auf dem Wert "0" gesetzt werden.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\requiresignorseal

Danach klappte es mit der Anmeldung an die Domäne...Juchu... :-))

Hallo goliat, erst einmal

Hallo goliat,

erst einmal vielen Dank für die schnelle Antwort. Ich werde das ganze noch einmal nach meinen Urlaub in 14 Tagen angehen. Oder wenn ich im Urlaub vielleicht doch Lust habe... ;-)

Bis dann,

Wolfram

Hallo zusammen: Zuerst

Hallo zusammen:
Zuerst einmal vielen dank für dieses HowToon. Ich habe jetzt einige Nächte damit herumprobiert und nun läuft mein PDC mit Samba und LDAP. Ich habe einige Probleme festgestellt.
Wenn ich Samba starte bekomme ich folgende Fehlermeldungen:

[2007/11/24 20:14:55, 0] smbd/server.c:main(847)
smbd version 3.0.24 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2007/11/24 20:14:55, 2] param/loadparm.c:do_section(3712)
Processing section "[netlogon]"
[2007/11/24 20:14:55, 2] param/loadparm.c:do_section(3712)
Processing section "[homes]"
[2007/11/24 20:14:55, 2] param/loadparm.c:do_section(3712)
Processing section "[profiles]"
[2007/11/24 20:14:55, 2] param/loadparm.c:do_section(3712)
Processing section "[public]"
[2007/11/24 20:14:55, 2] param/loadparm.c:do_section(3712)
Processing section "[software]"
[2007/11/24 20:14:55, 0] printing/pcap.c:pcap_cache_reload(159)
Unable to open printcap file /etc/printcap for read!
[2007/11/24 20:14:55, 0] printing/pcap.c:pcap_cache_reload(159)
Unable to open printcap file /etc/printcap for read!
[2007/11/24 20:14:55, 2] lib/interface.c:add_interface(81)
added interface ip=192.168.0.3 bcast=192.168.0.255 nmask=255.255.255.0
[2007/11/24 20:14:55, 2] lib/tallocmsg.c:register_msg_pool_usage(61)
Registered MSG_REQ_POOL_USAGE
[2007/11/24 20:14:55, 2] lib/dmallocmsg.c:register_dmalloc_msgs(71)
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2007/11/24 20:14:55, 2] lib/smbldap_util.c:smbldap_search_domain_info(219)
smbldap_search_domain_info: Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=FIRMA2))]
[2007/11/24 20:14:55, 2] lib/smbldap.c:smbldap_open_connection(788)
smbldap_open_connection: connection opened
[2007/11/24 20:14:55, 0] auth/auth_util.c:create_builtin_administrators(785)
create_builtin_administrators: Failed to create Administrators
[2007/11/24 20:14:55, 2] auth/auth_util.c:create_local_nt_token(899)
create_local_nt_token: Failed to create BUILTIN\Administrators group!
[2007/11/24 20:14:55, 0] auth/auth_util.c:create_builtin_users(751)
create_builtin_users: Failed to create Users
[2007/11/24 20:14:55, 2] auth/auth_util.c:create_local_nt_token(926)
create_local_nt_token: Failed to create BUILTIN\Users group!
[2007/11/24 20:14:55, 0] auth/auth_util.c:create_builtin_administrators(785)
create_builtin_administrators: Failed to create Administrators
[2007/11/24 20:14:55, 2] auth/auth_util.c:create_local_nt_token(899)
create_local_nt_token: Failed to create BUILTIN\Administrators group!
[2007/11/24 20:14:55, 0] auth/auth_util.c:create_builtin_users(751)
create_builtin_users: Failed to create Users
[2007/11/24 20:14:55, 2] auth/auth_util.c:create_local_nt_token(926)
create_local_nt_token: Failed to create BUILTIN\Users group!
[2007/11/24 20:14:55, 2] smbd/server.c:open_sockets_smbd(384)
waiting for a connection

Was funktioniert da noch nicht richtig?
Damit ich einen WinPC zu Domain hinzufügen kann muss ich zuerst das Konto unter
ou=machines erstelle. Es sieht so aus als ob das add machine Script oder deren Syntax fehlerhaft ist.
add machine script = /usr/sbin/smbldap-useradd -w "%u"
Kann mir jemand sagen wie ich einen Benutzer mehreren Gruppen zuweisen kann?
Wie kann ich die Verschlüsselung auf dem slapd aktivieren?
Zum Schluss möchte ich auch noch phpldapadmin über https betreiben. Hat jemand dazu schon Erfahrung?

Grüße aus dem Süden: morschtan

#