LDAP: различия между версиями

Материал из wiki.nntc.nnov.ru
Перейти к навигации Перейти к поиску
(Настройка клиентов)
(Настройка клиентов)
Строка 96: Строка 96:
 
http://www.yolinux.com/TUTORIALS/LDAP_Authentication.html
 
http://www.yolinux.com/TUTORIALS/LDAP_Authentication.html
  
This will create the file: /etc/ldap.conf host XXX.XXX.XXX.XXX          - IP address of LDAP server
+
This will create the file: /etc/ldap.conf  
base dc=domain,dc=org
+
host XXX.XXX.XXX.XXX          - IP address of LDAP server
ssl no
+
base dc=domain,dc=org
pam_password md5
+
ssl no
 +
pam_password md5
  
 
If using older SGI MIPS/IRIX systems in the mix you may have to use "clear" instead of "md5".  
 
If using older SGI MIPS/IRIX systems in the mix you may have to use "clear" instead of "md5".  
  
 
File: /etc/nsswitch.conf ..
 
File: /etc/nsswitch.conf ..
...
+
...
passwd files ldap
+
passwd files ldap
shadow files ldap
+
shadow files ldap
group  files ldap
+
group  files ldap
...
+
...
..
+
..
  
  
Строка 123: Строка 124:
  
 
Note: If using the Linux GUI desktop and mounting Linux home directories to an NFS server you may have to mount with the option "nolock". This will be required if the NFS server does not support rpc.statd or rpc.lockd locking daemons which support NFS file locking services.  
 
Note: If using the Linux GUI desktop and mounting Linux home directories to an NFS server you may have to mount with the option "nolock". This will be required if the NFS server does not support rpc.statd or rpc.lockd locking daemons which support NFS file locking services.  
File: /etc/fstab    ...
+
File: /etc/fstab
 +
   ...
 
   nfs-server:/export/home  /export/home  nfs  rw,soft,bg,nolock  0 0
 
   nfs-server:/export/home  /export/home  nfs  rw,soft,bg,nolock  0 0
 
   ...
 
   ...
Строка 149: Строка 151:
 
Accept rest of defaults.  
 
Accept rest of defaults.  
 
Select configure plugin button:  
 
Select configure plugin button:  
[LDAP configure screenshot]  
+
[LDAP configure screenshot]  
LDAP Server: IP-address-goes-here  
+
LDAP Server: IP-address-goes-here  
Port: 389 (default)  
+
Port: 389 (default)  
PrePend: uid=  
+
PrePend: uid=  
Append: ou=people,dc=megacorp,dc=com  
+
Append: ou=people,dc=megacorp,dc=com  
Admin User: "cn=AdminManager,dc=megacorp,dc=com"  
+
Admin User: "cn=AdminManager,dc=megacorp,dc=com"  
Admin password: *******  
+
Admin password: *******  
The "Admin User" and "Admin Pass" are not required for "Map Mode". A bind using the user login/password will take place if the Admin user/password are omitted.  
+
The "Admin User" and "Admin Pass" are not required for "Map Mode". A bind using the user login/password will take place if the Admin user/     password are omitted.  
Select radio button "Map Mode" then select "OK". (Panel closes)  
+
Select radio button "Map Mode" then select "OK". (Panel closes)  
Select Save + Exit  
+
Select Save + Exit  
(On main config panel)  
+
(On main config panel)  
Uses LDAP "Search mode".  
+
Uses LDAP "Search mode".  
 
   
 
   
  
Строка 166: Строка 168:
  
 
Optional test: Download plugin_tester.exe from http://pgina.xpasystems.com/plugins/ldapauth.php  
 
Optional test: Download plugin_tester.exe from http://pgina.xpasystems.com/plugins/ldapauth.php  
[LDAP authentication test tool screenshot]  
+
[[LDAP_authentication.jpg]]  
 
Select: Start + PRograms + pGina + Plugin tester  
 
Select: Start + PRograms + pGina + Plugin tester  
 
Pluggin Path: C:\pGina\plugins\ldapauth\ldapauth_plus.dll  
 
Pluggin Path: C:\pGina\plugins\ldapauth\ldapauth_plus.dll  
Строка 192: Строка 194:
 
We use pGina for login authentication so that all LDAP security rules are followed. (i.e. password length, duration between changes, reuse of passwords, ...) If MS/Windows authenticating with Samba (which in turn is authenticating with LDAP), then many of the LDAP password rules will not be supported. It is for this reason we use pGina. After SAMBA 3.0.7 was available, many of the rules required and supported in pGina are available using SAMBA and the native MS/Windows login. (i.e. Lockout after 5 failed logins) The login/password is held by the MS/windows OS and will be used when accessing Samba shares. Samba will then authenticate the access to the shared drive using LDAP. This replaces the need for a local Samba password database. (created with smbpasswd) In this configuration we did not use the Samba PDC.  
 
We use pGina for login authentication so that all LDAP security rules are followed. (i.e. password length, duration between changes, reuse of passwords, ...) If MS/Windows authenticating with Samba (which in turn is authenticating with LDAP), then many of the LDAP password rules will not be supported. It is for this reason we use pGina. After SAMBA 3.0.7 was available, many of the rules required and supported in pGina are available using SAMBA and the native MS/Windows login. (i.e. Lockout after 5 failed logins) The login/password is held by the MS/windows OS and will be used when accessing Samba shares. Samba will then authenticate the access to the shared drive using LDAP. This replaces the need for a local Samba password database. (created with smbpasswd) In this configuration we did not use the Samba PDC.  
  
File snippet: smb.conf ...
+
File snippet: smb.conf  
passwd backend = ldapsam: ldap://Ip-address-of-LDAP-server/
+
...
ldap admin dn = "cn=sambaadmin, ou=people"
+
passwd backend = ldapsam: ldap://Ip-address-of-LDAP-server/
ldap suffix = "dc=megacorp,dc=com"
+
ldap admin dn = "cn=sambaadmin, ou=people"
ldap user suffix = "ou=people"
+
ldap suffix = "dc=megacorp,dc=com"
...
+
ldap user suffix = "ou=people"
 +
...
  
  
Строка 219: Строка 222:
 
IRIX 6.5.21 configuration:
 
IRIX 6.5.21 configuration:
  
Client configuration file: /var/ns/ldap.conf ; SECURITY
+
Client configuration file: /var/ns/ldap.conf  
 
+
; SECURITY
security  ssl                    - Options are none or ssl
+
security  ssl                    - Options are none or ssl
cipher    RSA_RC4_40_MD5
+
cipher    RSA_RC4_40_MD5
domain                            - An empty domain identifies the local domain
+
domain                            - An empty domain identifies the local domain
 
+
; LDAP server specifications
; LDAP server specifications
 
  
server XXX.XXX.XXX.XXX    - IP address of LDAP server
+
server XXX.XXX.XXX.XXX    - IP address of LDAP server
version 2                        - Open LDAP is considered V2 while Sun One considers themselves to be V3
+
version 2                        - Open LDAP is considered V2 while Sun One considers themselves to be V3
base    "dc=sub-Domain,dc=domain,dc=com"
+
base    "dc=sub-Domain,dc=domain,dc=com"
scope  subtree                  - Options are subtree, onelevel or sbase
+
scope  subtree                  - Options are subtree, onelevel or sbase
password-hash {CRYPT}
+
password-hash {CRYPT}
binddn  "cn=AdminManager,dc=sub-Domain,dc=domain,dc=com"
+
binddn  "cn=AdminManager,dc=sub-Domain,dc=domain,dc=com"
bindpwd secret-password
+
bindpwd secret-password
  
 
Note:  
 
Note:  
Строка 241: Строка 243:
 
LDAP Server: slapd.conf  
 
