免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6329 | 回复: 10
打印 上一主题 下一主题

[ldap] ldap操作系统身份验证的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-07 16:22 |只看该作者 |倒序浏览
想用ldap作为操作系统登录口令验证方式,各项都配置好了,pam.conf的auth模块如下配置:
#######
#Test
other   auth requisite  pam_authtok_get.so.1
other   auth required   pam_dhkeys.so.1
other   auth required   pam_unix_cred.so.1
other   auth binding    pam_unix_auth.so.1 server_policy
other   auth required   pam_ldap.so.1 debug

ldapclient也配置成功,然而登录的时候非本地用户仍然无法登录,查看syslog发现如下错误:

Apr  7 15:25:22 t1000-test-251 nfs4cbd[28425]: [ID 867284 daemon.notice] nfsv4 cannot determine local hostname binding for transport tcp - delegations will not be available on this transport
Apr  7 15:25:38 t1000-test-251 login: [ID 293258 auth.error] libsldap: Status: 32  Mesg: openConnection: simple bind failed - No such object
Apr  7 15:25:48 t1000-test-251 last message repeated 3 times
Apr  7 15:48:44 t1000-test-251 login: [ID 293258 auth.error] libsldap: Status: 32  Mesg: openConnection: simple bind failed - No such object

经测试,ldap连接正常:
# /usr/lib/ldap/ldap_cachemgr -g

cachemgr 配置:
服务器调试级          0
服务器日志文件  "/var/ldap/cachemgr.log"
对 ldapcachemgr         18 的呼叫号

cachemgr 高速缓冲内存数据统计:
配置重新整理信息:
  配置为 NO REFRESH。
服务器信息:
  上一次重新整理的时间:2008/04/07 15:35:21
  下一次重新整理的时间:2008/04/07 16:15:21
  服务器: 111.107.117.26,状态: 向上
高速缓冲内存数据信息:
  最大的高速缓冲内存项:          256
  高速缓冲内存项的数目:         0
#

难道是客户端的solaris10上的ldap客户端和ldap服务器的版本不同的原因么?

