快速业务通道

基于LinuxOPENldap实验之账户管理

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-23
在linux下使用轻量级目录访问协议(LDAP)构建集中的身份验证系统可以减少管理成本,增强安全性,避免数据复制的问题.本实验是演示如何配置服务器和客户机OPENldap服务的. 实验环境:VMWare虚拟机下Red Hat Linux 企业版5.4 两台 准备工作:两台虚拟机分别为服务器和客户机.在服务器端安装openldap-servers软件包,在客户端安装openldap-clients软件包. 在该文档中,为了节约时间,所有试验步骤均摘自实验代码.还请各位朋友见谅! 1、 切换到/usr/share/openldap/migration/目录下,来编辑migrate_common.ph文件, 修改71、72行如下内容: [root@ldap ~]# cd /usr/share/openldap/migration/ [root@ldap migration]# vim migrate_common.ph 70 # Default DNS domain 71 $DEFAULT_MAIL_DOMAIN = "example.com"; 72 73 # Default base 74 $DEFAULT_BASE = "dc=example,dc=com"; 2、在服务器端添加linuxtro1和linuxtro2两个用户,并添加密码为redhat [root@ldap ~]# useradd linuxtro1 && echo redhat | passwd --stdin linuxtro1 Changing password for user linuxtro1. passwd: all authentication tokens updated successfully. [root@ldap ~]# useradd linuxtro2 && echo redhat | passwd --stdin linuxtro2 Changing password for user linuxtro2. passwd: all authentication tokens updated successfully. 3、在/root/下创建ldap目录,用于存放条目文件. [root@ldap ~]# mkdir /root/ldap 拥有帝国一切,皆有可能。欢迎访问phome.net [root@ldap ~]# cd /usr/share/openldap/migration/ 4、迁移base.ldif 、passwd.ldif和group.ldif文件,这个步骤有顺序,先迁移bash.ldif文件 [root@ldap migration]# ./migrate_base.pl > /root/ldap/base.ldif [root@ldap migration]# tail -2 /etc/passwd > /tmp/passwd [root@ldap migration]# tail -2 /etc/group > /tmp/group [root@ldap migration]# ./migrate_passwd.pl /tmp/passwd /root/ldap/passwd.ldif [root@ldap migration]# ./migrate_group.pl /tmp/group /root/ldap/group.ldif [root@ldap migration]# cd /root/ldap/ [root@ldap ldap]# ll total 24 -rw-r--r-- 1 root root 1200 Mar 31 18:57 base.ldif -rw-r--r-- 1 root root 270 Mar 31 18:59 group.ldif -rw-r--r-- 1 root root 722 Mar 31 18:59 passwd.ldif 5、分别将base.ldif、passwd.ldif和group.ldif文件导入到ldap中去. [root@ldap ldap]# ldapadd -D "cn=Manager,dc=example,dc=com" -W -x -f base.ldif Enter LDAP Password: adding new entry "dc=example,dc=com" adding new entry "ou=Hosts,dc=example,dc=com" adding new entry "ou=Rpc,dc=example,dc=com" adding new entry "ou=Services,dc=example,dc=com" adding new entry "nisMapName=netgroup.byuser,dc=example,dc=com" adding new entry "ou=Mounts,dc=example,dc=com" adding new entry "ou=Networks,dc=example,dc=com" adding new entry "ou=People,dc=example,dc=com" adding new entry "ou=Group,dc=example,dc=com" 拥有帝国一切,皆有可能。欢迎访问phome.net adding new entry "ou=Netgroup,dc=example,dc=com" adding new entry "ou=Protocols,dc=example,dc=com" adding new entry "ou=Aliases,dc=example,dc=com" adding new entry "nisMapName=netgroup.byhost,dc=example,dc=com" [root@ldap ldap]# ldapadd -D "cn=Manager,dc=example,dc=com" -W -x -f group.ldif Enter LDAP Password: adding new entry "cn=linuxtro1,ou=Group,

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号