centos7使用AD域实现账号统一认证
背景是公司的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
公司有现成的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
...全文
相关推荐
Zabbix对接LDAP实现用户统一登录.docx
如果认证成功的话,默认在 Zabbix 平台上登录就会创建此账号,账号和密码都是和 AD 域上的一样,实现用户认证统一登录。
Windows和Linux混合系统通过AD域实现用户集中认证
管理的Linux服务器和Windows服务器如果很多,如果都用本地用户名管理,要管理和记住几十台甚至上百台服务器的不同账号不同密码,这是很难的。但是如果所有服务器账号密码都设置一样,那又完全没有安全性可言。什么是服务器的集中认证(统一权限管理)?当服务器数量呈几何级增长之后,为每台机器维护单独的用户系统已经成为了一个几乎不可能完成的任务(试想下为一万台服务器上的每个用户每三个月修改一次密码)。
Linux 加入到Windows AD域
完成上述步骤后,执行Kerberos认证命令`kinit`,使用AD域管理员账号获取票证。如果一切配置正确,此命令应该能成功执行,无任何错误返回。
linux加入windows域之完美方案
### Linux加入Windows域之完美方案#### 一、引言在IT环境中,尤其是在企业级应用中,将Linux系统加入Windows域(Active Directory,简称AD)对于实现统一管理和资源共享至关重要
Centos7 Joining Active Directory
start ntpd.service```最后,使用 `realm join` 命令将 CentOS 机器加入 AD 域。


系统维护与使用区
