首页
/
每日頭條
/
圖文
/
怎樣用centos7搭建openstack
怎樣用centos7搭建openstack
更新时间:2024-10-12 01:22: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
推荐阅读
貝加爾湖畔音樂介紹(怎樣評價貝加爾湖畔這首歌)
貝加爾湖畔音樂介紹(怎樣評價貝加爾湖畔這首歌)
  初聽不識曲中意,再聽已是曲中人。或許是因為一段曾以為會很長久很長久的感情忽然終止,聽一些對舊事和感情回憶的歌曲都能讓我不受控制的把自己帶入。如果年少的自己不那麼計較,多一些體諒,或許的或許,會有不一樣的結局呢,或許的或許,不會錯過呢,青蔥的我,單純的你。以前還沒分手的時候,我隻是覺得這首歌的旋律好聽,還以為是寫貝加爾湖的甯靜美麗呢。現在才懂,那是對美好的...
2024-10-12
王源是不是解約了(王源合約到期即将解約)
王源是不是解約了(王源合約到期即将解約)
  7月27日,TFBOYS組合的經紀公司北京時代峰峻文化藝術發展有限公司發布嚴正聲明,該聲明針對近日網絡上散播的關于TFBOYS組合的一些不實内容進行了澄清。其中特别指出網絡上關于“成員王源合約到期即将解約”的傳聞進行了否認,引發了熱議。         确實,近日網絡上的一些不實言論,一經發布就被大量轉載,已經嚴重損害了藝人形象以及TFBOYS組合。因此...
2024-10-12
野狼disco 為什麼這麼火(野狼disco為什麼很火)
野狼disco 為什麼這麼火(野狼disco為什麼很火)
  有這麼一首歌,最近在各大 短視頻平台 很火   聽第一遍時感覺很土   聽第二遍時就要搖頭   聽第三遍時就要畫龍、畫彩虹   聽第四遍時,感覺這是歌手 面對失落時,的反抗   聽第五遍時 感覺到歌手 在鼓勵人們 重新振奮   聽第六遍時 可能會讓你流淚、這可真是、土到極緻便是潮、嗨到深處亦悲傷      這首歌畫面感 确實很強。完整的故事,迪斯科的搖擺...
2024-10-12
知否中的劉海造型(知否鼻子很好看)
知否中的劉海造型(知否鼻子很好看)
  有人說,鼻整形就像是在平地“起高樓”!   而老路認為,鼻整形更像是依山建的“别墅”,錯落有緻才好看!      但無論是“高樓”還是“别墅”,都必須打好基礎,我們的鼻基底就是鼻子的基礎。   同樣高度的樓房,建立在不同海拔的“地基”之上,最終看到的視覺效果是不一樣的!   所以,要想讓我們的面部更為飽滿、立體!不僅要有好看的鼻子,還需有穩固飽滿的鼻基底...
2024-10-12
白百何捉妖記2預告片(捉妖記2宣發避談白百何)
白百何捉妖記2預告片(捉妖記2宣發避談白百何)
  眼看着還有半個月就要過年了,一年最火的電影春節檔也即将拉開序幕,似乎春節檔就是電影公司賺錢的大票倉。今年的春節檔其火爆不亞于過去的任何一年,參賽選手也多是大卡司,都有哪些呢?      最受人關注的有“前中國電影影史票房冠軍”《捉妖記》的續集《捉妖記2》,鄭寶瑞“西遊記電影系列”的第三部《女兒國》,陳思成導演,王寶強主演的《唐人街探案2》,各個都是在前作...
2024-10-12
Copyright 2023-2024 - www.tftnews.com All Rights Reserved