centos8的综合配置实验总结(CentOS7简单搭建OpenLDAP服务)
centos8的综合配置实验总结(CentOS7简单搭建OpenLDAP服务)
2024-07-01 08:16:03  作者:祂咱旳愛  网址:https://m.xinb2b.cn/tech/qdx253232.html

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

centos8的综合配置实验总结(CentOS7简单搭建OpenLDAP服务)

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"

  • 地平线5布加迪divo是最快的车吗
  • 2024-07-01地平线5布加迪divo是最快的车吗是他们的2019年布加迪Divo名副其实,是《极限竞速:地平线5》中最快的汽车之一这款超级跑车的速度分为9.6,加速分为10,可以达到时速379公里!然而它只排名第十。
  • 打造数字经济“ 号工程”升级版:新思想引领新征程
  • 2024-07-01打造数字经济“ 号工程”升级版:新思想引领新征程央视网消息(新闻联播):强调,加强信息基础设施建设,强化信息资源深度整合,打通经济社会发展的信息“大动脉”今年,我国将进一步加快信息基础设施建设,夯实数字经济发展底座,不断塑造发展新动能、新优势近日,。
  • 掩耳盗铃寓言故事(刻舟求剑的寓言故事)
  • 2024-07-01刻舟求剑的寓言故事从前有个出门远行的楚国人,他在乘船的时候不小心把随身携带着的宝剑落入了江中船上的人都非常着急,大声叫道:“宝剑掉进水里了”!这个楚国人不慌不慌地掏出一把小刀,慢悠悠地在船舷上刻了一个记号,然后回过头来。
  • 95后出任董事长(幕后老板是个95后)
  • 2024-07-01幕后老板是个95后封面新闻记者宋潇和陌生网友见一面吃顿烤肉,就花了几千上万元,当心,这很可能是“酒托女”设下的陷阱10月14日,记者从裁判文书上获悉,在今年3月,成都市中级人民法院就审理了一起涉及24名女性以交友为名实。
  • 朋友圈分组怎么删除(如何删除朋友圈分组)
  • 2024-07-01如何删除朋友圈分组点击手机上的微信登录之后,点击最右下角的“我”进入“我”页面之后,点击最下方的“设置”选项进入“设置”页面之后,找到“隐私”,并点击登陆进入“隐私”页面之后,找到“朋友圈分组”,并点击进入这时候我们可。
  • 两种不同食性鱼的差异:一啸渔乐鱼的习性特征及摄食特点
  • 2024-07-01两种不同食性鱼的差异:一啸渔乐鱼的习性特征及摄食特点鱼类的生活规律以及不同鱼类的具体特征,会较大的影响到钓鱼的成果,了解鱼类的生理特征及摄食特点相关知识,最终还是钓鱼人受益一、鱼的生理特征鱼类的眼睛和人眼不同,它们的可视光谱与人类差异巨大,对于特定波长。
  • 武汉211学校有哪些大学(武汉211学校有什么大学)
  • 2024-07-01武汉211学校有什么大学武汉的211大学一共有7所,其中有2所既是985大学又是211大学既是985又是211的大学分别是武汉大学和华中科技大学武汉另外的5所211大学分别是华中师范大学,武汉理工大学,华中农业大学,中南财经。
  • 一年制电大中专好吗(小小一个电大中专)
  • 2024-07-01小小一个电大中专电大中专是什么呢?全称中央广播电视大学中等‌‌专业学校,是一所经原国家教委批准、现由教育部职业教育与成人教育司领导并依托国家开放大学(原中央广播电视大学)设置的运用现代化教学手段和多媒体教学开展中等专。
  • 美的集团子品牌有哪些(美的背后有张王牌)
  • 2024-07-01美的背后有张王牌纵观国内的家电发展史,八十年代基本是欧美日品牌的天下,凭借着先进的技术产品,它们占领了大部分电器市场份额在这期间,也有不少国产品牌相继崛起,包括以美的为代表着小家电、格力代表着空调、海尔代表冰箱的等在。
  • 三月中旬财运好的生肖(农历三月被好运环绕)
  • 2024-07-01农历三月被好运环绕生肖蛇属蛇人性格理智,聪明伶俐,足智多谋农历三月份他们会被好运围绕,吉祥如意特别是贵人运方面极佳,出门就有数不清的贵人有的会为他们提出宝贵的意见,有的则会帮助他们排忧解难整个月内无论什么事都一帆风顺,。