OpenLDAP und Authentifizierung mittels PAM
Hallo beisammen!
Ich versuche mich gerade mit OpenLDAP. Mein Ziel ist Benutzauthentifizierung
unter Linux (Debian GNU/Linux 3.1 Sarge) und (später) SAMBA.
Was bisher geschah:
===================
1.) libldap-2.2-7 installieren
2.) libpam-ldap installieren
3.) ldap-utils installieren
4.) libnss-ldap installieren
5.) ldap-server installieren - virtuell (-> slapd 2.2.23-8)
6.) Basiskonfiguration von slapd (über das Installationsmenü)
6a.) DNS domain name = fun
6b.) Name of your organization = fun
6c.) Admin passwort = ldapadmin
6d.) Confirm password = ldapadmin
6e.) Allow LDAPv2 protocol? => <Nein>
6f.) LDAP Server host = 127.0.0.1
7.) Erweiterte Konfiguration von slapd
/etc/ldap/slapd.conf => Eintrag für "misc.schema" hinzufügen.
8.) Konfiguriere libnss-ldap
9.) Konfiguriere libpam-ldap
10.) Configuring name lookup
Edit "/etc/nsswitch.conf" =>
passwd: ldap compat
group: ldap compat
shadow: ldap compat
11.) Configuring PAM
11a.) Edit "/etc/pam.d/common-account" =>
account sufficient pam_ldap.so
account required pam_unix.so try_first_pass
11b.) Edit "/etc/pam.d/common-auth" =>
auth sufficient pam_ldap.so nullok_secure
auth required pam_unix.so nullok_secure use_first_pass
11c.) Edit "/etc/pam.d/common-password" =>
password sufficient pam_ldap.so nullok obscure min=4 max=8 md5
password required pam_unix.so nullok obscure min=4 max=8 md5
use_first_pass
12.) LDIF-Datei erzeugen und einspielen
Der aktuelle Zustand:
=====================
In meiner LDAP-Datenbank gibt es neben dem Admin nur den Benutzer "lukasldap".
Ein "finger lukasldap" liefert mir die eingegebenen Daten. Eine Anmeldung
funktioniert nicht.
Poblem:
=======
* Der Versuch mich mit dem Benutzernamen "lukasldap" und dem Passwort "lukas"
anzumelden scheitert mit einem "Login incorrect".
* Wenn ich mich als Benutzer "leo" anmelde (Benutzer ist unter "/etc/passwd"
eingetragen) und dann ein "su lukasldap" versuche erhalte ich nach der
Passworteingabe die Meldung:
"su: Authentication service cannot retrieve authentication info.
Entschuldigung"
* In "/var/log/auth.log" finde ich folgende Einträge:
Sep 26 22:45:26 test2 su[3755]: pam_ldap: error trying to bind (Invalid
credentials)
Sep 26 22:45:26 test2 su[3755]: + tty2 root:leo
Sep 26 22:45:26 test2 su[3755]: (pam_unix) session opened for user leo by
root(uid=0)
Sep 26 22:45:31 test2 su[3758]: illegal option nullok_secure
Sep 26 22:45:33 test2 su[3758]: pam_ldap: error trying to bind (Invalid
credentials)
Sep 26 22:45:33 test2 su[3758]: (pam_unix) check pass; user unknown
Sep 26 22:45:33 test2 su[3758]: (pam_unix) authentication failure;
logname=root uid=1000 euid=0 tty=tty2 ruser=leo rhost=
Sep 26 22:45:35 test2 su[3758]: pam_authenticate: Authentication service
cannot retrieve authentication info.
Sep 26 22:45:35 test2 su[3758]: - tty2 leo:lukasldap
Sep 26 22:53:42 test2 login[3521]: illegal option nullok_secure
Sep 26 22:53:43 test2 login[3521]: pam_ldap: error trying to bind (Invalid
credentials)
Sep 26 22:53:43 test2 login[3521]: (pam_unix) check pass; user unknown
Sep 26 22:53:43 test2 login[3521]: (pam_unix) authentication failure;
logname=LOGIN uid=0 euid=0 tty=tty3 ruser= rhost=
Sep 26 22:53:48 test2 login[3521]: FAILED LOGIN (1) on `tty3' FOR `lukasldap',
Authentication service cannot retrieve authentication info.
Sep 26 22:54:13 test2 su[3760]: illegal option nullok_secure
Sep 26 22:54:16 test2 su[3760]: pam_ldap: error trying to bind (Invalid
credentials)
Sep 26 22:54:16 test2 su[3760]: (pam_unix) check pass; user unknown
Sep 26 22:54:16 test2 su[3760]: (pam_unix) authentication failure;
logname=root uid=1000 euid=0 tty=tty2 ruser=leo rhost=
Sep 26 22:54:18 test2 su[3760]: pam_authenticate: Authentication service
cannot retrieve authentication info.
Sep 26 22:54:18 test2 su[3760]: - tty2 leo:lukasldap
Fragen:
=======
* Verstehe ich das richtig, dass das PAM sich nicht beim OpenLDAP anmelden
kann?
* Bei der Suche mit Google habe ich unter
"http://lists.debian.org/debian-user/2002/11/msg02707.html" folgenden Hinweis
gefunden:
"what are you trying to do? If your LDAP server requires you to
authenticate for certain operations for pam_ldap, I would
first try putting the info in /etc/pam_ldap.conf:
binddn (your DN to bind as)
bindpw (your password)"
Für "bindpw" habe ich in den man-pages aber nichts gefunden. Habe keine Ahnung
wie das konkret laufen sollte.
* Was kann erforderlich sein, damit das ganze funktioniert?
Ich hoffe jemand kann mir leicht helfen.
LG,
Leonhard.
Reply to: