Linux作ldap主从服务器.doc

上传人:s9****2 文档编号:557063992 上传时间:2023-10-26 格式:DOC 页数:4 大小:45.01KB
返回 下载 相关 举报
Linux作ldap主从服务器.doc_第1页
第1页 / 共4页
Linux作ldap主从服务器.doc_第2页
第2页 / 共4页
Linux作ldap主从服务器.doc_第3页
第3页 / 共4页
Linux作ldap主从服务器.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《Linux作ldap主从服务器.doc》由会员分享,可在线阅读,更多相关《Linux作ldap主从服务器.doc(4页珍藏版)》请在金锄头文库上搜索。

1、Linux作Ldap主从Server实验环境:Master: CentOS 5.5 hostname: IP:192.168.1.1Slave: CentOS 5.5 hostname: IP:192.168.1.2Client: Windows XP professional SP3 IP: 192.168.1.3一:Master Ldap Server的安装1:所需软件如下,如果没有请自行安装openldap-clients-2.3.43openldap-servers-2.3.43openldap-2.3.432:修改主Ldap Server的主配置文档,该文档是slapd.conf,位

2、于/etc/openldap/slapd.conf,修改内容如以下红色字体# See slapd.conf(5) for details on configuration options.# This file should NOT be world readable.include /etc/openldap/schema/core.schemainclude /etc/openldap/schema/cosine.schemainclude /etc/openldap/schema/inetorgperson.schemainclude /etc/openldap/schema/nis.s

3、chema# Allow LDAPv2 client connections. This is NOT the default.allow bind_v2# Do not enable referrals until AFTER you have a working directory# service AND an understanding of referrals.#referral ldap:/root.openldap.orgpidfile /var/run/openldap/slapd.pidargsfile /var/run/openldap/slapd.args# Sample

4、 security restrictions# Require integrity protection (prevent hijacking)# Require 112-bit (3DES or better) encryption for updates# Require 63-bit encryption for simple bind# security ssf=1 update_ssf=112 simple_bind=64# Sample access control policy:# Root DSE: allow anyone to read it# Subschema (sub

5、)entry DSE: allow anyone to read it# Other DSEs:# Allow self write access# Allow authenticated users read access# Allow anonymous users to authenticate# Directives needed to implement policy:# access to dn.base= by * read# access to dn.base=cn=Subschema by * read# access to *# by self write# by user

6、s read# by anonymous auth# if no access controls are present, the default policy# allows anyone and everyone to read anything but restricts# updates to rootdn. (e.g., access to * by * read)# rootdn can always read and write EVERYTHING!access to dn.subtree=o=groups,dc=hfnetwork,dc=net by * write #o=g

7、roups以下的条目有写入的权限# ldbm and/or bdb database definitions#database bdbsuffix dc=hfnetwork,dc=net #DNrootdn cn=root,dc=hfnetwork,dc=net #DN管理员# Cleartext passwords, especially for the rootdn, should# be avoided. See slappasswd(8) and slapd.conf(5) for details.# Use of strong authentication encouraged.#

8、rootpw secret# rootpw cryptijFYNcSNctBYgrootpw SSHAh00wEBEW+A9nqQzjmbybqjR2f1to56eq #Ldap Root的密码,用slappasswd来取得root密码,然后把得到的加密密码贴在这里# The database directory MUST exist prior to running slapd AND # should only be accessible by the slapd and slap tools.# Mode 700 recommended.directory /var/lib/ldap#

9、Indices to maintain for this databaseindex objectClass eq,presindex ou,cn,mail,surname,givenname eq,pres,subindex uidNumber,gidNumber,loginShell eq,presindex uid,memberUid eq,pres,subindex nisMapName,nisMapEntry eq,pres,sub# Replicas of this databasereplogfile /var/lib/ldap/replog.log #日志文件replica h

10、ost=192.168.1.2:389 binddn=”cn=root,dc=hfnetwork,dc=net” bindmethod=simple credentials=169470xp #此行一定要在一行,否则会出错,host是从LdapServerIP, binddn指定需同步的DN的管理员,bindmethod是认证方式, credentials是同步的DN的管理员密码(要和上面的rootpw密码相同,否则不会同步)# bindmethod=sasl saslmech=GSSAPI# authcId=host/ldap-EXAMPLE.COM3:启动ldap服务,命令:service

11、 ldap restart,用netstat tunlp |grep 389查询389端口是否开启4:设置开机启动ldap,命令: service ldap on4:向Master Ldap Server添加信息,建立rootdn.ldif文件和user.ldif及uid.ldif文件,这些文件位于/var/test下rootdn.ldif文件如下dn: o=groups,dc=hfnetwork,dc=neto: groupsobjectClass: topobjectClass: organizationuser.ldif文件如下dn: ou=user, o=groups,dc=hfnet

12、work,dc=netou: userobjectClass: topobjectClass: organizationalUnituid.ldif文件如下dn: uid=zhang.feng,ou=user, o=groups,dc=hfnetwork,dc=netclearPassword: 12345678 #clearPassword需在/etc/openldap/schema/core.schema下修改属性uid: zhang.fenguserPassword: e1NIQX1mQ0l2c3BKOWdvcnlMMWtoTk9pVEpJQmpmQTA9objectClass: top

13、objectClass: personobjectClass: inetOrgPersongivenName: fengsn: zhangcn: zhang fengcn: 张锋用ldapadd命令添加信息,命令如下:ldapadd x D “cn=root,dc=hfnetwork,dc=net” W f /var/test/rootdn.ldif h p 389 回车后提示输入DN的Root密码ldapadd x D “cn=root,dc=hfnetwork,dc=net” W f /var/test/uesr.ldif h p 389ldapadd x D “cn=root,dc=hfnetwork,dc=net” W f /var/test/uid.ldif h p 389#至此Master Ldap Server上的信息已添加OK用查询命令看是否有记录,查询命令是ldapsearch x b “cn=root,dc=hfnetwork,dc=net” h p 389#如果有以上rootdn.ldif文件和user.ldif及uid.ldif文件的内容就算成功了二:Slave Ldap Server的设置1:安装Ldap的相关软件,和master相同,这里不再讲述2:关闭Mast

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号