LDAP+SAMBASAMBA安装篇-实现PDC

<Alvin-zeng,孤独0-1>

目录

一、LDAP设置

1.1、复制samba schema ldap配置文件

#:cp /usr/share/doc/samba-3.0.33/LDAP/samba.schema /etc/openldap/schema/

#:vim /etc/openldap/slapd.conf

include         /etc/openldap/schema/samba.schema

#:cat /etc/openldap/ldap.conf

URI ldap://127.0.0.1/

BASE dc=zeng,dc=com

TLS_CACERTDIR /etc/openldap/cacerts

#:/etc/init.d/ldap restart

二、SAMBA安装及配置

2.1、安装epel-YUM文件

#cetnos 5.5:

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

#centos 6.0

rpm -Uvh

2.2SAMBA安装软件

#: yum y install

samba

perl

perl-LDAP

smbldap-tools

如果smbldap-tools 安装有问题。请手动安装, 包括依赖关系

rpm -vih perl-Digest-MD4-1.5-10.el6.x86_64.rpm

rpm -vih perl-Crypt-SmbHash-0.12-10.el6.noarch.rpm

rpm -vih perl-Jcode-2.07-1.el6.noarch.rpm

rpm -vih perl-Unicode-Map-0.112-1.el6.rf.x86_64.rpm

rpm -vih perl-Unicode-Map8-0.13-1.el6.rfx.x86_64.rpm

rpm -vih perl-Unicode-String-2.09-1.2.el6.rfx.x86_64.rpm

rpm -vih perl-Unicode-Map8-0.13-1.el6.rfx.x86_64.rpm

rpm -vih perl-Unicode-MapUTF8-1.11-10.el6.noarch.rpm

rpm -vih smbldap-tools-0.9.6-3.el6.noarch.rpm

2.3、备份原始SAMBA配置文件,拷贝新文件覆盖.

#: cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

#: cp /usr/share/doc/smbldap-tools-0.9.6/smb.conf /etc/samba/

2.4、修改SAMBA配置文件

#:vim /etc/samba/smb.conf

workgroup = ZENG #工作组名,既是我们的domain name

netbios name = ZENGYONG #netbios名字

security = user #安全级别,一定要选user,使用用户名和密码验证

passdb backend = ldapsam:ldap://192.168.8.235/  #这里设定ldap服务器地址

ldap admin dn = cn=root,dc=zeng,dc=com #ldap设定档中的rootdn相同,用来登录ldap用的

ldap suffix = dc=zeng,dc=com #这里也要改成我们的base dn

#min passwd length = 3      #注释掉

#       printing = cups      #注释掉

#       printcap name = cups   #注释掉

#       load printers = Yes    #注释掉

unix password sync = no

ldap passwd sync = yes

ldap idmap suffix = ou=Idmap

2.5、启动SAMBA服务

#: /etc/init.d/smb start

2.6SAMBA+LDAP开始结合

#: cd /usr/share/doc/smbldap-tools-0.9.6/

#: chmod +x configure.pl

#:./configure.pl

ldap master server [192.168.8.231] >

. ldap master port [389] >

. ldap master bind dn [cn=root,dc=zeng,dc=com] >

. ldap master bind password [] >  123456         #输入cn=root,dc=zeng,dc=com 登陆密码

. ldap slave server: IP address or DNS name of the slave ldap server: can also be the master one

 ldap slave server [192.168.8.231] >

. ldap slave port [389] >

. ldap slave bind dn [cn=root,dc=zeng,dc=com] >

. ldap slave bind password [] >   #输入cn=root,dc=zeng,dc=com 登陆密码

. ldap tls support (1/0) [0] >

(对比一下是否和SAMBA配置文件里面的相同,OK的话。全部回车,只有以上及项需要输入密码)

2.7、初始化数据库

#: smbldap-populate

Populating LDAP directory for domain zeng (S-1-5-21-1151756823-2040759719-3606617437)

(using builtin directory structure)

adding new entry: dc=zeng,dc=com

adding new entry: ou=Users,dc=zeng,dc=com

adding new entry: ou=Groups,dc=zeng,dc=com

adding new entry: ou=Computers,dc=zeng,dc=com

adding new entry: ou=Idmap,dc=zeng,dc=com

adding new entry: uid=root,ou=Users,dc=zeng,dc=com

adding new entry: uid=nobody,ou=Users,dc=zeng,dc=com

adding new entry: cn=Domain Admins,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Domain Users,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Domain Guests,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Domain Computers,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Administrators,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Account Operators,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Print Operators,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Backup Operators,ou=Groups,dc=zeng,dc=com

adding new entry: cn=Replicators,ou=Groups,dc=zeng,dc=com

adding new entry: sambaDomainName=zeng,dc=zeng,dc=com

Please provide a password for the domain root:

Changing UNIX and samba passwords for root

New password:

Retype new password:

2.8、上述提示表示一切结果正常,将LDAP管理员密码加入secret.tdb

#smbpasswd -w 123456

2.9、修改host 将自己的机器名和ip地址添加一hosts档中

#: vim /etc/hosts

192.168.8.231   test-231  ZENG

3.0、在安装完后,用smbclient来验证一下是否一切正常

#:smbclient  -L localhost -U root

3.1windos加入域。需要执行注册表。

#: cp  /usr/share/doc/samba-3.0.33/registry/WinXP_PlainPassword.reg windows 执行.

3.2、将windows 计算机名加入信息用户

#:useradd -d /dev/null -s /sbin/nologin -r windowsname$

三、验证XP加入LINUX LDAP+SAMBA.

3.3、将客户端加ZENG

加域各位会吧?

  右击-->我的电脑->属性->选择域输入-zeng

要求输入用户和密码

博文附件: