centos8的综合配置实验总结(CentOS7简单搭建OpenLDAP服务)
centos8的综合配置实验总结(CentOS7简单搭建OpenLDAP服务)
2024-09-30 04:27:15  作者:祂咱旳愛  网址:https://m.xinb2b.cn/know/qdx253232.html

安装ldap服务[root@ldap ~]# yum install -y openldap-servers openldap-clients,我来为大家科普一下关于centos8的综合配置实验总结?以下内容希望对你有帮助!


centos8的综合配置实验总结

安装ldap服务

[root@ldap ~]# yum install -y openldap-servers openldap-clients

[root@ldap ~]# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

[root@ldap ~]# chown ldap. /var/lib/ldap/DB_CONFIG

[root@ldap ~]# systemctl start slapd

[root@ldap ~]# systemctl enable slapd

配置ldap服务

# 生成管理员密码

[root@ldap ~]# slappasswd

New password:

Re-enter new password:

{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@ldap ~]# vim chrootpw.ldif

# specify the password generated above for "olcRootPW" section

dn: olcDatabase={0}config,cn=config

changetype: modify

add: olcRootPW

olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@ldap ~]# ldapadd -Y external -H ldapi:/// -f chrootpw.ldif

SASL/EXTERNAL authentication started

SASL username: gidNumber=0 uidNumber=0,cn=peercred,cn=external,cn=auth

SASL SSF: 0

modifying entry "olcDatabase={0}config,cn=config"

导入基本模式

[root@ldap ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif

SASL/EXTERNAL authentication started

SASL username: gidNumber=0 uidNumber=0,cn=peercred,cn=external,cn=auth

SASL SSF: 0

adding new entry "cn=cosine,cn=schema,cn=config"

[root@ldap ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif

SASL/EXTERNAL authentication started

SASL username: gidNumber=0 uidNumber=0,cn=peercred,cn=external,cn=auth

SASL SSF: 0

adding new entry "cn=nis,cn=schema,cn=config"

[root@ldap ~]# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif

SASL/EXTERNAL authentication started

SASL username: gidNumber=0 uidNumber=0,cn=peercred,cn=external,cn=auth

SASL SSF: 0

adding new entry "cn=inetorgperson,cn=schema,cn=config"

在ldap的DB中设置域名

# 生成目录管理员密码

[root@ldap ~]# slappasswd

New password:

Re-enter new password:

{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@ldap ~]# vim chdomain.ldif

# replace to your own domain name for "dc=***,dc=***" section

# specify the password generated above for "olcRootPW" section

dn: olcDatabase={1}monitor,cn=config

changetype: modify

replace: olcAccess

olcAccess: {0}to * by

dn.base="gidNumber=0 uidNumber=0,cn=peercred,cn=external,cn=auth"

read by dn.base="cn=Manager,dc=jumpserver,dc=tk" read by * none

dn: olcDatabase={2}hdb,cn=config

changetype: modify

replace: olcSuffix

olcSuffix: dc=jumpserver,dc=tk

dn: olcDatabase={2}hdb,cn=config

changetype: modify

replace: olcRootDN

olcRootDN: cn=Manager,dc=jumpserver,dc=tk

dn: olcDatabase={2}hdb,cn=config

changetype: modify

add: olcRootPW

olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

dn: olcDatabase={2}hdb,cn=config

changetype: modify

add: olcAccess

olcAccess: {0}to attrs=userPassword,shadowLastChange by

dn="cn=Manager,dc=jumpserver,dc=tk" write by anonymous auth by self write by *

none

olcAccess: {1}to dn.base="" by * read

olcAccess: {2}to * by dn="cn=Manager,dc=jumpserver,dc=tk" write by * read

[root@ldap ~]# ldapmodify -Y EXTERNAL -H ldapi:/// -f chdomain.ldif

SASL/EXTERNAL authentication started

SASL username: gidNumber=0 uidNumber=0,cn=peercred,cn=external,cn=auth

SASL SSF: 0

modifying entry "olcDatabase={1}monitor,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

[root@ldap ~]# vim basedomain.ldif

# replace to your own domain name for "dc=***,dc=***" section

dn: dc=jumpserver,dc=tk

objectClass: top

objectClass: dcObject

objectclass: organization

o: Server tk

dc: jumpserver

dn: cn=Manager,dc=jumpserver,dc=tk

objectClass: organizationalRole

cn: Manager

description: Directory Manager

dn: ou=People,dc=jumpserver,dc=tk

objectClass: organizationalUnit

ou: People

dn: ou=Group,dc=jumpserver,dc=tk

objectClass: organizationalUnit

ou: Group

[root@ldap ~]# ldapadd -x -D cn=Manager,dc=jumpserver,dc=tk -W -f basedomain.ldif

Enter LDAP Password: # 输入目录管理员密码

adding new entry "dc=jumpserver,dc=tk"

adding new entry "cn=Manager,dc=jumpserver,dc=tk"

adding new entry "ou=People,dc=jumpserver,dc=tk"

adding new entry "ou=Group,dc=jumpserver,dc=tk"

开放端口

# firewall-cmd --add-service=ldap --permanent

success

# firewall-cmd --reload

success

添加一个用户

# 生成用户密码

[root@ldap ~]# slappasswd

New password:

Re-enter new password:

{SSHA}xxxxxxxxxxxxxxxxx

[root@ldap ~]# vi ldapuser.ldif

# create new

# replace to your own domain name for "dc=***,dc=***" section

dn: uid=test,ou=People,dc=jumpserver,dc=tk

objectClass: inetOrgPerson

objectClass: posixAccount

objectClass: shadowAccount

cn: test

sn: Linux

userPassword: {SSHA}xxxxxxxxxxxxxxxxx

loginShell: /bin/bash

uidNumber: 1000

gidNumber: 1000

homeDirectory: /home/test

dn: cn=test,ou=Group,dc=jumpserver,dc=tk

objectClass: posixGroup

cn: test

gidNumber: 1000

memberUid: test

[root@ldap ~]# ldapadd -x -D cn=Manager,dc=jumpserver,dc=tk -W -f ldapuser.ldif

Enter LDAP Password:

adding new entry "uid=test,ou=People,dc=jumpserver,dc=tk"

adding new entry "cn=test,ou=Group,dc=jumpserver,dc=tk"

[root@ldap ~]# ldapsearch -x -D "cn=Manager,dc=jumpserver,dc=tk" -W -b "

"dc=jumpserver,dc=tk"

  • 王者荣耀只加强要出新皮肤的英雄(王者荣耀公布新英雄)
  • 2024-09-30王者荣耀公布新英雄王者荣耀一直都是大家讨论的重点,最近这方面的消息有很多了,因为每隔一段时间就会有新东西上线,不管是新皮肤还是新英雄,都是大家热议的话题,除了新东西之外,还有一些老东西也是大家在讨论的,特别是皮肤,一些。
  • 严查统计造假的规定(从源头预防统计造假不正之风)
  • 2024-09-30从源头预防统计造假不正之风“贪如火,不遏则自焚;欲如水,不遏则自溺人生一世少犯错,必须警钟长鸣党员干部、公职人员要把警示教育作为人生必修课,守规矩、明底线、知敬畏……”近日,市统计局执法队队长任斌全程参与警示教育大会后深受触动。
  • 洗衣机出现fc并鸣叫怎么处理(衣机出现FC怎么解决)
  • 2024-09-30衣机出现FC怎么解决海尔洗衣机接通电源都显示FC代码,是通讯不良的故障,这有可能是电脑板、驱动板之间的通讯出现异常造成的故障处理方法:检查主控板与驱动板通信排线是否插到位,检查电源板有没有给驱动器供电,如果线路出现问题建。
  • 有什么免费的学习网站吗(推荐6个高质量学习网站)
  • 2024-09-30推荐6个高质量学习网站成年人的世界,没有容易二字,想要不被社会淘汰,就必须要不断的学习,今天小编就来为大家推荐6个高质量学习网站,在这里可以免费看视频学习本领,基础理论、专业知识、办公技巧、应有尽有,想提升自己的小伙伴赶紧。
  • 李守常名言名句(只看开头我便哭了)
  • 2024-09-30只看开头我便哭了“惟吾中国,自鸦片战役而后,继之以英法联军之役,太平天国之变,甲午之战,庚子之变,乃至辛亥革命之变,直到于今,中国民族尚困轭于列强不平等条约之下,而未能解脱此等不平等条约如不废除,则中国将永不能恢复其。
  • 舞龙舞狮儿童画(手抄报儿童画)
  • 2024-09-30手抄报儿童画#文化大拜年#春节新,万象新鞭炮声声辞旧岁鼓声起,瑞狮舞彩巾围上显威武敲锣打鼓多热闹喜气洋洋的新年到大吉大利欢天喜地福星高照今天,我们一起来画一幅:舞狮过大年工具如上:纸张选用8k素描纸,上色工具还可。
  • 八千里路云和月白了少年头(三十功名尘与土)
  • 2024-09-30三十功名尘与土原文秋,入见,帝手书“精忠岳飞”字,制旗以赐之授镇南军承宣使、江南西路沿江制置使,又改神武后军都统制,仍制置使,李山、吴全、吴锡、李横、牛皋皆隶焉……襄汉平,飞辞制置使,乞委重臣经画荆襄,不许赵鼎奏:。
  • 天津哪个景点被劝返(昨夜今晨已有多人中招)
  • 2024-09-30昨夜今晨已有多人中招封面关注已有多人中招!公安部发布重要提醒——万众期待的线下演唱会回归多位歌手陆续官宣演唱会行程很多歌迷已经摩拳擦掌准备好抢票了然而再想亲临演唱会现场也得提防被骗!3月2日公安部网安局发布重要提醒——诈。
  • 为什么青春有你2这么火(青春有你2这些梗为什么这么火)
  • 2024-09-30青春有你2这些梗为什么这么火随着印刷术时代步入没落,而电视时代蒸蒸日上;电视改变了公众话语的内容和意义政治、宗教、教育和任何其他公共事务领域的内容,都不可避免的被电视的表达方式重新定义被网络与流量定义,并被绑架是的,不得不说,波。
  • 致自己的心情句子(很暖很治愈的短句)
  • 2024-09-30很暖很治愈的短句不要尝试去弄清每件事,因为有时候一些事情不是用来理解的,而是要懂得接受它们每个人都一样,都有一段独行的日子,或长或短,这都是无可回避的不必总觉得生命空空荡荡,放心吧,一时的孤独只是意味着你值得拥有更好。