Chinaunix首页 | 论坛 | 博客
  • 博客访问: 219721
  • 博文数量: 39
  • 博客积分: 945
  • 博客等级: 准尉
  • 技术积分: 532
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-04 17:25
文章分类

全部博文(39)

文章存档

2012年(39)

我的朋友

分类: LINUX

2012-05-04 17:42:52

1 安装 OpenLDAP


点击(此处)折叠或打开

  1. [root@openldap ~]# yum -y install openldap-servers openldap-clients
  2. # generate password for ldap admin
  3. [root@openldap ~]# slappasswd -s password -h {MD5}
  4. # (1) remember
  5. {MD5}*********************
  6. [root@openldap ~]# vim /etc/openldap/slapd.conf
  7. # line 86: specify suffix
  8. suffix "dc=example,dc=com"
  9. # line 87: specify admin suffix
  10. rootdn "cn=Manager,dc=example,dc=com"
  11. # line 93: specify password generated (1)
  12. rootpw {MD5}************************
  13. # add at the bottom
  14. access to attrs=userPassword
  15. by self write
  16. by dn="cn=Manager,dc=example,dc=com" write
  17. by anonymous auth
  18. by * none
  19. access to *
  20. by dn="cn=Manager,dc=example,dc=com" write
  21. by self write
  22. by * read
  23. [root@openldap ~]# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
  24. #
  25. [root@openldap ~]# /etc/init.d/ldap start
  26. Checking configuration files for slapd: /etc/openldap/slapd.conf: line 115: rootdn is always granted unlimited privileges.
  27. /etc/openldap/slapd.conf: line 120: rootdn is always granted unlimited privileges.
  28. config file testing succeeded
  29. [ OK ]
  30. Starting slapd: [ OK ]
  31. [root@openldap ~]# chkconfig ldap on
2 查看状态

点击(此处)折叠或打开

  1. #show process
  2. [root@openldap openldap]# ps aux | grep slapd | grep -v grep
  3. ldap 9246 0.0 5.2 62960 27288 ? Ssl May03 0:00 /usr/sbin/slapd -h ldap:/// -u ldap
  4. #show port
  5. [root@openldap openldap]# netstat -ant | grep 389
  6. tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN
3 迁移用户数据到目录服务数据库。


点击(此处)折叠或打开

  1. [root@openldap ~]#cd /usr/share/openldap/migration/
  2. [root@openldap migration]# vim migrate_common.ph
  3. #line 71 defalut DNS domain
  4. $DEFAULT_MAIL_DOMAIN = "example.com";
  5. #line 74 defalut base
  6. $DEFAULT_BASE = "dc=example,dc=com";
  7. #
  8. [root@openldap migration]#./migrate_base.pl > /opt/openldap/base.ldif
  9. #
  10. [root@openldap migration]#ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /opt/openldap/base.ldif
  11. #enter passwd
  12. #
  13. [root@openldap migration]#./migrate_passwd.pl /etc/passwd /opt/openldap/passwd.ldif
  14. [root@openldap migration]#ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /opt/openldap/passwd.ldif
  15. #
  16. [root@openldap migration]#./migrate_passwd.pl /etc/group /opt/openldap/group.ldif
  17. #
  18. [root@openldap migration]#ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /opt/openldap/group.ldif




阅读(3129) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~