科技常识:linux搭建ldap服务器详细步骤

2021-06-08 16:28:00
导读今天小编跟大家讲解下有关科技常识:linux搭建ldap服务器详细步骤,相信小伙伴们对这个话题应该也很关注吧,小编也收集到了有关科技常识:l

今天小编跟大家讲解下有关科技常识:linux搭建ldap服务器详细步骤,相信小伙伴们对这个话题应该也很关注吧,小编也收集到了有关科技常识:linux搭建ldap服务器详细步骤的相关资料,希望小伙伴会喜欢也能够帮助大家。

ldap这种原始的服务器搭建起来比较复杂,同时它也是CE必考的(客户端的搭建)。

1、安装openldap-servers软件包

2、查看ldap模板文件的存放位置:

3、拷贝ldap模板文件到配置文件目录并修改文件名为slapd.conf。

4、删除/etc/openldap目录下原有的文件,保留下这几个文件,注意:以前学时是要删除schema文件,直留下三个,但是我测试时如果删除schema服务将失败。

5、修改slapd.conf文件的权限:

6、修改sldap.conf配置文件:如下:(主要配好红色的就ok,没有的都是被注释掉的)

复制代码代码如下:include /etc/openldap/schema/corba.schemainclude /etc/openldap/schema/core.schemainclude /etc/openldap/schema/cosine.schemainclude /etc/openldap/schema/duaconf.schemainclude /etc/openldap/schema/dyngroup.schemainclude /etc/openldap/schema/inetorgperson.schemainclude /etc/openldap/schema/java.schemainclude /etc/openldap/schema/misc.schemainclude /etc/openldap/schema/nis.schemainclude /etc/openldap/schema/openldap.schemainclude /etc/openldap/schema/ppolicy.schemainclude /etc/openldap/schema/collective.schemaallow bind_v2pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.argsdatabase bdb suffix"dc=example,dc=com"checkpoint 1024 15 rootdn"cn=Manager,dc=example,dc=com"rootpw redhatdirectory /var/lib/ldapindex objectClass eq,presindex ou,cn,mail,surname,givenname eq,pres,subindex uidNumber,gidNumber,loginShell eq,presindex uid,memberUid eq,pres,subdatabase monitoraccess to * by dn.exact="cn=Manager,dc=example,dc=com"read by * none

7、重启动ldap服务器:

8、创建ldap用户目录:

9、编辑一个自动创建ldap用户的脚本:

10 、执行此脚本添加用户:

11、把ldap用户,组分别导出来,到一个文件中:(例子只做了组)用户在、/etc/passwd下

12、安装软件包:

13、去它的目录下编译ldap用户组文件:

14、修改migrate_common.ph文件:

15、执行./migrate_base.pl文件,并导出到一个目录下边,进行进行修改,只留下最基本的三个配置:

16,、分别使用./migrate_passwd.pl ./migrate_group.pl编译我们已经导出的ldap用户和组文件: /mnt/user /mnt/group分别是从/etc/passwd /etc/group 导出的ldap用户和组文件

/date/user.ldif /date/group.ldif 是编译后生成的文件要以ldif结尾

17、看下/date下我们编译好的几个文件:

18、添加ldap用户和组:

首先提示输入密码,其次添加成功。

还有个用户,必须首先执行base.ldif文件,它是最基本的配置。

来源:爱蒂网

免责声明:本文由用户上传,如有侵权请联系删除!

猜你喜欢

最新文章