LDAP Server: slapd.conf  
 
(Linux: /etc/openldap/slapd.conf) database      ldbm
 
(Linux: /etc/openldap/slapd.conf) database      ldbm
password-hash {CRYPT}
+
password-hash {CRYPT}
suffix        "dc=sub-Domain,dc=domain,dc=com"
+
suffix        "dc=sub-Domain,dc=domain,dc=com"
rootdn        "cn=AdminManager,"dc=sub-Domain,dc=domain,dc=com"
+
rootdn        "cn=AdminManager,"dc=sub-Domain,dc=domain,dc=com"
rootpw        {CRYPT}yDtKCHnyyDtKC
+
rootpw        {CRYPT}yDtKCHnyyDtKC
  
 
Notes:  
 
Notes:  
 
Only crypt passwords are allowed in the IRIX implementation. Don't use MD5.  
 
Only crypt passwords are allowed in the IRIX implementation. Don't use MD5.  
 
Note the associations: Server attribute Client attribute
 
Note the associations: Server attribute Client attribute
suffix base
+
suffix base
rootdn binddn
+
rootdn binddn
rootpw
+
rootpw
(crypt) bindpwd
+
(crypt) bindpwd
(clear text)
+
(clear text)
  
  

Версия 07:49, 22 августа 2007

OpenLDAP

Установка

sudo -s
apt-get installl slapd ldap-utils nmap php5-ldap

Настройка OpenLDAP

nano /etc/ldap/slapd.conf

Найдите в файле конфигурации параметр loglevel и измените его значение следующим образом

loglevel 296

Теперь нам нужно получить hesh нашего пароля к slapd. Несмотря на то что мы уже задали пароль доступа к ldap - сменим его

#slappasswd
New

B

Настроим ldap на нашу доменную зону

nano /etc/ldap/slapd.conf
# The base of your directory in database #1
suffix          "dc=ntc, dc=local"
#suffix         "dc=example, dc=com"
# rootdn directive for specifying a superuser on the database. This is needed
# for syncrepl.
rootdn          "cn=admin,dc=ntc,dc=local"
rootpw          {SSHA}a0D718g9uULdD0u/tbMHA9wRlmgV+OUu

Добавим набор параметров по умолчанию для приложений работающих с LDAP.

nano /etc/ldap/ldap.conf
ldap_version 3
BASE    dc=ntc, dc=local
URI     ldap://192.168.10.25:389
SIZELIMIT       0
TIMELIMIT       0
DEREF           never



Создаем базу ldif и импортируем ее в нашь ldap

nano /etc/X11/base.ldif
dn:dc=ntc,dc=local
objectClass: dcObject
objectClass: organization
o:ntc
dc:ntc
dn:cn=admin,dc=ntc,dc=local
objectClass: organizationalRole
cn:admin

Импортируем данные в ldap

#ldapadd -x -W -D cn=admin,dc=ntc,dc=local -d /etc/ldap/base.ldif
Enter password: XXXXXX
 ....


И проверим верно ли были внесены данные в базу ldap

 #ldapsearch -x


phpLdapAdmin

Для коректной работы phpmyadmin вам потребуется внести ваши параметры dc в конфигурационный файл.

#nano /var/www/phpldapadmin/config/config.php

Замените все dc=exaples,dc=com на ваши параметры

Для доступа к web интерфейсу управления LDAP нам потребуется сделать символьную ссылку на диреторию с установленным phphldapadmin

#ln -s /usr/share/phpldapadmin /var/www/phpldapadmin

Для доступа используйте

login: cn=admin,dc=ntc,dc=local
Password:XXXX

Настройка клиентов

http://www.yolinux.com/TUTORIALS/LDAP_Authentication.html

This will create the file: /etc/ldap.conf

host XXX.XXX.XXX.XXX          - IP address of LDAP server
base dc=domain,dc=org
ssl no
pam_password md5

If using older SGI MIPS/IRIX systems in the mix you may have to use "clear" instead of "md5".

File: /etc/nsswitch.conf ..

...
passwd files ldap
shadow files ldap
group  files ldap
...
..


[Potential Pitfall]: You may have to reboot in order for LDAP authentication to begin.

[Potential Pitfall]: If using the Sun One LDAP authentication server, note that any entry for the following attributes will result in the requirement that the Linux user change their password each and every time they login. (annoying) Set the following LDAP attributes to blank (not zero): shadowmin shadowmax shadowwarning

[Potential Pitfall]: The user IDs (uid) and group IDs (gid) are cached by the Linux client after authenticating to the LDAP server. If changes are made to the LDAP directory you may have to reboot the client system to pick up the changes. This is also true for NIS authentication.


Note: If using the Linux GUI desktop and mounting Linux home directories to an NFS server you may have to mount with the option "nolock". This will be required if the NFS server does not support rpc.statd or rpc.lockd locking daemons which support NFS file locking services. File: /etc/fstab

  ...
  nfs-server:/export/home  /export/home  nfs  rw,soft,bg,nolock   0 0
  ...


Also be sure to copy essential files and directories from /etc/skel/...which enable desktop use.

LDAP Authentication for Windows 2000:


Authenticate MS/Windows using PGina: http://pgina.xpasystems.com/ Downloads: http://pgina.xpasystems.com/files/ i.e. download pGina: pGina170a.exe

Run pGina170a.exe to install. Install to C:\pGina and accept defaults.

Download LDAP Auth: Downloads: http://pgina.xpasystems.com/plugins/ldapauth.php Download instaler i.e.: ldapauth12.exe Run to install.

Configure pGina: Select: Start + Programs + pGina + Configuration Tool Pluggin Path: C:\pGina\plugins\ldapauth\ldapauth_plus.dll Accept rest of defaults. Select configure plugin button:

[LDAP configure screenshot] 
LDAP Server: IP-address-goes-here 
Port: 389 (default) 
PrePend: uid= 
Append: ou=people,dc=megacorp,dc=com 
Admin User: "cn=AdminManager,dc=megacorp,dc=com" 
Admin password: ******* 
The "Admin User" and "Admin Pass" are not required for "Map Mode". A bind using the user login/password will take place if the Admin user/     password are omitted. 
Select radio button "Map Mode" then select "OK". (Panel closes) 
Select Save + Exit 
(On main config panel) 
Uses LDAP "Search mode". 

Select option "Scramble Passwords on Logout". This forces LDAP authentication for each login. After an initial login, the login/password become resident locally so that subsequent logins are authenticated locally. This option forces a scramble of the password upon logout forcing Windows/pGina to authenticate with the LDAP server and NOT locally.

Optional test: Download plugin_tester.exe from http://pgina.xpasystems.com/plugins/ldapauth.php LDAP_authentication.jpg Select: Start + PRograms + pGina + Plugin tester Pluggin Path: C:\pGina\plugins\ldapauth\ldapauth_plus.dll Use login and passsword to test.

