Bonjour,
Je cherche depuis 3 jours, et je ne trouve pas de solutions. Je souhaite actuellement configurer PAM pour prendre une authentification via un annuaire Active Directory sur un serveur Window 2000 Serveur.
En toute logique, je commence pas à pas, et j'ai donc installé pam_ldap pour aller interroger l'AD. J'ai configurer par ailleurs /etc/ldap.conf correctement (enfin je pense ^^). En matière de test, l'interrogation de l'annuaire via un simple
ldapsearch -x "sAMAccountName=toto" marche très bien ! Je reçois toutes les informations de l'annuaire. J'ai donc décidé de configurer system-auth via authconfig. Et j'ai intégrer l'interrogation LDAP dans l'authentification.
Voici le fichier /etc/ldap.conf :
host ad
base cn=Users,dc=RESEAU,dc=NET
scope sub
pam_password ad
# RFC2307bis naming contexts
# Syntax:
# nss_base_XXX base?scope?filter
# where scope is {base,one,sub}
# and filter is a filter to be &'d with the
# default filter.
# You can omit the suffix eg:
# nss_base_passwd ou=People,
# to append the default base DN but this
# may incur a small performance impact.
nss_base_passwd cn=Users,dc=RESEAU,dc=NET?one
nss_base_shadow cn=Users,dc=RESEAU,dc=NET?one
# RFC 2307 (AD) mappings
#nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount User
nss_map_attribute uid sAMAccountName
nss_map_attribute cn sAMAccountName
#nss_map_attribute homeDirectory unixHomeDirectory
#nss_map_attribute shadowLastChange pwdLastSet
#nss_map_objectclass posixGroup group
#nss_map_attribute uniqueMember member
pam_login_attribute sAMAccountName
pam_filter objectclass=user
#pam_password md5
ssl no
tls_cacertdir /etc/openldap/cacerts
Le fichier /etc/pam.d/system-auth :
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/$ISA/pam_env.so
auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok
auth sufficient /lib/security/$ISA/pam_ldap.so use_first_pass
auth required /lib/security/$ISA/pam_deny.so
account required /lib/security/$ISA/pam_unix.so broken_shadow
account sufficient /lib/security/$ISA/pam_localuser.so
account sufficient /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet
account [default=bad success=ok user_unknown=ignore] /lib/security/$ISA/pam_ldap.so
account required /lib/security/$ISA/pam_permit.so
password requisite /lib/security/$ISA/pam_cracklib.so retry=3
password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password sufficient /lib/security/$ISA/pam_ldap.so use_authtok
password required /lib/security/$ISA/pam_deny.so
session required /lib/security/$ISA/pam_limits.so
session required /lib/security/$ISA/pam_unix.so
session optional /lib/security/$ISA/pam_ldap.so
Seulement voilà, une erreur survient à l'authentification (kerberos est le nom de la machine):
Apr 20 10:13:17 kerberos login(pam_unix)[10309]: check pass; user unknown
Apr 20 10:13:17 kerberos login(pam_unix)[10309]: authentication failure; logname= uid=0 euid=0 tty=tty1 ruser= rhost=
Apr 20 10:13:17 kerberos login[10309]: pam_ldap: error trying to bind as user "CN=toto tt. toto,CN=Users,DC=RESEAU,DC=NET" (Invalid credentials)
Apr 20 10:13:19 kerberos login[10309]: FAILED LOGIN 1 FROM (null) FOR toto, Authentication failure
L'utilisateur existe bien, mais l'erreur trouvé via ethereal est :
Lightweight Directory Access Protocol
LDAP Message, Bind Result
Message Id: 3
Message Type: Bind Result (0x01)
Message Length: 94
Response To: 12
Time: 0.031616000 seconds
Result Code: invalidCredentials (0x31)
Matched DN: (null)
Error Message: 80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 52e, v893
L'
invalid credential semble vouloir dire que mon password est incorrect. Mais je rentre le bon. La piste que je suis entrain de suivre serait que je n'arrive pas à m'authentifier à l'annuaire avec l'utilisateur toto (soit je n'ai pas les droits ... pourtant j'ai autoriser le bind en anonyme et à tout le monde, soit ce n'est pas le bon nom d'utilisateur, car toto est enregistré dans l'annuaire en cn=toto tt. toto,cn=SUers,dc=RESEAU,dc=NET).
Please, i need some help ! J'arrive malheureusement à cours d'idée. J'ai trituré les fichiers de conf dans tous les sens.