LDAP服务器端设置指南

来源:互联网 发布:数据查询工具 编辑:程序博客网 时间:2024/06/06 03:48

sudo apt-get install slapd ldap-utils db4.2-util

slapdLDAPdaemon程序,ldap-utilsLDAP的工具集,db4.2-utilLDAP的后端数据库支持。

基本设定

#vi /etc/ldap/ldap.conf

 

HOST 127.0.0.1

BASE dc=gmshi,dc=org

设定密码

#slappasswd

New password: your_password

Re-enter new password: your_password

{SSHA}xxxxxxxxxxxxxxxxxxx(复制起来,以后有用)

修改设定档

vi /etc/ldap/slapd.conf

 

include /etc/ldap/schema/samba.schema

database bdb

suffix "dc=gmshi,dc=org"

rootdn "cn=admin,dc=gmshi,dc=org"

rootpw {SSHA}xxxxxxxxxxxx.....

directory /var/lib/ldap

#数据存放地址

 

#使用者密码只能由自己变更,对于匿名使用者只限于于密码验证,其余禁止取用

access to attrs=userPassword

        by self write

        by anonymous auth

        by * none

#限制只有本机与局域网的使用者可以读取帐号咨询

access to attrs=uid,uidNumber,gidNumber,loginShell,homeDirectory

        by peername.ip=127.0.0.1 read

        by peername.ip=192.168.1.0%255.255.255.0 read

#以上没有规定的部分,都予以读取权限

access to *

        by * read

 

清除所有 LDAP 資料, 從零開始

/etc/init.d/ldap stop

rm -f /var/lib/ldap/*

slapadd -v -l new_structure.ldif

chown ldap:ldap /var/lib/ldap/*

/etc/init.d/ldap start

原创粉丝点击