Reconfigure Windows 2000 not to authenticate against PDC: Right click on "My Computer" + System Properties Select "Network Identification" tab + "Properties" button. Select "Workgroup" radio buton and remove workgroup. Reboot and you are ready to login with LDAP authentication. Note: Do not use false (which can't be resolved) or a real domain (real or real but fails). pGina recognizes local logins if the login id can not be found in the LDAP directory. pGina does not support "roaming profile". To remove pGina: Start + Control Panel + Add/Remove program + select pGina

Links: SysAdmin: pGina


Samba and LDAP:

Samba 3.0 can authenticate using LDAP. Download and compile OpenLDAP (even if you are using Sun ONE or some other LDAP server) and the berkley DB source. These libraries will be required when compiling Samba 3.0 for use with LDAP. Compile Samba with the configure option "--with-ldapsam". (./configure --prefix=/opt/samba --with-ldapsam)

We use pGina for login authentication so that all LDAP security rules are followed. (i.e. password length, duration between changes, reuse of passwords, ...) If MS/Windows authenticating with Samba (which in turn is authenticating with LDAP), then many of the LDAP password rules will not be supported. It is for this reason we use pGina. After SAMBA 3.0.7 was available, many of the rules required and supported in pGina are available using SAMBA and the native MS/Windows login. (i.e. Lockout after 5 failed logins) The login/password is held by the MS/windows OS and will be used when accessing Samba shares. Samba will then authenticate the access to the shared drive using LDAP. This replaces the need for a local Samba password database. (created with smbpasswd) In this configuration we did not use the Samba PDC.

File snippet: smb.conf

...
passwd backend = ldapsam: ldap://Ip-address-of-LDAP-server/
ldap admin dn = "cn=sambaadmin, ou=people"
ldap suffix = "dc=megacorp,dc=com"
ldap user suffix = "ou=people"
...


Note: DNS resolvable names are required for all client and server computers which are part of the Samba domain.

Links: Samba 3.0 LDAP Howto

SGI IRIX/MIPS Authentication and Host Lookup Using LDAP:


IRIX OS releases and LDAP/PAM: IRIX version PAM comments 6.5.21- LDAP support No PAM support. 6.5.22 LDAP support Limited PAM support. Many of the utilities and services were not supported by PAM. 6.5.23+ LDAP support Full PAM support.


IRIX 6.5.21 configuration:

Client configuration file: /var/ns/ldap.conf

; SECURITY
security   ssl                    - Options are none or ssl
cipher     RSA_RC4_40_MD5
domain                            - An empty domain identifies the local domain
; LDAP server specifications
server XXX.XXX.XXX.XXX     - IP address of LDAP server
version 2                         - Open LDAP is considered V2 while Sun One considers themselves to be V3
base    "dc=sub-Domain,dc=domain,dc=com"
scope   subtree                   - Options are subtree, onelevel or sbase
password-hash {CRYPT}
binddn  "cn=AdminManager,dc=sub-Domain,dc=domain,dc=com"
bindpwd secret-password

Note: The "bindpwd" is in clear text and NOT encrypted. When connecting to the server it will use a clear text password. This is required on IRIX 6.5.20. {Potential Pitfall]: If no binddn/bindpwd are supplied in this configuration file, then your whole system is opened up for login without authentication. It may look like you logged in with a password but a correct one will not be required. BEWARE! See "man ldap.conf" for more information. LDAP Server: slapd.conf (Linux: /etc/openldap/slapd.conf) database ldbm

password-hash {CRYPT}
suffix        "dc=sub-Domain,dc=domain,dc=com"
rootdn        "cn=AdminManager,"dc=sub-Domain,dc=domain,dc=com"
rootpw        {CRYPT}yDtKCHnyyDtKC

Notes: Only crypt passwords are allowed in the IRIX implementation. Don't use MD5. Note the associations: Server attribute Client attribute

suffix	base
rootdn	binddn
rootpw
(crypt)	bindpwd
(clear text)


Client nsswitch: /etc/nsswitch.conf hosts: ldap files nis dns passwd: ldap files(compat) [notfound=return] nis


Note: To reactivate new settings:

   [root]# nsadmin flush
   [root]# nsadmin restart
   

IRIX 6.5.22+ configuration:

Same as above except that the ldap.conf file location is /etc/ldap.conf and the entries "binddn" and "bindpwd" are not required. The entries in /etc/ldap.conf for IRIX 6.5.22+ resemble those for Linux. Bind is done using anonymous bind.

Sun SOLARIS Authentication and Host Lookup Using LDAP:


Configure with the Sun SOLARIS admin tool: ldapclient

IBM/AIX Authentication and Host Lookup Using LDAP:


System Authentication for AIX (and Linux)

Encryption scheme:


It is important to choose the same encryption scheme across platforms. By default Solaris uses CRYPT (DES: Data Encryption Standard) but allows multiple schemes, Redhat and FreeBSD (V4.2+) use MD5 and Suse uses Blowfish. Encryption Hash prefix MD5 $1$ plus 12 character salt followed by encrypted password. Blowfish (blf) $2$ or $2a$ plus 16 character salt followed by encrypted password. CRYPT (standard DES) Two character salt at beginning of hash followed by encrypted password. Does NOT start with "$". (No consistent prefix.) CRYPT (extended DES) Nine character salt at beginning of hash followed by encrypted password. Does NOT start with "$". (No consistent prefix.)


Configuration file where encryprion scheme is set: OS Config file RedHat Linux /etc/libuser.conf /etc/pam.d/system-auth (configured using installation) FreeBSD /etc/login.conf /etc/auth.conf /etc/master.passwd Solaris /etc/security/policy.conf See: CRYPT_ALGORITHMS_ALLOW Multiple encryption schemes allowed concurently.


YoLinux.com LDAP Tutorials:


Deploying OpenLDAP - Directory Installation and configuration (V1.2 and 2.x) Apache and LDAP authentication OpenLdap 2.x - SLAPD and LDIF configuration OpenLdap 1.2 - SLAPD and LDIF configuration LDAP Authentication and user passwords - Adding password protection to LDAP directory. (Note: This is authentication for the user to access the LDAP database and not using LDAP to authenticate applications) OpenLdap 1.2 Group security example - SLAPD and LDIF configuration Create a new custom object by extending the inetOrgPerson schema OpenLDAP 2.x Schema Extension to support MS/Outlook, Netscape 4.5+, PAM,.. (GILSE) LDAP admin support scripts and code snippets Mapping LDAP inetOrgPerson object attributes to Palm Pilot Desktop CSV exchange file aWebDap - A simple, flexible web front end supporting multiple domains designed for the non-technical user. My favorite, but hey, I wrote it!!

Оригинальная статья

http://wiki.ubuntu-forum.de/index.php/OpenLDAP

OpenLDAP

Inhaltsverzeichnis [Verbergen]

1 Allgemeines 2 Installation 3 OpenLDAP konfigurieren 4 phpLDAPadmin 4.1 User in phpLDAPadmin anlegen 4.1.1 OU anlegen 4.1.2 Testperson anlegen 4.2 LDAP im Thunderbird einrichten


[bearbeiten] Allgemeines

OpenLDAP ist ein Verzeichnisdienst wie das ActiveDirectory in der Windows-Server-Welt. OpenLDAP ist dabei frei und kostenfrei erhältlich. An dieser Stelle wird die Konfiguration eines OpenLDAP-Servers für die Verwendung als Adressbuch beschrieben, was aber natürlich lange nicht alles ist, was LDAP kann.

Vorraussetzung für das Tutorial ist, dass Ihr mit nano umgehen könnt und Ubuntu mit Apache2 und PHP5 installiert habt (vorzugsweise Ubuntu 6.06.1 LTS Server).


[bearbeiten] Installation

Zunächst startet Ihr ein Terminal auf Eurem Server und wechselt in den SuperUser-Modus, damit Ihr nicht dauernd "sudo" vor jedem zweiten Befehl schreiben müsst. sudo -s

Die Quellen in /Etc/apt/sources.list müssen vorab freigeschaltet werden. apt-get install slapd ldap-utils nmap php5-ldap

Das war auch schon die Grundinstallation. Während der Installation von slapd werdet Ihr nach einem Passwort gefragt. Merkt Euch dieses gut! :)


[bearbeiten] OpenLDAP konfigurieren

Um herauszufinden, ob der Server auch gestartet wurde, benötigt man das eben installierte nmap: nmap localhost | grep ldap

Es sollte nun folgendes angezeigt werden: 389/tcp open ldap

Nun richten wir das Loglevel ein. Der Wert 296 ist für uns ideal, denn dort werden Resultate, Suchfilter und Verbindungsmangement geloggt. nano /etc/ldap/slapd.conf

Sucht (Strg+W) nach dem Stichwort "loglevel" und tragt dort die 296 ein

  1. Read slapd.conf(5) for possible values

loglevel 296

Nun die Datei speichern (Strg+O).

In der Datei /etc/syslog.conf tragt Ihr nun noch folgendes ein (unten drunter):

  1. local4.debug /var/log/slapd.log

Als nächstes generieren wir einen SSHA-Schlüssel, den wir gleich brauchen:

  1. slappasswd

New password: xxxxxx Re-enter new password: xxxxxx {SSHA}4GMPGS/UQTOJ7LdI+iOu7lExQAbpzX6/

Markiert die unterste Zeile und kopiert Euch dies möglichst in die Zwischenablage. (der Key der hier gezeigt wird ist das Passwort: xxxxxx, Euer Key sieht dann ganz anders aus ;))


