centos7使用AD域实现账号统一认证

-编译-人生- 2019-11-21 02:29:14
背景是公司的linux主机越来越多,想把账号统一管理
公司有现成的windows域
在网上查了一些资料,理论上应该可以实现。
配置方法参考的自
https://www.jianshu.com/p/af295531eaf6

启动正常没有报错
但就是查不到用户

通过ldapsearch命令可以正常查询到用户列表
ldapsearch -H "ldap://192.168.1.16:389" -D "cn=ldap,cn=users,dc=test,dc=com" -w 'abcd1234' -b "cn=users,DC=test,DC=com" -x| grep sAMAccountName| wc -l
28

getent passwd 命令
debug信息如下

nslcd: [334873] <passwd(all)> DEBUG: myldap_search(base="dc=test,dc=com", filter="(objectClass=posixAccount)")
nslcd: [334873] <passwd(all)> DEBUG: ldap_initialize(ldap://192.168.1.16/)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_rebind_proc()
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_PROTOCOL_VERSION,3)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_DEREF,0)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_TIMELIMIT,0)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_TIMEOUT,0)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_NETWORK_TIMEOUT,0)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_REFERRALS,LDAP_OPT_ON)
nslcd: [334873] <passwd(all)> DEBUG: ldap_set_option(LDAP_OPT_RESTART,LDAP_OPT_ON)
nslcd: [334873] <passwd(all)> DEBUG: ldap_simple_bind_s("cn=ldap,cn=users,dc=test,dc=com","***") (uri="ldap://192.168.1.16/")
nslcd: [334873] <passwd(all)> DEBUG: ldap_result(): end of results (0 total)

也就是返回结果是0条记录

配置文件
cat /etc/nslcd.conf | grep -v ^# | grep -v "^$"
uid nslcd
gid ldap
uri ldap://192.168.1.16/
base dc=test,dc=com
binddn cn=ldap,cn=users,dc=test,dc=com
bindpw abcd1234
ssl no
tls_cacertdir /etc/openldap/cacerts


...全文
964 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
-编译-人生- 2019-11-29
  • 打赏
  • 举报
回复
有没有大佬

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