首页
/
每日頭條
/
圖文
/
怎樣用centos7搭建openstack
怎樣用centos7搭建openstack
更新时间:2026-01-25 23:44:47

怎樣用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
推荐阅读
cfpl ag 陣容(CFPL青訓選手哪家強)
cfpl ag 陣容(CFPL青訓選手哪家強)
  CFPL S16常規賽已經進行到了第六輪,可謂緊張激烈,精彩紛呈。本屆聯賽最大的特色,就是引入了很多新人,給觀衆帶來了耳目一新的感覺。除了一些替補選手外,大量青訓隊員的上陣成為賽場上一道靓麗的風景線。但說一千道一萬,歸根結底,無論隊伍的陣容怎樣變化,能夠獲勝才是最關鍵的。下面我們就來讨論一個有趣的話題,分析下這批新人中,究竟哪支戰隊的比較厲害。     ...
2026-01-25
不為人知的護眼知識(漲知識不漲度數)
不為人知的護眼知識(漲知識不漲度數)
  近日,上海普瑞眼科醫院組織了一場“護眼指南·工會福利線上講座”。醫院視光主治醫師、工會小組成員王單為工會會員們科普了青少年科學用眼小常識,做到以下幾點,就能在“漲知識”的同時不漲度數。  Q:觀看屏幕需要注意什麼細節?   盡可能選擇較大的屏幕電子産品,在較遠的距離進行觀看。建議将視頻投影到大屏幕或鍊接到較大屏幕的電視上,增加觀看距離。盡量選擇屏幕分辨率...
2026-01-25
15萬到20萬中型suv哪一款值得選擇(綜合性價比比較高的三款中型SUV)
15萬到20萬中型suv哪一款值得選擇(綜合性價比比較高的三款中型SUV)
  對于大部分的消費者來說,20萬左右的中型SUV具有很強的實用價值,畢竟國内大部分這個級别消費者的核心訴求就是為了代步,說白了就是坐着舒服、開着舒服、用着放心,今天我就為大家挑選3款綜合性價比特别高的SUV車型,本田的CR-V、别克昂科威和雪佛蘭探界者。      第一、本田CR-V   當年這個車簡直就是加價神車,耐用省心就是它的标簽,這幾年的銷量也不錯...
2026-01-25
c4 picasso 試駕(将藝術帶入工業)
c4 picasso 試駕(将藝術帶入工業)
  MPV時代原創稿件歡迎分享,轉載請注明出處。   十款MPV九款醜,這是很多人的相同看法。不錯,由于中國消費者對MPV的理解比較淺,再加上市面上的MPV絕大多數集中在10萬以内,讓人們認為MPV就是用來拉貨的,所以不少消費者想買一款家用車大多數都會選擇轎車或者SUV。      當然,這種說法并不是正确的,還有我們熟知的中高端MPV。它們基本上都走商務路...
2026-01-25
荒野大镖客2線上版本還需要買嗎(救贖2OL部分不會影響GTAOL)
荒野大镖客2線上版本還需要買嗎(救贖2OL部分不會影響GTAOL)
  Take-Two似乎對《荒野大镖客:救贖2》的OL部分很有自信。在最近的季度财務電話會議上,Take-Two高層Strauss Zelnick被問到《荒野大镖客:救贖2》是否會推出OL部分以及與《GTAOL》的關系時,他是這麼回答的:      “娛樂的體驗是不同的,在這款遊戲中的體驗很難在另外一款遊戲中找到。你不會想‘我現在需要娛樂’。娛樂是你想要一直...
2026-01-25
Copyright 2023-2026 - www.tftnews.com All Rights Reserved