Nun legen wie die Daten für die Basis des LDAP-Servers fest, indem wir die Datei /etc/ldap/slapd.conf editieren und den Wert "suffix" folgendermaßen verändern:

HINWEIS! Beim Ubuntu-Server sollten hier eigentlich schon die richtigen Angaben drinstehen, sofern diese unter /etc/hostname gesetzt wurden! suffix "dc=meinedomain,dc=local"

Diese Änderungen müssen in der ganzen Datei angepasst werden. Am Ende der Datei fügt Ihr nun die Administrator-Daten ein: rootdn "cn=admin,dc=meinedomain,dc=local" rootpw {SSHA}4GMPGS/UQTOJ7LdI+iOu7lExQAbpzX6/

Anschließend speichert Ihr die Datei (Strg+O) und startet den LDAP-Server neu:

  1. /etc/init.d/slapd restart


Nun sagen wir den Clients, wo der Server überhaupt ist. Dafür erstellen wir die /etc/ldap/ldap.conf neu mit folgendem Inhalt: ldap_version 3 URI ldap://192.168.x.x:389 SIZELIMIT 0 TIMELIMIT 0 DEREF never BASE dc=meinedomain, dc=local

Die URI ist die IP oder Domain Eures Servers! Wenn Ihr einen DNS-Server laufen habt, könnt Ihr hier auch im Stil von "ldap.meinedomain.local" einen Eintrag machen.


Anschließend legen wir die Administrationsdaten an, damit wir uns später auch im Server anmelden können. Erstellt dazu eine Datei namens base.ldif und gebt folgenden Inhalt ein:

  1. nano base.ldif

Inhalt: dn:dc=meinedomain,dc=local objectClass: dcObject objectClass: organization o: meinedomain dc: meinedomain

dn:cn=admin,dc=meinedomain,dc=local objectClass: organizationalRole cn: admin

Datei speichern (Strg+O).

Nun fügen wir die eben angelegte Datei per ldapadd dem LDAP-Server hinzu:

  1. ldapadd -x -W -D cn=admin,dc=meinedomain,dc=local -f base.ldif

Enter LDAP Password: xxxxxx adding new entry "dc=meinedomain,dc=local" adding new entry "cn=admin,dc=meinedomain,dc=local"

Es kann sein, dass der Server meldet, dass die Daten schon vorhanden sind, wenn das so ist, könnt Ihr die Meldung ignorieren!

Mit ldapsearch -x können wir die Daten vom Server abfragen:

  1. ldapsearch -x
  2. extended LDIF
  3. LDAPv3
  4. base <> with scope sub
  5. filter: (objectclass=*)
  6. requesting: ALL
  7. meinedomain.local

dn: dc=meinedomain,dc=local objectClass: dcObject objectClass: organization o: meinedomain dc: meinedomain

  1. admin, meinedomain.local

dn: cn=admin,dc=meinedomain,dc=local objectClass: organizationalRole cn: admin

  1. search result

