RHEL 6.6客户机上的OpenLDAPconfiguration

我们有一个shell脚本,它运行perl程序连接到LDAP服务器并进行input。

这是使用ldap的唯一脚本。 此服务器托pipe所有批处理相关的文件,并在autosys上运行批处理作业。 所以我们不希望在这台服务器上进行LDAPauthentication。 我们唯一使用的ldap是连接到LDAP服务器并更新条目。 一些其他的Web应用程序用户LDAPauthentication,现在不涉及我们。

现在我们将我们的批处理服务器从Solairs 10迁移到RHEL 6.6。 旧机器有SUNWlldap,我们正在尝试在新的Linux机器上configurationOpenLDAP客户机。 LDAP服务器是RHEL 5.11,使用的是openldap

我们在新机器上安装了低于rpm的数据。

nss-pam-ldapd-0.7.5-18.2.el6_4.x86_64, openldap-2.4.39-8.el6.x86_64, pam_ldap-185-11.el6.x86_64, apr-util-ldap-1.3.9-3.el6_0.1.x86_64, perl-Mozilla-LDAP-1.5.3-4.el6.x86_64, compat-openldap-2.3.43-2.el6.x86_64, perl-LDAP-0.40-1.el6.noarch. 

根据以下链接configuration客户端:

http://unixadminschool.com/blog/2013/03/rhel-6-implementation-of-ldap-authentication

我已经遗漏了证书的一部分。 我已经在旧服务器中search了证书,但在任何地方找不到它。 我不知道如何连接没有使用证书,也不知道我们是否需要证书来达到我们的目的。

以下是使用ldap的脚本:

 $oid001i.pl $input_file $LDAP_Server $LDAP_Port $LDAP_ID $LDAP_PWD $LDAP_UserBaseDN 

所有这些variables都来自另一个文件。 以下是该文件的内容

 LDAP_Server=servername.company.com LDAP_Port=1389 LDAP_ID="cn=username,cn=users,dc=company,dc=com" LDAP_PWD="password" LDAP_UserBaseDN="cn=users,dc=company,dc=com" 

oid001i.pl绑定的Perl代码:

 $ldap = Net::LDAP->new( $LDAP_Server, port=>$LDAP_Port, version => 3); $mesg = $ldap->bind( $LDAP_ID,password => $LDAP_PWD); $SearchFor="cn=$cn"; #Perform Search $mesg = $ldap->search( base => $LDAP_UserBaseDN, filter => $SearchFor,callback => \&ParseEntry,); $mesg = $ldap->unbind; # take down session 

当我执行

 $perl oid001i.pl input_file server.company.com port "cn=username,cn=users,dc=company,dc=com" password "cn=users,dc=company,dc=com" 

我们得到这个错误:

 Can't call method "bind" on an undefined value at oid001i.pl line 21, <IN> line 1. 

我运行这个命令来检查连接,并得到错误:

 $ldapsearch -h servername.company.com -p 1389 -LLLx -b 'cn=users,dc=comapany,dc=com' -s base Cannot connect to the LDAP server 

我在这里错过了什么? 证书是否必须连接到LDAP服务器? 在LDAP服务器端还有其他的事情要做吗? 任何帮助将不胜感激?