首页
/
每日頭條
/
圖文
/
怎樣用centos7搭建openstack
怎樣用centos7搭建openstack
更新时间:2025-07-07 11:37:19

怎樣用centos7搭建openstack?安裝ldap服務[root@ldap ~]# yum install -y openldap-servers openldap-clients,我來為大家講解一下關于怎樣用centos7搭建openstack?跟着小編一起來看一看吧!

怎樣用centos7搭建openstack(CentOS7簡單搭建OpenLDAP服務)1

怎樣用centos7搭建openstack

安裝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"

Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
推荐阅读
王翰涼州詞詩句
王翰涼州詞詩句
《涼州詞》王翰葡萄美酒夜光杯,欲飲琵琶馬上催。醉卧沙場君莫笑,古來征戰幾人回?【鑒賞】《涼州詞》又作《涼州曲》,是河西隴右(今甘肅武威)一帶的地方樂曲。開元中采進,後人多為之作詞。作者生性豪放,懷才不遇,喜歡縱酒遊樂。本首詩就體現了詩人的這...
2025-07-07
excel出貨單日期自動生成
excel出貨單日期自動生成
用Excel表格登記的訂貨台賬,為了與後續的發貨、發票、貨款等台賬信息關聯,方便後續的對賬與結算,最好給每一筆訂單賦予一個唯一的訂單編号。便于在Excel中用函數生成,可以考慮用“日期遞增順序号”的方式。一、需要解決的問題1、将日期轉換為8...
2025-07-07
本科生和專科生差别到底有多大
本科生和專科生差别到底有多大
高考考大學的時候,考上的是本科院校還是專科學校,在學制和學曆含金量上都有區别。甚至有人會認為,再好的專科學校也不如普通的本科學校,再好的專科生也不如普通的本科生。面對這個問題,應該怎麼認識呢?小編為此了解了周邊一些朋友的觀點。下面,就讓我們...
2025-07-07
風在停雨在下
風在停雨在下
近期南方強降雨不斷局部地區發生洪澇災害面對嚴峻形勢一個個堅定的身影站了出來聞令而動向險而行與時間賽跑争分奪秒搶救生命“受困群衆需要我,看到他們求助,我怎能無動于衷,再艱難的路也要挺進來。”“别怕,有我在!”……當每個人都在逃離滔滔洪流之時他...
2025-07-07
西安的搖頭燈
西安的搖頭燈
本文2826字42圖|預計閱讀時間21分鐘“風消绛蠟,露浥紅蓮,燈市光相射。桂華流瓦。纖雲散,耿耿素娥欲下……”這是北宋著名詞人周邦彥在《解語花·上元》中的幾句詞。什麼意思?大意是說,元宵夜的燈節花市,月光與花市燈火互相輝映,整個世界都晶瑩...
2025-07-07
Copyright 2023-2025 - www.tftnews.com All Rights Reserved