程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> redmine 整合ldap 用戶

redmine 整合ldap 用戶

編輯:關於PHP編程

redmine 整合ldap 用戶


首先要配置好LDAP 不然會把你累死


LDAP的安裝過程在博客目錄中找一下()


要對應slapd.conf配置文件來寫


我們需要三份數據文件
第一份是基礎模板目錄文件
vim base.ldif
------------------------------------------
dn: dc=bb,dc=com
objectclass: dcObject
objectclass: organization
o: Cywx, Inc.
dc: bb


dn: cn=Ma,dc=bb,dc=com
objectclass: organizationalRole
cn: Ma


dn: ou=People,cn=Ma,dc=bb,dc=com
ou: People
objectclass: top
objectclass: organizationalUnit


dn: ou=Group,cn=Ma,dc=bb,dc=com
ou: Group
objectclass: top
objectclass: organizationalUnit


----------------------------------------------------------


第二份是組文件
vim group.ldif
-------------------------------
dn: cn=t1,ou=Group,cn=Ma,dc=bb,dc=com
objectClass: posixGroup
objectClass: top
cn: t1
userPassword: {crypt}x
gidNumber: 501


dn: cn=t2,ou=Group,cn=Ma,dc=bb,dc=com
objectClass: posixGroup
objectClass: top
cn: t2
userPassword: {crypt}x
gidNumber: 502


dn: cn=ldapuser1,ou=Group,cn=Ma,dc=bb,dc=com
objectClass: posixGroup
objectClass: top
cn: ldapuser1
userPassword: {crypt}x
gidNumber: 503


dn: cn=ldapuser2,ou=Group,cn=Ma,dc=bb,dc=com
objectClass: posixGroup
objectClass: top
cn: ldapuser2
userPassword: {crypt}x
gidNumber: 504
-------------------------------------------------------------




第三組是用戶文件
vim passwd.ldif
------------------------------------------------------------
dn: uid=t1,ou=People,cn=Ma,dc=bb,dc=com
uid: t1
cn: t1
#objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
objectClass: person
objectClass: OpenLDAPperson
surname: t1
givenName: z
mail: [email protected]
userPassword: {crypt}!!
shadowLastChange: 16772
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 500
gidNumber: 501
homeDirectory: /home/t1


dn: uid=t2,ou=People,cn=Ma,dc=bb,dc=com
uid: t2
cn: t2
#objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
objectClass: person
objectClass: OpenLDAPperson
surname: t2
givenName: z
mail: [email protected]
userPassword: {crypt}!!
shadowLastChange: 16772
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 501
gidNumber: 502
homeDirectory: /home/t2


dn: uid=ldapuser1,ou=People,cn=Ma,dc=bb,dc=com
uid: ldapuser1
cn: ldapuser1
#objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
objectClass: person
objectClass: OpenLDAPperson
surname: ldapuser1
givenName: z
mail: [email protected]
userPassword: {crypt}$6$a3DH5nze$WkfyBtwXFOgw3IDAeOHai1ltfailU72qRdNGOtqx/gm5uM7OWEbGBwTIqP.qIUwx8vGSLmjW0.daLBzmplElH.
shadowLastChange: 16772
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 502
gidNumber: 503
homeDirectory: /home/ldapuser1


dn: uid=ldapuser2,ou=People,cn=Ma,dc=bb,dc=com
uid: ldapuser2
cn: ldapuser2
#objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
objectClass: person
objectClass: OpenLDAPperson
surname: ldapuser2
givenName: z
mail: [email protected]
userPassword: {crypt}$6$An0Hoxly$uKVAkEdt0KOgVXJYddUqtxAZfkKIZJIFZG9yoFG5mLRYHNvo./szTXFLf.JJAYWZTjYJKiXAtO6cARH.UQeZb1
shadowLastChange: 16773
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 503
gidNumber: 504
homeDirectory: /home/ldapuser2




------------------------------------------------------------------------------------------------------
然後開始加載數據
ldapadd -x -D "cn=Ma,dc=bb,dc=com" -W -f /etc/openldap/base.ldif
ldapadd -x -D "cn=Ma,dc=bb,dc=com" -W -f /etc/openldap/group.ldif
ldapadd -x -D "cn=Ma,dc=bb,dc=com" -W -f /etc/openldap/passwd.ldif


加載完成 就ok
通過客戶端看到的效果是這樣的




這下是到redmine後台配置了,看圖


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved