Centralized Logins Using LDAP(OpenLDAP)

 

LDAP server cần các gói sau:

LDAP clients cần các gói sau:

Thiets lập firewall : LDAP ngầm định là cổng 389 

Check services hoạt động đúng chưa?

Create a database directory

1 thư mục có thể có nhiều database (ldap database)

# mkdir /var/lib/ldap/example.com

# chown ldap:ldap example.com/

Create an LDAP “root” password

[root@centos2 ldap]# slappasswd

{SSHA}rUpmrrqnQCRk6M/JmviPmU/gZENfGssL

chú ý chuỗi passwd này cần ghi lại để lưu vào file ldap.conf

Edit the slapd.conf file

/etc/openldap/slapd.conf

Create LDAP Database

Quá trình này cần để migrating your system’s authentication files to the LDAP database .

Nên sử dung PADL tool để migrate your /etc/passwd file into LDAP : http://www.padl.com/download/MigrationTools.tgz

Create xong thư mục ldap DB thì cần owner cho user ldap

Và start service :

Test the LDAP database

test local server

và test remote client

Edit the ldap.conf configuration file

/etc/openldap/ldap.conf

Edit the /etc/nsswitch file

Việc config trên có thể thực hiện trực tiếp thông qua desktop: System > Administration > Authentication : chọn phương thức là LDAP và input các thông số.

Check if remote user is existing in local machine: the /etc/passwd file

Nếu tồn tại thì cần phải detele username hoặc change uid, gid cho username tránh bị conflict với local user.

Create The Home Directory On The LDAP Client

Hoặc tạo trực tiếp thư mục trên local:

Hoặc sử dung thư mục trên server (tập trung dữ liệu cho tất cả user trên 1 máy):

Nếu sử dung Linux GUI desktop and mounting Linux home directories to an NFS server you may have to mount with the option “nolock“. Việc thiết lập NFS server xem hướng dẫn tại đây.

Thêm line sau vào file : /etc/fstab

Cần phải chác chắn là có những essential files and directories from /etc/skel/…để cho môi trường Desktop . Điểu này đc thiết lập trong PAM file :

thêm line sau vào /etc/pam.d/login file

session required pam_mkhomedir.so skel=/etc/skel/ umask=0022

Quản lý  LDAP user & Ggroup : có thể sử dụng trong Webmin

Chú ý: các bước thực hiện trên được thực hiện trên Centos (Server) và Fedora (client). Các bước này có thể thực hiện trên các Distro khác với 1 số thay đổi nhỏ.

 

Giai phap đóng gói sẵn của Fedora

http://directory.fedoraproject.org/

 

Leave a Reply

Your email address will not be published.