[Question] Gặp lỗi khi cấu hình OpenLDAP server,nhờ mọi người giúp |
29/09/2010 03:11:28 (+0700) | #1 | 221737 |
|
tanviet12
Member
|
0 |
|
|
Joined: 10/05/2010 12:15:15
Messages: 138
Location: TP - HCM
Offline
|
|
Em cấu hình OpenLDAP server trên CentOS 5 . Mọi chuyện đều xuông sẻ
.............
Chuyển các OU mẫu của OpenLDAP và file base.ldif
Code:
[root@ldap migration]# ./migrate_base.pl > base.ldif
Thêm nội dung vào OpenLDAP server
Code:
[root@ldap migration]# ldapadd -x -W -D "cn=Manager,dc=viet-cntt,dc=com" -f base.ldif
Tạo các user trên hệ thống
Code:
[root@ldap migration]# useradd viet
[root@ldap migration]# passwd viet
Chuyển các user vừa tạo vào OpenLdap Server
Code:
[root@ldap migration]# grep "x:[5-9][0-9][0-9]" /etc/passwd > passwd
[root@ldap migration]# grep "x:[5-9][0-9][0-9]" /etc/group > group
[root@ldap migration]# ./migrate_passwd.pl passwd > passwd.ldif
[root@ldap migration]# ./migrate_passwd.pl group > group.ldif
Đến bước đăng ký user và group thì bị lỗi
Đăng ký các user và group và trong OpenLDAP
Code:
[root@ldap migration]# ldapadd -X -W -D "cn=Manager,dc=viet-cntt,dc=com" -f passwd.ldif
[root@ldap migration]# ldapadd -X -W -D "cn=Manager,dc=viet-cntt,dc=com" -f group.ldif
Cả 2 lệnh đều gặp lỗi:
Code:
ldap_sasl_interactive_bind_s: No such attribute (16)
You have mail in /var/spool/mail/root
Xem nội dung file passwd.ldif thì thấy file trống. Còn file group.ldif thì nội dung là
Code:
dn: uid=nfsnobody,ou=People,dc=viet-cntt,dc=com
uid: nfsnobody
cn: nfsnobody
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}!!
shadowLastChange: 14871
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
uidNumber: 65534
gidNumber:
homeDirectory:
dn: uid=viet,ou=People,dc=viet-cntt,dc=com
uid: viet
cn: viet
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$QIiLiQD7$4Y1uk2TOWGYADRZLlRIm9.
shadowLastChange: 14881
shadowMin: 0
shadowMax: 99999
Mong các anh trợ giúp với... |
|
BTV
fb.com/buitanviet |
|
|
|
[Question] Gặp lỗi khi cấu hình OpenLDAP server,nhờ mọi người giúp |
29/09/2010 07:44:53 (+0700) | #2 | 221743 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
tanviet12 wrote:
...
Đến bước đăng ký user và group thì bị lỗi
Đăng ký các user và group và trong OpenLDAP
Code:
[root@ldap migration]# ldapadd -X -W -D "cn=Manager,dc=viet-cntt,dc=com" -f passwd.ldif
[root@ldap migration]# ldapadd -X -W -D "cn=Manager,dc=viet-cntt,dc=com" -f group.ldif
Cả 2 lệnh đều gặp lỗi:
Code:
ldap_sasl_interactive_bind_s: No such attribute (16)
You have mail in /var/spool/mail/root
-X đi cùng với ldapadd nghĩa là gì vậy bạn? Thảy file cấu hình slapd.conf của bạn lên xem. |
|
Let's build on a great foundation! |
|
|
|
[Question] Gặp lỗi khi cấu hình OpenLDAP server,nhờ mọi người giúp |
29/09/2010 11:01:54 (+0700) | #3 | 221758 |
|
tanviet12
Member
|
0 |
|
|
Joined: 10/05/2010 12:15:15
Messages: 138
Location: TP - HCM
Offline
|
|
Xem xin lỗi,
Không phải:
Code:
[root@ldap migration]# ldapadd -X -W -D "cn=Manager,dc=viet-cntt,dc=com" -f passwd.ldif
[root@ldap migration]# ldapadd -X -W -D "cn=Manager,dc=viet-cntt,dc=com" -f group.ldif
mà là:
Code:
[root@ldap migration]# ldapadd -x -W -D "cn=Manager,dc=viet-cntt,dc=com" -f passwd.ldif
[root@ldap migration]# ldapadd -x -W -D "cn=Manager,dc=viet-cntt,dc=com" -f group.ldif
Nhưng lỗi vẫn trả về như vậy. Và đây là file sldap.conf
[root@ldap migration]# vi /etc/openldap/slapd.conf
Code:
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
# Allow LDAPv2 client connections. This is NOT the default.
allow bind_v2
# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
# Load dynamic backend modules:
# modulepath /usr/lib/openldap
# Modules available in openldap-servers-overlays RPM package
# Module syncprov.la is now statically linked with slapd and there
# is no need to load it here
# moduleload accesslog.la
# moduleload auditlog.la
# moduleload denyop.la
# moduleload dyngroup.la
# moduleload dynlist.la
# moduleload lastmod.la
# moduleload pcache.la
# moduleload ppolicy.la
# moduleload refint.la
# moduleload retcode.la
# moduleload rwm.la
# moduleload smbk5pwd.la
# moduleload translucent.la
# moduleload unique.la
# moduleload valsort.la
# modules available in openldap-servers-sql RPM package:
# moduleload back_sql.la
# The next three lines allow use of TLS for encrypting connections using a
# dummy test certificate which you can generate by changing to
# /etc/pki/tls/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it. Your client software
# may balk at self-signed certificates, however.
# TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
# TLSCertificateFile /etc/pki/tls/certs/slapd.pem
# TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem
# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64
# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
# Allow self write access
# Allow authenticated users read access
# Allow anonymous users to authenticate
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn. (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!
#######################################################################
# ldbm and/or bdb database definitions
#######################################################################
database bdb
suffix "dc=viet-cntt,dc=com"
rootdn "cn=Manager,dc=viet-cntt,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw {SSHA}+u7a8HdVX+zyOaWvkd2rp35f6tAVbhix
# rootpw {crypt}ijFYNcSNctBYg
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap
# Indices to maintain for this database
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
# bindmethod=sasl saslmech=GSSAPI
# authcId=host/ldap-master.example.com@EXAMPLE.COM
access to attrs=userPassword
by self write
by dn="cn=Manager,dc=viet-cntt,dc=com" write
by anonymous auth
by * none
access to *
by dn="cn=Manager,dc=viet-cntt,dc=com" write
by self write
by * read
Mong anh quanta trợ giúp.
|
|
BTV
fb.com/buitanviet |
|
|
|
[Question] Gặp lỗi khi cấu hình OpenLDAP server,nhờ mọi người giúp |
29/09/2010 12:52:50 (+0700) | #4 | 221762 |
|
quanta
Moderator
|
Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
|
|
Bạn copy toàn bộ lệnh đã chạy và output trả về rồi paste lên đây nhé. |
|
Let's build on a great foundation! |
|
|
|
[Question] Gặp lỗi khi cấu hình OpenLDAP server,nhờ mọi người giúp |
29/09/2010 22:57:59 (+0700) | #5 | 221801 |
|
tanviet12
Member
|
0 |
|
|
Joined: 10/05/2010 12:15:15
Messages: 138
Location: TP - HCM
Offline
|
|
Đây là toàn bộ các bước em thực hiện
Đổi tên máy muốn cài đặt thành ldap.viet-cntt.com
Code:
#vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=ldap.viet-cntt.com
Reboot lại server:
Code:
Cài đặt các gói cần thiết:
Tạo password cho root ở dạng mã hóa:
Code:
[root@ldap ~]# slappasswd
New password:
Re-enter new password:
{SSHA}+u7a8HdVX+zyOaWvkd2rp35f6tAVbhix
Cấu hình domain cho OpenLDAP
Code:
#vi /etc/openldap/slapd.conf
Sửa các dòng thành
Thêm các dòng sau vào cuối file
Tiến hành test thử quá trình cấu hình
[root@ldap ~]# slaptest –u
Nhận được thông báo config file testing succeeded
Mở file ldap.conf
Code:
Và thêm vào
Code:
Copy file cấu hình mẫu OpenLDAP của hệ thống
Code:
[root@ldap ~]# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
Khởi động lại ldap
Code:
[root@ldap ~]# service ldap restart
Cấu hình cho ldap khởi động cùng máy
Code:
[root@ldap ~]# chkconfig ldap on
Thay đổi các thông tin về domain sẽ migration
Code:
[root@ldap ~]# cd /usr/share/openldap/migration/
[root@ldap migration]# vi migrate_common.ph
Sửa dòng 71 và 74 thành
Chuyển các OU mẫu của OpenLDAP và file base.ldif
Code:
[root@ldap migration]# ./migrate_base.pl > base.ldif
Thêm nội dung vào OpenLDAP server
Code:
[root@ldap migration]# ldapadd -x -W -D "cn=Manager,dc=viet-cntt,dc=com" -f base.ldif
Kết quả của lệnh:
Tạo các user trên hệ thống
Code:
[root@ldap migration]# useradd viet
[root@ldap migration]# passwd viet
Chuyển các user vừa tạo vào OpenLdap Server
Code:
[root@ldap migration]# grep "x:[5-9][0-9][0-9]" /etc/passwd > passwd
[root@ldap migration]# grep "x:[5-9][0-9][0-9]" /etc/group > group
[root@ldap migration]# ./migrate_passwd.pl passwd > passwd.ldif
[root@ldap migration]# ./migrate_passwd.pl group > group.ldif
Đăng ký các user và group và trong OpenLDAP
[img][root@ldap migration]# ldapadd -x -W -D "cn=Manager,dc=viet-cntt,dc=com" -f passwd.ldif
[root@ldap migration]# ldapadd -x -W -D "cn=Manager,dc=viet-cntt,dc=com" -f group.ldif
[/img]
Cả 2 lệnh đều gặp lỗi:
Code:
ldap_sasl_interactive_bind_s: No such attribute (16)
You have mail in /var/spool/mail/root
Đó là quá trình thực hiện. Mong anh quanta xem giúp. Em cảm ơn |
|
BTV
fb.com/buitanviet |
|
|
|
|