ldapsearch 使用用户名和密码 [英] ldapsearch with username and password

查看:139
本文介绍了ldapsearch 使用用户名和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的 LDAP ORG 结构:

Here is my LDAP ORG Structure:

我用名字、姓氏和密码创建了用户.但是当我尝试使用 jdbc 连接时它不起作用.错误表示凭据无效.然后我按如下方式尝试了ldapsearch:

I created user with first, last name with password. But it is not working when am trying to connect using jdbc. Error says invalid credentials. Then I tried ldapsearch as follows:

我遵循了这个 过程 用于用户和组创建:

I followed this process for users and group creation:

root@ip:/home# ldapwhoami
SASL/DIGEST-MD5 authentication started
Please enter your password:
ldap_sasl_interactive_bind_s: Invalid credentials (49)
    additional info: SASL(-13): user not found: no secret in database

root@ip:/# ldapsearch -x -LLL -h ip -D username -w password -b"cn=admin,dc=ivhdev,dc=local" -s sub "(objectClass=*)" "givenName=username*"
ldap_bind: Invalid DN syntax (34)
    additional info: invalid DN

如果我以 DN 语法传递正确的信息,请建议/纠正我.我无法使用用户名和密码验证用户凭据.

Please suggest/correct me, if am passing the right info in DN syntax. I am unable to validate the user credentials with their name and password.

推荐答案

-D 选项采用 DN 来登录到您的 LDAP 服务器.

The -D option takes the DN for logging in to your LDAP server.

-b 选项在您想要搜索用户名的 LDAP 树中进行搜索 base.

The -b option takes the search base in your LDAP tree where you want to search for the user's given name.

所以,你的 ldapsearch 命令变成:

So, your ldapsearch command becomes:

ldapsearch -x -LLL -h ip -D 'cn=admin,dc=ivhdev,dc=local' -w password -b 'dc=users,dc=local' -s sub '(objectClass=*)' 'givenName=username*'

这篇关于ldapsearch 使用用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