howtodownload

howtodownload
cach down

Thứ Tư, 11 tháng 9, 2013

Cấu hình SAMBA + LDAP trên Centos (phần 2)

Cấu hình OPENLDAP.

Bạn gõ lệnh để tạo mật khẩu cho ldap

slappasswd

chú ý : mình lấy mật khẩu là 123456



ở đây mình chọn mật khẩu là 123

Bạn gõ lệnh

vim /etc/openldap/slapd.conf

và và ghi vào với nội dung sau.


include /etc/openldap/schema/core.schemainclude /etc/openldap/schema/cosine.schemainclude /etc/openldap/schema/inetorgperson.schemainclude /etc/openldap/schema/nis.schemainclude         /etc/openldap/schema/samba.schema  đây là dòng thêm vào.gọi file cấu hình mẫu của hệ thống
allow bind_v2
loglevel -1
pidfile /var/run/openldap/slapd.pidargsfile /var/run/openldap/slapd.args



######################################################################## ldbm and/or bdb database definitions#######################################################################
database bdbsuffix "dc=dnson,dc=local"rootdn "cn=Manager,dc=dnson,dc=local"rootpw {SSHA}uUNBHS/G3Gv3M/NY9k0yJplWK4pV32SE dán cái mã ở trên vào chỗ này
directory /var/lib/ldap
index objectClass                       pres,eq#index ou,cn,mail,surname,givenname      eq,pres,subindex cn,sn,uid,displayName    pres,sub,eqindex uidNumber,gidNumber          eqindex uid,memberUid                     eq,pres,subindex nisMapName,nisMapEntry            eq,pres,subindex sambaSID,sambaPrimaryGroupSID,sambaDomainName eq đây là dòng thêm vàoindex default sub đây là dòng thêm vào


Bạn sửa file ldap.conf bằng lệnh

vim /etc/openldap/ldap.conf


BASE dc=dnson,dc=local
URI ldap://10.10.10.1:389
TLS_CACERTDIR /etc/openldap/cacerts


Tiếp sửa file với nội dung sau.bạn gõ lệnh

vim /etc/ldap.conf


base dc=dnson,dc=local

rootbinddn cn=Manager,dc=dnson,dc=local
timelimit 120
bind_timelimit 120
idle_timelimit 3600
nss_base_passwd ou=Users,dc=dnson,dc=local?one
nss_base_passwd ou=Computers,dc=dnson,dc=local?one
nss_base_group ou=Groups,dc=dnson,dc=local?one
nss_base_shadow ou=Users,dc=dnson,dc=local?one
nss_initgroups_ignoreusers root,ldap,named,avahi,haldaemon,dbus,radvd,tomcat, radiusd,news,mailman,nscd,gdm
uri ldap://10.10.10.1:389
ssl no
tls_cacertdir /etc/openldap/cacerts
pam_password crypt


Tiếp theo bạn sửa file /etc/nsswitch.conf . đây là file quy định chuyển đổi lưu trữ.ta chuyển từ lưu trữ tên và mật khẩu user qua cho ldap quản lý.

vim /etc/nsswitch.conf

33 passwd : files ldap
34 shadow: files ldap
35 group: files ldap

Coppy file database mẫu của hệ thống bằng các lệnh sau.

cp /usr/share/doc/samba-3.0.33/LDAP/samba.schema /etc/openldap/schema/
cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

Cấu hình LDAP client.

Bạn gõ lệnh

setup

Chọn Authentication configuration -> Run Tool (cứ làm như hình dưới là ok hết.)




đoạn này chỉnh lại thành ldap://10.10.10.1/


Bạn mở file

vim /etc/pam.d/system-auth

 vào thêm vào cuối dòng của file đó câu.

session optional pam_mkhomedir.so skel=/etc/skel umask=077

Bật ldap và cho ldap chạy cùng hệ thống.


service ldap start
service nscd start
chkconfig ldap on
chkconfig nscd on

Không có nhận xét nào:

Đăng nhận xét