千家信息网

openldap-2.4.44 安装教程

发表于:2024-11-14 作者:千家信息网编辑
千家信息网最后更新 2024年11月14日,这篇文章主要介绍"openldap-2.4.44 安装教程",在日常操作中,相信很多人在openldap-2.4.44 安装教程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家
千家信息网最后更新 2024年11月14日openldap-2.4.44 安装教程

这篇文章主要介绍"openldap-2.4.44 安装教程",在日常操作中,相信很多人在openldap-2.4.44 安装教程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"openldap-2.4.44 安装教程"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

https://www.tutorialspoint.com/linux_admin/install_and_configure_open_ldap.htm

# 安装openldap-clients/openldap-servers[root@openldap ldap]# yum install openldap-clients openldap-servers# 测试 [root@openldap ldap]# slaptest -uconfig file testing succeeded# 启动[root@openldap ldap]# service slapd start# 修改olcSuffix/olcRootDN/olcRootPW[root@openldap ldap]# slappasswd -s 123456{SSHA}5AeSW/wI7nDvTcuPsRPitliGW7CfF8xV# # /etc/openldap/slapd.d/cn\=config/olcDatabase={2}hdb#[root@openldap ldap]# vi /opt/0_modify_olc_bash.ldifdn: olcDatabase={2}hdb,cn=configchangetype: modifyreplace: olcSuffixolcSuffix: dc=harry,dc=comdn: olcDatabase = {2}hdb,cn=configchangetype: modifyreplace: olcRootDNolcRootDN: cn=Manager,dc=harry,dc=comdn: olcDatabase = {2}hdb,cn=configchangetype: modifyreplace: olcRootPWolcRootPW: {SSHA}5AeSW/wI7nDvTcuPsRPitliGW7CfF8xV#ldapmodify 修改[root@openldap ldap]# ldapmodify -Y EXTERNAL -H ldapi:/// -f /opt/0_modify_olc_bash.ldifSASL/EXTERNAL authentication startedSASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=authSASL SSF: 0modifying entry "olcDatabase={2}hdb,cn=config"modifying entry "olcDatabase = {2}hdb,cn=config"modifying entry "olcDatabase = {2}hdb,cn=config"#### setup db[root@openldap ldap]# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG[root@openldap ldap]# chown ldap:ldap /var/lib/ldap/*#### 添加admin/ou[root@openldap ldap]# vi /opt/4_ldapadmin.ldifdn: cn=Manager,dc=harry,dc=comobjectClass: organizationalRolecn: Managerdn: dc=harry,dc=comdc: harryobjectClass: topobjectClass: organizationobjectClass: dcObjecto: harrydn: ou=Groups,dc=harry,dc=comou: GroupsobjectClass: organizationalUnitdn: ou=Users,dc=harry,dc=comou: UsersobjectClass: organizationalUnit[root@openldap ldap]# ldapadd -Y EXTERNAL -H ldapi:/// -f /opt/4_ldapadmin.ldif### 搜索校验[root@openldap opt]# ldapsearch -b 'dc=harry,dc=com' -H ldapi:/// -LLLSASL/EXTERNAL authentication startedSASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=authSASL SSF: 0dn: dc=harry,dc=comdc: harryobjectClass: topobjectClass: domaindn: ou=Groups,dc=harry,dc=comou: GroupsobjectClass: organizationalUnitdn: ou=Users,dc=harry,dc=comou: UsersobjectClass: organizationalUnit### 修改monitor[root@openldap opt]# vi /opt/1_modify_monitor.ldifdn: olcDatabase={1}monitor,cn=configchangetype: modifyreplace: olcAccessolcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=extern al,cn=auth" read by dn.base="cn=Manager,dc=harry,dc=com" read by * none[root@openldap ldap]# ldapmodify -Y EXTERNAL -H ldapi:/// -f /opt/1_modify_monitor.ldif######### 添加memberof## 当你添加group即objectClass 是groupOfUniqueNames时。添加属性为uniqueMember记录,会自动为该用户添加属性memberOf##[root@openldap opt]# vi /opt/2_add_memberof.ldifdn: cn=module,cn=configcn: moduleobjectClass: olcModuleListolcModuleLoad: memberofolcModulePath: /usr/lib64/openldap[root@openldap opt]# vi /opt/3_add_memberof_config.ldifdn: olcOverlay=memberof,olcDatabase={2}hdb,cn=configobjectClass: olcConfigobjectClass: olcMemberOfobjectClass: olcOverlayConfigobjectClass: topolcOverlay: memberofolcMemberOfDangling: ignoreolcMemberOfRefInt: TRUEolcMemberOfGroupOC: groupOfUniqueNamesolcMemberOfMemberAD: uniqueMemberolcMemberOfMemberOfAD: memberOf[root@openldap opt]# vi /opt/5_modify_refint.ldifdn: cn=module{0},cn=configadd: olcmoduleloadolcmoduleload: refint[root@openldap opt]# vi /opt/6_add_refint_config.ldifdn: olcOverlay=refint,olcDatabase={2}hdb,cn=configobjectClass: olcConfigobjectClass: olcOverlayConfigobjectClass: olcRefintConfigobjectClass: topolcOverlay: refintolcRefintAttribute: memberof uniqueMember  manager owner## 添加用户[root@openldap opt]# vi /opt/10_harrywu.ldifdn: cn=harrywu,ou=Users,dc=harry,dc=comobjectClass: inetOrgPersonobjectClass: posixAccountcn: harrywuuid: harrywuuidNumber: 1000gidNumber: 1000givenName: Harrysn: WuhomeDirectory: /home/harrywuloginShell: /bin/bashuserPassword: 123456## 添加group => groupOfUniqueNames[root@openldap opt]# vi /opt/11_add_u_group1.ldifdn: cn=g1,ou=Groups,dc=harry,dc=comobjectClass: groupOfUniqueNamescn: g1uniqueMember: cn=harrywu,ou=Users,dc=harry,dc=com## 校验cn=harrywu是否新增属性memberOf[root@openldap opt]# ldapsearch -H ldapi:/// -b 'dc=harry,dc=com' dn memberof...# harrywu, Users, harry.comdn: cn=harrywu,ou=Users,dc=harry,dc=commemberOf: cn=g1,ou=Groups,dc=harry,dc=com...

到此,关于"openldap-2.4.44 安装教程"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!

0