openldap身份validationSSH

我试图在一个运行在debian 6上的openldap服务器上设置一个名为ldap_client的ldap-client主机上的sshauthentication。

以下是ldapsearch在服务器上返回的内容:

dn: dc=localnet,dc=lan objectClass: dcObject objectClass: organization dc: localnet o: Some_Enterprise description: localnet.lan dn: ou=people,dc=localnet,dc=lan objectClass: top objectClass: organizationalUnit ou: people dn: ou=groups,dc=localnet,dc=lan objectClass: top objectClass: organizationalUnit ou: groups dn: uid=joe,ou=people,dc=localnet,dc=lan objectClass: account objectClass: posixAccount cn: joe uid: joe uidNumber: 10001 gidNumber: 2000 homeDirectory: /home/joe loginShell: /bin/sh gecos: joe description: joe 

在客户端,我已经configuration了libnss-ldap和nsswitch.conf。

 passwd: files ldap group: files ldap shadow: files ldap 

所以客户端上的unix命令id(id joe)返回它的uid / gid。 所以用户被ldap识别。

但经过几个小时的谷歌周围,我没有能够在客户端与SSH设置身份validation。

我在/etc/pam.d/commun-account,commun-auth和commun-password中有这些行

 auth sufficient pam_ldap.so auth required pam_unix.so nullok_secure 

这些在/etc/pam.d/ssh

 auth sufficient /lib/security/pam_ldap.so no_warn auth required pam_unix.so no_warn try_first_pass account required /lib/security/pam_ldap.so no_warn ignore_authinfo_unavail ignore_unknown_user account required pam_unix.so 

我在/etc/ssh/sshd.conf中使用了usePam = yes。

这里是客户端上auth.log的输出:

 ==> /var/log/auth.log <== Dec 7 17:39:06 versionning sshd[3898]: pam_ldap: error trying to bind (Invalid credentials) Dec 7 17:39:06 versionning sshd[3898]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxx.kimsufi.com user=joe Dec 7 17:39:08 versionning sshd[3898]: Failed password for joe from abcd port 58191 ssh2 

在服务器上:==> / var / log / syslog <== Dec 7 16:42:43 ldap slapd [963]:<= bdb_equality_candidates:(uid)not indexed

和tshark

 LDAP bindResponse(1) invalidCredentials 

我不明白在哪里以及如何configuration乔的密码。 不在客户端的本地unix帐户上,所以在服务器上; 我不知道该怎么做

posixAccount LDAP对象类有一个userPassword属性 – 在这里设置Joe的密码。
一旦你完成了,确定你可以绑定到LDAP目录作为乔(你可以使用ldapsearch来testing) – 如果这个作品pam_ldap也应该工作。

那么,你的joe对象( dn: uid=joe,ou=people,dc=localnet,dc=lan )应该有一个userPassword属性。 该属性保存代表用户密码的密码散列。 在这里阅读密码和OpenLDAP: http : //www.openldap.org/faq/data/cache/419.html