LDAP身份验证失败

前端之家收集整理的这篇文章主要介绍了LDAP身份验证失败前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试设置一个LDAP目录,允许我验证Debian用户.完成LDAP服务器和PAM文件的配置后,身份验证将失败.我认为客户端没有找到ldap用户进入该目录.当我尝试使用ldap用户登录时,它表示登录错误,当我尝试使用本地用户登录时,它会向我询问密码,然后是LDAP密码.

服务器

1)我首先安装了ldap-utils libldap-2.4-2 libldap-2.4-2-dbg slapd slapd-dbg

2)在文件/etc/ldap/ldap.conf中:

  1. BASE dc=example,dc=com
  2.  
  3. URI ldap://192.168.1.254/

3)

  1. dpkg-reconfigure slapd

我检查有关域的信息是否正确:正确.

4)

  1. ldapsearch -x

它符合我之前选择的内容.

5)我为目录和用户创建.ldif文件

structure.ldif:

  1. dn: ou=users,dc=example,dc=com
  2. objectClass: organizationalUnit
  3. u: users
  4. description: users
  5.  
  6. dn: ou=computers,dc=com
  7. objectClass: organizationalUnit
  8. ou: computers
  9. description: computers
  10.  
  11. dn: ou=sale,ou=users,dc=com
  12. objectClass: organizationalUnit
  13. ou: sale
  14. description: sale
  15.  
  16. dn: ou=direction,dc=com
  17. objectClass: organizationalUnit
  18. ou: direction
  19. description: direction
  20.  
  21. dn: cn=sale,ou=sale,dc=com
  22. objectClass: posixGroup
  23. gidNumber: 501
  24. cn: sale
  25. description: Sale group
  26.  
  27. dn: cn=direction,ou=direction,dc=com
  28. objectClass: posixGroup
  29. gidNumber: 502
  30. cn: direction
  31. description: Direction group
  32.  
  33. dn: cn=pauldupont,cn=direction,dc=newsoft,dc=ch
  34. cn=pauldupont,dc=com
  35. objectClass: inetOrgPerson
  36. objectClass: posixAccount
  37. uid: pauldupont
  38. userPassword: pauldupont
  39. cn: pauldupont
  40. uidnumber: 1050
  41. gidnumber: 501
  42. homeDirectory: /home/profils/pauldupont
  43. sn: pauldupont

adduseringroup.ldif:

  1. dc: cn=sale,dc=com
  2. changetype: modify
  3. add: memberuid
  4. memberuid: uid=pauldupont,dc=com

6)我将文件发送到目录:

  1. ldapadd -x -D "cn=admin,dc=com" -W -f file.ldif

6)

  1. ldapsearch -x

信息在那里.

客户

1)我安装了ldap-utils libldap-2.4-2 libldap-2.4-2-dbg slapd slapd-dbg libnss-ldap libpam-ldap libpam-modules libpam-cracklib nscd

2)libnss-ldap配置:服务器ip:192.168.1.254,dc = example,dc = com

3)libpam-ldap配置:不,LDAP管理员就像本地用户,不是LDAP服务器在进行查询之前要求提供信息

4)
dpkg-reconfigure libnss-ldap

信息是正确的.

5)在文件/etc/ldap/ldap.conf中

  1. BASE dc=example,dc=com
  2. URI ldap://192.168.1.254/

6)在文件/etc/nsswitch.conf中

  1. passwd: compat ldap
  2. group: compat ldap
  3. shadow: compat ldap

7)在文件/etc/libnss-ldap.conf中

  1. base dc=example,dc=com
  2. uri ldap://192.168.1.254/
  3. ldap_version 3
  4. rootbinddn cn=admin,dc=com

8)在文件/etc/libnss-ldap.secret中

  1. ldap password

9)在文件/etc/pam_ldap.conf中:

  1. base dc=example,dc=com
  2. uri ldap://192.168.1.254/
  3. rootbinddn cn=admin,dc=com
  4. port 389
  5. scope sub
  6. bind_timelimit 30
  7. idle_timelimit 3600
  8. pam_filter objectClass=posixAccount
  9. pam_login_attribute uid

10)在文件/etc/pam.d/common-auth&共同账户&我在底部添加的常见会话:

  1. auth sufficient pam_ldap.so

11)在文件/etc/pam.d/common-password中,我在底部添加了:

  1. password sufficient pam_ldap.so use_first_pass

12)

  1. getent passwd && getent group

显示本地用户和组.

13)客户端似乎联系服务器:

  1. ldapsearch -x -H "ldap://192.168.1.254" -b "dc=example,dc=com" dn

让我回到dn条目

14)
getent passwd pauldupont

什么都没有给我,当我签入/var/log/auth.log时:

  1. May 12 10:43:36 CLI1-DIR-DEB nscd: nss_ldap: Failed to bind to LDAP server ldap:///192.168.1.254/: Invalid credentials
  2. May 12 10:43:36 CLI1-DIR-DEB nscd: nss_ldap: reconnecting to LDAP server...
  3. May 12 10:43:36 CLI1-DIR-DEB nscd: nss_ldap: Failed to bind to LDAP server ldap:///192.168.1.254/: Invalid credentials
  4. May 12 10:43:36 CLI1-DIR-DEB nscd: nss_ldap: reconnecting to LDAP server...
  5. May 12 10:43:37 CLI1-DIR-DEB nscd: nss_ldap: Failed to bind to LDAP server ldap:///192.168.1.254/: Invalid credentials
  6. May 12 10:43:37 CLI1-DIR-DEB nscd: nss_ldap: could not search LDAP server - Server is unavailable

凭证似乎是错误的.我检查了上面的所有配置文件,我找不到任何错误.

有人知道问题出在哪里吗?

谢谢您的帮助.

我正在使用Debian Jessie 8.0 AMD64作为客户端和服务器

uname -a:Linux SRV1-DEB 3.16.0-4-amd64#1 SMP Debian 3.16.7-ckt9-3~deb8u1(2015-04-24)x86_64 GNU / Linux

OpenLDAP 2.4

编辑:一旦我在/etc/ldap.secret文件添加了密码,我做了一个getent passwd,我得到了ldap用户,但我仍然无法连接.

一旦我尝试连接,我在日志文件中有这个:

  1. May 18 09:09:53 CLI1-DIR-DEB login[904]: pam_mail(login:session): user unknown
  2. May 18 09:09:53 CLI1-DIR-DEB login[904]: pam_loginuid(login:session): error_ log for user-name'pauldupont' does not exist
  3. May 18 09:09:53 CLI1-DIR-DEB login[904]: pam_unix(login:session): session opened for user pauldupont by LOGIN(uid=0)
  4. May 18 09:09:53 CLI1-DIR-DEB login[904]: pam_systemd(login:session): Failed to get user data
  5. May 18 09:09:53 CLI1-DIR-DEB login[904]: pam_systemd(login:session): Failed to get user data
  6. May 18 09:09:53 CLI1-DIR-DEB login[904]: User not known to the underlying authentication module
看起来你正在提供一个binddn,但它的凭据不好. /etc/ldap.secret的内容和你在-W提示符中的内容是否完全相同?

rootbinddn是root用户在客户机上使用的binddn.它通常不应该是后缀的rootdn,因为这意味着机器的妥协也会损害目录.

在pam_ldap和nss-ldap / nss-ldapd上使用sssd的情况很少是正确的选择.这不是其中之一. (根据我的经验,它一直限于验证非posix帐户.)

在处理RFC2307与RFC2307bis组时,还有其他问题,但在此之前你就失败了.当这成为你的实际问题时,请问另一个问题.

猜你在找的Bash相关文章