[ 本帖最后由 fusm 于 2008-4-7 16:52 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-04-07 17:20 |只看该作者
把你的pam.d/system-auth文件贴出来看看~~

论坛徽章:
0
3 [报告]
发表于 2008-04-08 10:02 |只看该作者
pam.conf只动了这部分,其它都用原来默认的:
#######
#Test
other   auth requisite  pam_authtok_get.so.1
other   auth required   pam_dhkeys.so.1
other   auth required   pam_unix_cred.so.1
other   auth binding    pam_unix_auth.so.1 server_policy
other   auth required   pam_ldap.so.1 debug
===================================================================================
ldap_client_file
#
# Do not edit this file manually; your changes will be lost.Please use ldapclient (1M) instead.
#
NS_LDAP_FILE_VERSION= 2.0
NS_LDAP_SERVERS= dc1-ldap-32.domain.com, dc2-ldap-33.domain.com, dc1-ldap-55.domain.com, dc2-ldap-56.domain.com
NS_LDAP_SEARCH_BASEDN= dc=domain,dc=com
NS_LDAP_AUTH= tls:simple
NS_LDAP_SEARCH_REF= TRUE
NS_LDAP_SEARCH_SCOPE= sub
NS_LDAP_SEARCH_TIME= 30
NS_LDAP_CACHETTL= 43200
NS_LDAP_PROFILE= dc1_prod_profile
NS_LDAP_CREDENTIAL_LEVEL= proxy
NS_LDAP_SERVICE_SEARCH_DESC= passwd: ou=People,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= group: ou=group,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= shadow: ou=People,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= netgroup: ou=Netgroup,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= auto.master: nisMapName=auto.master,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= auto.home: nisMapName=auto.home,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= auto_master: automountMapName=auto_master,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= auto_home: automountMapName=auto_home,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= auto_direct: automountMapName=auto_direct,dc=domain,dc=com?one
NS_LDAP_SERVICE_SEARCH_DESC= sudoers: ou=sudoers,dc=domain,dc=com
NS_LDAP_BIND_TIME= 10
NS_LDAP_ATTRIBUTEMAP= automount: automountMapName=ou
NS_LDAP_ATTRIBUTEMAP= automount: automountKey=cn
NS_LDAP_ATTRIBUTEMAP= automount: automountInformation=nisMapEntry
NS_LDAP_OBJECTCLASSMAP= automount: automountMap=nisMap
NS_LDAP_OBJECTCLASSMAP= automount: automount=nisObject
=======================================================================================
ldap_client_cred
#
# Do not edit this file manually; your changes will be lost.Please use ldapclient (1M) instead.
#
NS_LDAP_BINDDN= cn=proxyagent,ou=profile,dc=domain,dc=com
NS_LDAP_BINDPASSWD= {NS1}ecc423aad0fe2349fd13

=======================================================================================
nsswitch.conf
#
# /etc/nsswitch.ldap:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses LDAP in conjunction with files.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

# the following two lines obviate the "+" entry in /etc/passwd and /etc/group.
passwd: files ldap
shadow: files ldap
group: files ldap
netgroup: ldap
sudoers: files ldap

# consult /etc "files" only if ldap is down.
hosts: files
ipnodes: files

# Uncomment the following line and comment out the above to resolve
# both IPv4 and IPv6 addresses from the ipnodes databases. Note that
# IPv4 addresses are searched in all of the ipnodes databases before
# searching the hosts databases. Before turning this option on, consult
# the Network Administration Guide for more details on using IPv6.
#ipnodes: ldap [NOTFOUND=return] files

networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files

automount: ldap files
aliases: files ldap

# for efficient getservbyname() avoid ldap
services: files ldap
sendmailvars: files

auth_attr: files ldap
prof_attr: files ldap

project: files ldap
printers: user files nis nisplus xfn

[ 本帖最后由 fusm 于 2008-4-8 10:09 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2008-04-08 11:47 |只看该作者
你的系统认证的时候没有找LDAP服务器~
你PAM配置文件设定有问题~~~~
/etc/ldap.conf
这个文件好像也有点问题~~~

论坛徽章:
0
5 [报告]
发表于 2008-04-08 11:48 |只看该作者
下面是我的PAM配置文件~你参考一下或许有帮助~~

  1. auth        required      /lib/security/$ISA/pam_env.so
  2. auth        sufficient    /lib/security/$ISA/pam_unix.so likeauth nullok
  3. auth        sufficient    /lib/security/$ISA/pam_ldap.so use_first_pass
  4. auth        required      /lib/security/$ISA/pam_deny.so

  5. account     required      /lib/security/$ISA/pam_unix.so broken_shadow
  6. account     sufficient    /lib/security/$ISA/pam_localuser.so
  7. account     sufficient    /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet
  8. account     [default=bad success=ok user_unknown=ignore] /lib/security/$ISA/pam_ldap.so
  9. account     required      /lib/security/$ISA/pam_permit.so

  10. password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3
  11. password    sufficient    /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
  12. password    sufficient    /lib/security/$ISA/pam_ldap.so use_authtok
  13. password    required      /lib/security/$ISA/pam_deny.so

  14. session     required      /lib/security/$ISA/pam_limits.so
  15. session     required      /lib/security/$ISA/pam_unix.so
  16. session     optional      /lib/security/$ISA/pam_ldap.so
复制代码

论坛徽章:
0
6 [报告]
发表于 2008-04-08 16:29 |只看该作者

回复 #4 gavinzhm 的帖子

可否详细解释一下呢?

论坛徽章:
0
7 [报告]
发表于 2008-04-08 16:31 |只看该作者

回复 #5 gavinzhm 的帖子

我的版本是solaris10啊,模块变了,而且likeauth nullok use_first_pass这些选项也都取消了的。

论坛徽章:
0
8 [报告]
发表于 2008-04-09 07:22 |只看该作者
ldap服务那边不归我管,具体都是自己试验的。
配置ldap客户端虽然正常,但
ldapsearch -x cn=teacher
却提示无权限。
不知道是不是口令加密方式的原因,ldap服务器那边好像是md5加密方式。

[ 本帖最后由 fusm 于 2008-4-9 08:01 编辑 ]

论坛徽章:
0
9 [报告]
发表于 2008-04-09 11:26 |只看该作者
ldapsearch -H hostname -x
看看你的LDAP可以查询吗~?
当然要开放匿名权限~如果没要的话~需要有个能读的权限~

论坛徽章:
0
10 [报告]
发表于 2008-04-09 11:36 |只看该作者
用ldapsearch查过,提示无权限。
而用outlook却能查。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP