Ubuntu 16.04:安裝openldap server

安裝所需軟體
[root@openldap ~]# apt install -y slapd ldap-utils

設定LDAP管理密碼











重新配置slapd
[root@openldap ~]# dpkg-reconfigure slapd

省略OpenLDAP配置?否









基于輸入的domain_name建立base_DN。







輸入組織(公司)名稱









設定LDAP管理密碼










確認密碼









後端DB使用類型,這邊選"MDB",因為速度較快









清除slapd時是否一併刪除DB,這邊選"NO"










移動舊資料庫,保持預設"是"







允許LDAPv2協議,保持預設"是"







[root@openldap ~]# dpkg-reconfigure slapd
Moving old database directory to /var/backups:
- directory unknown... done.
Creating initial configuration... done.
Creating LDAP directory... done.

設定ldap.conf,取消BASE、URI的注釋並更改為你的設定
[root@openldap ~]# vim /etc/ldap/ldap.conf
BASE    dc=ai,dc=nchc,dc=org,dc=tw
URI     ldap://localhost(因為是在本機設定,所以設定為localhost)

測試
[root@openldap ~]# ldapsearch -x
# extended LDIF
#
# LDAPv3
# base <dc=ai,dc=nchc,dc=org,dc=tw> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# ai.nchc.org.tw
dn: dc=ai,dc=nchc,dc=org,dc=tw
objectClass: top
objectClass: dcObject
objectClass: organization
o: ai-admin
dc: ai

# admin, ai.nchc.org.tw
dn: cn=admin,dc=ai,dc=nchc,dc=org,dc=tw
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2

備註:
Result: 0 Success,表示OpenLDAP server is working
result: 32 No such object,表示OpenLDAP server is not working

LDAP使用者管理
https://hackmd.io/UYo4NpWnTYOb59udOs5j2A

留言

這個網誌中的熱門文章

Centos 7:安裝openldap servers + clients

CentOS 7:安裝Proftpd〈提供 FTP、FTPs與SFTP〉

Apache的一些安全性設定