首页
/
每日頭條
/
圖文
/
怎樣用centos7搭建openstack
怎樣用centos7搭建openstack
更新时间:2025-11-03 22:17:33

怎樣用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
推荐阅读
單身一姐浙江(她公認的一姐)
單身一姐浙江(她公認的一姐)
  中國乒乓球夢之隊,在世界乒壇一直都是神一般的存在,不可逾越,國寶級運動員更是讓他國垂涎三尺,裡約奧運國乒派出女子“三劍客”丁甯、李曉霞、劉詩雯,這樣一個豪華整容,直接劍指總冠軍,毋庸置疑,三人組中女子單打肯定就在她們中産生,最近手感發燙的丁甯成為最大奪冠熱門。這位“女神”大家有多了解?今天小編就帶你走進她的生活。  丁甯原來還是九零後,出生1990年6月...
2025-11-03
錦心似玉譚松韻是自己配音嗎(錦心似玉譚松韻飾演的十一娘怼人功夫實在了得啊)
錦心似玉譚松韻是自己配音嗎(錦心似玉譚松韻飾演的十一娘怼人功夫實在了得啊)
  昨晚由鐘漢良、譚松韻主演的《錦心似玉》開播,在播出的劇集當中,十一娘可稱得上是智慧擔當了,那怼人的功夫實在了得啊!   十一娘ko二娘   二娘為掙得嫁入徐府續弦正室,設計陷害十一娘與王世子的親事,被十一娘拆穿,并狠狠地回敬過去。         十一娘ko喬姨娘      十一娘ko自家相公      三殺!ok!這個怼天怼地地徐府主母可越來越有主母地...
2025-11-03
周筆暢奔跑吧兄弟在第幾期(從極限男人幫到鄧超鹿晗)
周筆暢奔跑吧兄弟在第幾期(從極限男人幫到鄧超鹿晗)
  就算是在普通人的世界裡,真正的友情都非常難得,更何況是娛樂圈呢?   一腳踏入這個圈子的時候,就已經牽扯到各種各樣的利益關系了。   更何況如今娛樂圈裡也面臨着資源不夠分的情況,這也就意味着有些明星之間也是免不了要進行一番資源争奪。      所謂“既生瑜何生亮”,有争奪就會結下梁子,哪怕是之前關系再好的朋友,日後也極有可能會撕破臉皮。   話雖如此,難...
2025-11-03
紐西之謎面膜真的好用嗎(紐西之謎紐西之謎面膜)
紐西之謎面膜真的好用嗎(紐西之謎紐西之謎面膜)
  中國質量新聞網訊 (楊振遠)砸廣告、刷直播、上綜藝,紐西之謎可謂是近兩年風頭正勁的美妝品牌。然而,中國質量新聞網接消費者投訴稱,使用該品牌“爆款”産品“紐西之謎溫泉水乍彈面膜”後,“感覺油油的,很奇怪”,她通過查詢相關資料,認為紐西之謎所宣傳的“礦物質”護膚理念并沒有權威的科學數據支持,因此對其功效和安全性提出了質疑。   接訴後,中國質量新聞網委托專業...
2025-11-03
道德經反者道之動弱者道之用原文(道德經第四十章反者道之動)
道德經反者道之動弱者道之用原文(道德經第四十章反者道之動)
  詳細解讀《道德經》40      反動弱用   〈原文〉   反者道之動,弱者道之用。   天下萬物生于有,有生于無。   〈注釋〉   反:翻轉,反向,相反。   弱:柔弱。   〈譯文〉   向自己的反面運動,是道的運動特征;   依靠柔弱發揮作用,是道的應用特征。   天地萬物總稱為有,有生于無。   〈解讀〉   本章主要是闡述了道的運動特征和道...
2025-11-03
Copyright 2023-2025 - www.tftnews.com All Rights Reserved