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

查看:1575
本文介绍了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:

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

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命令变为:

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天全站免登陆