LDAP viết tắt của Lightweight Directory Access Protocol là một giao thức dạng client-server được phát triển trên chuẩn X500 có chức năng phục vụ cho việc truy cập dịch vụ thư mục. LDAP có thể được sử dụng để lưu trữ bất kỳ loại thông tin nào và thường được sử dụng như một thành phần của hệ thống xác thực tập chung.
Mục lục
- Cấu hình đề nghị
- Cài đặt LDAP trên CentOS 7
- Cài đặt PHP Ldap Admin để quản lý tài khoản LDAP trên giao diện
1. Cấu hình đề nghị
Để cài đặt thành công LDAP, cấu hình đề nghị tối thiểu như sau:
- Hệ điều hành: CentOS 7
- RAM: 1GB
- CPU: 1 Core
- DISK: 15GB
2. Cài đặt LDAP trên CentOS 7
Cấu hình hostname
hostnamectl set-hostname "LDAP"
exec bash
Tắt firewalld
systemctl stop firewalld
systemctl disable firewalld
Tắt Selinux
sudo setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/sysconfig/selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
sed -i 's/SELINUX=permissive/SELINUX=disabled/g' /etc/selinux/config
Cài đặt epel-release và cập nhật các gói phần mềm
yum install epel-release -y
yum update -y
Khởi động lại máy để lấy lại cấu hình mới nhất :
init 6
Cài đặt OpenLDAP
yum -y install openldap-servers openldap-clients
Sao chép file cấu hình và phân quyền
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
chown ldap. /var/lib/ldap/DB_CONFIG
Khởi động slapd
systemctl start slapd
systemctl enable slapd
Thiết lập LDAP admin password, tạo mật khẩu
[root@ldap ~]# slappasswd
New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxxxxxxLDAPPASS1
Thêm mới file chroot.ldif
cat > chrootpw.ldif