设为首页 加入收藏

TOP

LDAP客户端在Windows环境的部署及配置(一)
2019-08-24 00:10:04 】 浏览:61
Tags:LDAP 客户端 Windows 环境 部署 配置

ldap客户端配置
安装目录的子目录C:\OpenLDAP\etc\openldap,编辑slapd.conf,修改密码,保存并关闭文件。
rootdn           "cn=Manager,dc=my-domain,dc=com"(在111行,管理员账号)
rootpw          123456(在115行,管理员密码)
进入安装目录的子目录C:\OpenLDAP\libexec,编辑StartLDAP.cmd,将FQDN的值设置为本机ip地址,这样才可以访问到远端的远端,原本设置为localhost是无法访问到远端的,保存并关闭文件。
以上步骤完成后,启动LDAPServer应用程序,启动后如下图。
安装LdapBrowser282
将LdapBrowser282.rar解压,进入文件夹,双击lbe,即可运行。(需要java环境)
连接配置
Host填入本机ip地址,端口号389,点击Fetch DNs按钮,Base DN会自动搜索填充,User Info中填写slapd.conf配置的管理员用户名和密码,点击Save按钮进行保存。
点击Connect按钮进行连接。

导入以下文件:C:\OpenLDAP\etc\ldif\base.ldif和users.ldif
选中左侧根节点,点击导入按钮,选择Update/Add,在LDIF File中依次C:\OpenLDAP\etc\ldif\base.ldif和users.ldif,注意按顺序导入,一次只能导入一个文件。
导入成功base.ldif成功,此时导入的是分组,还未导入具体用户。
继续选择左侧根节点,相同方法导入users.ldif.。
导入成功后,ou=People节点下面会新增一个安装时默认的用户hacker。
如需新增用户,则修改user.ldif,以默认用户为模板,复制粘贴后更改属性dn和userPassword,粘贴时注意:请将新加用户粘贴在默认用户hacker上部,使hacker为最后一个用户,ldap校验不识别最后一个用户。
在此,我们可以认为uid是用户名,ou是用户的属组,导入的base.ldif中已经预先设置了三种属组:Group、People、Manager,选用People;dc=my-domain代表域为my-domain,dc=com为固定格式

openldap编出来几个工具,其中使用到ldapsearch工具,具体参数如下:

ldapsearch -h IP -p 389 -x -D "uid=zhangsan,ou=People,dc=Baidu,dc=com"  -w "password" -b "dc=Baidu,dc=com" -s base -LLL PLAIN
ldapsearch --help
ldapsearch: invalid option -- '-'
ldapsearch: unrecognized option --
usage: ldapsearch [options] [filter [attributes...]]
where:
  filter    RFC 4515 compliant LDAP search filter
  attributes    whitespace-separated list of attribute descriptions
    which may include:
      1.1   no attributes
      *     all user attributes
      +     all operational attributes
Search options:
  -a deref   one of never (default), always, search, or find
  -A         retrieve attribute names only (no values)
  -b basedn  base dn for search
  -c         continuous operation mode (do not stop on errors)
  -E [!]<ext>[=<extparam>] search extensions (! indicates criticality)
             [!]domainScope              (domain scope)
             !dontUseCopy                (Don't Use Copy)
             [!]mv=<filter>              (RFC 3876 matched values filter)
             [!]pr=<size>[/prompt|noprompt] (RFC 2696 paged results/prompt)
             [!]sss=[-]<attr[:OID]>[/[-]<attr[:OID]>...]
                                         (RFC 2891 server side sorting)
             [!]subentries[=true|false]  (RFC 3672 subentries)
             [!]sync=ro[/<cookie>]       (RFC 4533 LDAP Sync refreshOnly)
                     rp[/<cookie>][/<slimit>] (refreshAndPersist)
             [!]vlv=<before>/<after>(/<offset>/<count>|:<value>)
                                         (ldapv3-vlv-09 virtual list views)
             [!]deref=derefAttr:attr[,...][;derefAttr:attr[,...][;...]]
             [!]<oid>[=:<b64value>] (generic control; no response handling)
  -f file    read operations from `file'
  -F prefix  URL prefix for files (default: file:///tmp/)
  -l limit   time limit (in seconds, or "none" or "max") for search
  -L         print responses in LDIFv1 format
  -LL        print responses in LDIF format without comments
  -LLL       print responses in LDIF format without comments
             and version
  -M         enable Manage DSA IT control (-MM to make critical)
  -P version protocol version (default: 3)
  -s scope   one of base, one, sub or children (search scope)
  -S attr    sort the results by attribute `attr'
  -t         write binary values to files in temporary directory
  -tt        write all values to files in temporary directory
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇如何配置Open Live Writer程序以.. 下一篇python 简史

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目