无法在Debian Lenny上configurationPAM + LDAP – 在服务器日志上获取错误= 49

我一直在使用Ubuntu 10.04来迁移一些服务器和桌面,使用户从旧的OpenLDAP实现到更新的Centos Active Directory。 到目前为止,我还没有遇到任何问题,直到我到达Debian Lenny服务器。

我已经设置了服务器,设置/etc/ldap.conf和/etc/ldap/ldap.conf。 但是,当我发出“getent passwd”时,我从LDAP服务器上得不到任何东西。

阅读pam_ldap联机帮助页,我意识到/etc/ldap.conf不是pam_ldap -it与Ubuntu一起工作的可接受文件,因此我将其重命名为/etc/pam_ldap.conf。 同样的结果。 但是,一旦我改变了这个文件的名称,当我使用SSHlogin时,我在LDAP服务器日志中得到这个:

[20/Jul/2012:11:19:40 +0200] conn=16501 fd=155 slot=155 connection from xxx50 to 10.1.176.237 [20/Jul/2012:11:19:40 +0200] conn=16501 op=0 BIND dn="uid=ubuntu,ou=Applications,ou=CITIUS,dc=inv,dc=usc,dc=es" method=128 version=3 [20/Jul/2012:11:19:40 +0200] conn=16501 op=0 RESULT err=0 tag=97 nentries=0 etime=0 dn="uid=ubuntu,ou=applications,ou=citius,dc=inv,dc=usc,dc=es" [20/Jul/2012:11:19:40 +0200] conn=16501 op=1 SRCH base="ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es" scope=2 filter="(uid=jorge.suarez)" attrs=ALL [20/Jul/2012:11:19:40 +0200] conn=16501 op=1 RESULT err=0 tag=101 nentries=1 etime=0 notes=U [20/Jul/2012:11:19:40 +0200] conn=16501 op=2 BIND dn="uid=jorge.suarez,ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es" method=128 version=3 [20/Jul/2012:11:19:40 +0200] conn=16501 op=2 RESULT err=49 tag=97 nentries=0 etime=0 

密码不起作用。 我不知道那可能是错的,其他的似乎都没问题。 该用户/密码正在从另一个客户端工作:

 [20/Jul/2012:11:29:39 +0200] conn=16528 fd=188 slot=188 connection from xxx224 to 10.1.176.237 [20/Jul/2012:11:29:39 +0200] conn=16528 op=0 BIND dn="uid=ubuntu,ou=Applications,ou=CITIUS,dc=inv,dc=usc,dc=es" method=128 version=3 [20/Jul/2012:11:29:39 +0200] conn=16528 op=0 RESULT err=0 tag=97 nentries=0 etime=0 dn="uid=ubuntu,ou=applications,ou=citius,dc=inv,dc=usc,dc=es" [20/Jul/2012:11:29:39 +0200] conn=16528 op=1 SRCH base="ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es" scope=2 filter="(uid=jorge.suarez)" attrs=ALL [20/Jul/2012:11:29:39 +0200] conn=16528 op=1 RESULT err=0 tag=101 nentries=1 etime=0 notes=U [20/Jul/2012:11:29:39 +0200] conn=16528 op=2 BIND dn="uid=jorge.suarez,ou=People,ou=CITIUS,dc=inv,dc=usc,dc=es" method=128 version=3 [20/Jul/2012:11:29:39 +0200] conn=16528 op=2 RESULT err=0 tag=97 nentries=0 etime=0 dn="uid=jorge.suarez,ou=people,ou=citius,dc=inv,dc=usc,dc=es" 

我正在使用SSHA在LDAP服务器上存储密码。 也许这不被Debian Lenny支持?

在pam_ldap.conf中,我已经设置了这一点,就像所有其他服务器一样:

 # Do not hash the password at all; presume # the directory server will do it, if # necessary. This is the default. pam_password md5 

也尝试清除,但没有奏效。 不pipe怎样,发行getent passwd仍然让我没有用户,这很奇怪。

但是,如果我使用软件包libpam-dotfile中的pamtest来testinglogin,它将起作用。

 # pamtest ssh jorge.suarez Trying to authenticate <jorge.suarez> for service <ssh>. Password: Authentication successful. # pamtest foo jorge.suarez Trying to authenticate <jorge.suarez> for service <foo>. Password: Authentication successful. 

但是“su”也不行:

 # su jorge.suarez Id. descoñecido: jorge.suarez 

只是从getent passwd输出:

 # getent passwd root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false statd:x:102:65534::/var/lib/nfs:/bin/false sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin luser:x:1000:1000:Usuario local de Burdeos,,,:/home/luser:/bin/bash messagebus:x:105:107::/var/run/dbus:/bin/false sge-admin:x:1001:1001:Administrador do SGE,,,:/home/cluster/sge-admin:/bin/bash ntp:x:107:110::/home/ntp:/bin/false haldaemon:x:108:111:Hardware abstraction layer,,,:/var/run/hald:/bin/false vde2-net:x:109:114::/var/run/vde2:/bin/false uml-net:x:110:115::/home/uml-net:/bin/false polkituser:x:111:116:PolicyKit,,,:/var/run/PolicyKit:/bin/false Debian-pxe:x:113:65534:Dummy user for Debian pxe package,,,:/home/Debian-pxe:/bin/false 

Nscd从一开始就停止了。

我已经迁移到libpam-ldapd,现在一切正常。

我只需要重新configuration一个名为“/etc/nslcd.conf”的新文件。 libpam-ldapd比libpam-ldap好得多。

最有趣的是它依赖于一个守护进程,所以你可以调用带有debugging参数的守护进程(“nslcd -d”),看看有没有按预期工作,如果有一些警告的configuration等等

Ubuntu 10.04有libpam-ldapd 0.7.x,缺less一些有趣的选项。 通过使用PPA更好地使用0.8.x。 Debian Squeeze已经有了0.8.x的版本,我已经在Lenny上安装了它,没有任何问题。