search: 2 result: 0 Success

  1. numResponses: 3
  2. numEntries: 2


Die Konfiguration ist damit abgeschlossen. Weiter gehts mit der Installation von phpLDAPadmin! :)


[bearbeiten] phpLDAPadmin


Das ebenfalls als OpenSource verfügbare Administrationstool phpLDAPadmin kann mit wenigen Handgriffen installiert werden.

  1. apt-get install phpldapadmin

Anschließend empfiehlt es sich, einen Link zu dem Verzeichnis der Installation zu legen, damit die Administrationsoberfläche bequem erreichbar ist.

  1. ln -s /usr/share/phpldapadmin /var/www/phpldapadmin
  2. /etc/init.d/apache2 restart

Nun ist die Administration per http://SERVERADRESSE/phpldapadmin erreichbar.

WICHTIGE INFO ZUM LOGIN: Es hat mich einige graue Haare gekostet bis ich endlich raushatte, wie man sich richtig einloggt, weil es nirgends stand:

Login DN: cn=admin,dc=meinedomain,dc=local Passwort: zuvor vergebenes [bearbeiten] User in phpLDAPadmin anlegen

Ohne jetzt im Detail auf die Funktionsweise eines LDAP-Servers eingehen zu wollen, möchte ich Euch in kurzen Schritten zeigen, wie Ihr einen Testuser anlegen könnt.

Die Grundstruktur ist die Domain, die ist bereits angelegt. Darunter folgt die OU (Organisational Unit), die hier den Namen "people" erhält. Darunter werden erst die eigentlichen User angelegt.


[bearbeiten] OU anlegen

Klickt rechts im Menü auf:


Anschließend seht Ihr auf der linken Seite ein umfangreiches Menü:


Klickt nun "Organisational Unit" an und auf "Proceed >>".


In der "Container DN" sollte bereits Eure Domain eingetragen sein, wenn nicht, ändert dies entsprechend. Bei Orgisational Unit gebt Ihr "people" ein und klickt auf den anschließend erst klickbaren Button "Proceed >>".


Auf der folgenden Seite bestätigt Ihr das Anlegen der OU mit dem Klick auf "Create Object". [bearbeiten] Testperson anlegen

Klickt nun auf das + vor:


und anschließend auf das aufklappende


Links wählt Ihr nun "Adress Book Entry"


und anschließend wieder auf "Proceed >>" klicken.


Nun tragt Ihr alle Daten ein und klickt anschließen wieder auf "Proceed >>".

Auf der folgenden Seite bestätigt Ihr das Anlegen mit "Create Object".


Das war's! Euer erster User ist angelegt :)


[bearbeiten] LDAP im Thunderbird einrichten

Um LDAP nun auch sinnvoll zu nutzen, beschreibe ich hier kurz die Einrichtung im Thunderbird 2.x .

Startet Thunderbird und klickt im Menü auf Extras und Einstellungen, anschließend auf das Icon Verfassen und dann auf den Reiter Adressieren.


Wählt LDAP-Verzeichnisdienst aus und klickt auf Bearbeiten...



Klickt auf Hinzufügen



In dem folgenden Fenster gebt Ihr nun dem Kind einen Namen, den Adresse vom Server und ansonsten übernehmt Ihr die Daten die Ihr hier seht (natürlich ist der Domainname zu ändern ;)).


Das war's! Der LDAP-Server ist nun von Thunderbird aus erreichbar. Testen könnt Ihr das, indem Ihr nun mit Ok bestätigt und im Thunderbird selber auf das Icon Adressbuch klickt.



Klickt den Namen Eures Servers an und tippt in das Suchfeld * * ein um alle User zu listen. Wenn Ihr z.B. nach einem Nachnamen sucht, wird dann natürlich nur der User mit dem entsprechenden Nachnamen angezeigt.


Viel Spaß mit Eurem LDAP-Server! :)

Kategorien: Netzwerk | 6.06