Linux Fundamentals
       Linux System Admin
Linux System Engineer
Linux Advance Mail
       Linux Cluster
Advance Firewall Security
       & Internet Cafe

OpenLDAP & NIS Server

Linux Training Onsite
FreeBSD Administrator
FreeBSD Engineer
ราคา & โปรโมชั่น
       แจ้งการโอนเงิน
ตารางการอบรม
การชำระค่าอบรม
แผนที่
คำถามที่ถูกถามบ่อย

รายชื่อผู้เข้าอบรมนามบุคคล

   บริษัท ซีเอสล๊อกอินโฟ จำกัด ( มหาชน )

   บริษัท จี เอ็ม เอ็ม แกรมมี จำกัด (มหาชน)

   บริษัท บลิส-เทล จำกัด ( มหาชน )

   บริษัท สยามบรรจุภัณฑ์ จำกัด
    ( เครือซีเมนต์ไทย )

   บริษัท CDG MicroSystemห จำกัด

   บริษัท หลักทรัพย์ กิมเอ็ง
    (ประเทศไทย) จำกัด (มหาชน)

   บริษัท อินเตอร์เนชั่นแนล รีเสริช
    คอร์ปอเรชั่น จำกัด (มหาชน)

   บริษัท IBM Thailand จำกัด

   บริษัท ทีทีแอนด์ที จำกัด ( มหาชน )

   บริษัท ไทยไวร์โพรดัคท์ จำกัด (มหาชน)

   บริษัท ภาคใต้เชื้อเพลิง จำกัด ( มหาชน )

   บริษัท สหมงคลประกันภัย จำกัด

   สำนักงานพัฒนาวิทยาศาสตร์และเทคโน
    โลยีแห่งชาติ ( สวทช )

   บริษัท ซิงเกิ้ล พอยท์พาร์ท จำกัด (มหาชน)

   บริษัท ssup group จำกัด

   บริษัท ฮิตาชิ โกลบอล สตอเรจ
    เทคโนโลยีส์ (ประเทศไทย) จำกัด

    บริษัท เอส.เค.ฟูดส์ (ประเทศไทย)
    จำกัด (มหาชน)

    ร้านอินเตอร์เน็ต แมวไทย

    วิทยาลัยเกษตรและเทคโนโลยีนราธิวาส

    โรงพยาบาลสมเด็จพระยุพราชด่านซ้าย

    Yokogawa(Thailand),Ltd.

    Thai Airports Ground Services Co., Ltd.

    บริษัทเอ็กซ์เซลเล้นท์ รับเบอร์ จำกัด

    Music Television Network Co.,Ltd.

    บริษัทวงศ์สว่างการพิมพ์ จำกัด

    LK Boiler Industry Co.,Ltd.

    Asiantrails Ltd.

    KEERA-PAT INTERNATIONAL
    SCHOOL

    บจก.ซัมมิท โอโตซีท อินดัสตรี

    Atos Origin (Thailand) Ltd.

    บริษัท ไทย แอร์พอร์ตส์ กราวด์
    เซอร์วิสเซส จำกัด

   หจก. อุดร ช. ทวี

   Premacare international Co.,Ltd

   สำนักวิจัยและบริการคอมพิวเตอร์

   Manpower Company

   Optimized Solution Co.,Ltd

   บริษัท ลีพัฒนาอาหารสัตว์ จำกัด

   มหาวิทยาลัยเทคโนโลยีสุรนารี

   โรงเรียนปราจีนกัลยาณี

   สถาบันเทคโนโลยีนานาชาติสิรินธร

   Peters Surgical International Co.,Ltd

   บริษัท Nation Multimedia Group จำกัด

   บริษัท เพาเวอร์เมติค จำกัด

   บริษัท เน็ตไบร์ท จำกัด

   บริษัท เอ็นทีเอ็นโซลูชั้น จำกัด

   บริษัท เอ็น ซี ซี แมนเนจเม้นท์ แอนด์
    ดิเวลลอปเม้นท์ จำกัด

   บริษัท เอเซียอินเว็นท์ จำกัด

   สถาบันวิจัยวิทยาศาสตร์การแพทย์ทหาร

   บริษัทออวิส (ประเทศไทย) จำกัด

   บริษัท พ๊อดแมน จำกัด

   STAT HUB LINK Co.,Ltd

   St.Joseph Convent School

   บริษัท เอกราชคอมพิวเตอร์ จำกัด

   Datapro Computer Systems Co.,Ltd.

   บริษัท ทีม คอลซัลติ้ง เอนจิเนียริ่ง
    แอนด์ แมเนจเมนท์ จำกัด

   NetService Co.,Ltd

   บริษัท ย่งกี่ จำกัด

   Flexmedia Co.,Ltd

   โรงพยาบาล ห้างฉัตร (ลำปาง)

   โรงเรียนนายร้อยพระจุลจอมเกล้า

   Thaiwire Product PLC

   JSS Software Service(Thai) Co.,Ltd

   มหาวิทยาลัยราชภัฏพระนคร

    I.S.A. Value.co.Ltd

   มหาวิทยาลัยศรีปทุม

   มหาวิทยาลัยแม่ฟ้าหลวง (เชียงราย)

   สถาบันพระปกเกล้า ( นนทบุรี )

   โรงพยาบาลแม่ลาน้อย ( แม่ฮ่องสอน )

   มหาวิทยาลัยศรีนครินทรวิโรฒ

   บริษัท ก้าวหน้า ไก่สด จำกัด (อุบลราชธานี)

   บริษัท เน็กเวฟเวอร์ดอตเนท จำกัด

   บริษัท อินเตอร์เนชั่นแนล โปรโมชั่น
    แอนด์ เอ็กซิบิชั่น จำกัด

   บริษัท ไทยยามาฮ่ามอเตอร์ จำกัด

   โรงพยาบาล สวรรค์ประชารักษ์
    ( นครสวรรค์ )

   บริษัท อีสเทิร์นไทยคอนซัลติ้ง 1992 จำกัด

   บริษัท เอวัน คอมพิวเตอร์ จำกัด

   บริษัท ราชมงคล ธัญบุรี จำกัด

   โรงเรียนจุฬาภรณ์ราชวิทยาลัยเพชรบุรี

   บริษัท ไฮท๊อปเทคโนโลยี จำกัด

   บริษัท อิททิเกรทเอ็นเตอร์ไพรส์สแตรทิจ
    จำกัด

   บริษัท css Group Comunication จำกัด

   บริษัท Philip Semiconductor(Thailand)
    จำกัด

   บริษัท ไทยเทปกาวอุตสาหกรรม จำกัด

   บริษัท Patkol Public จำกัด

   ร้าน 109 design ( เสรีเซ็นเตอร์ )

   บริษัท Pacific Healthcare(Thailand) จำกัด

   บริษัท THAI TAKEDA LACE จำกัด

   โรงเรียน ภูเก็ตไทยหัว ( ประศาสน์วิทยา )

   ร้าน X-NET INTERNET ( หาดใหญ่ )

   มหาวิทยาลัยเกษตรศาสตร์

   มหาวิทยาลัยราชภัฎจันทรเกษม

   มหาวิทยาลัยเทคโนโลยีมหานคร

   มหาวิทยาลัยเทคโนโลยีพระจอมเกล้า
   ธนบุรี

   สถาบันเทคโนโลยีพระจอมเกล้า
    พระนครเหนือ

   มหาวิทยาลัยราชภัฏบ้านสมเด็จเจ้าพระยา

   มหาวิทยาลัยธรรมศาสตร์ ( Sirindhorn
    International Institute of Technology )

   สถาบันเทคโนโลยีพระจอมเกล้า
    เจ้าคุณทหารลาดกระบัง

   ห้างหุ้นส่วน Far East Creation

   บริษัท ไทยฟูจิซีร็อกซ์ จำกัด

   หนังสือพิมพ์ไทยรัฐ

   บริษัท PAN TECH R&D จำกัด

   บริษัท รามา ชูส์ อินดัสตรีส์ จำกัด

   บริษัท E-idea จำกัด

   บริษัทDelta Electronic ( Thailand ) จำกัด

   บริษัท โกซอฟท์ ( ประเทศไทย ) จำกัด

   บริษัท บางกอกกล๊าส จำกัด

   บริษัท แปซิฟิค โซลูชั่น แอนด์
    คอมมิวนิเคชั่น

   โรงพยาบาล รามาธิบดี

   บริษัท PointIT consulting จำกัด

   บริษัท กรุงเทพออโตแมช จำกัด

   บริษัท โปรเกรส อินฟอร์เมชั่น จำกัด

   บริษัท KOHBUNSHI THAILAND จำกัด

   อื่นๆ ในนามบุคคล

www.linux.org
www.linux.com
www.centos.com
www.debian.com

www.howtoforge.com

www.kernel.org

www.linuxjournal.com

www.novell.com/linux

www.gentoo.org

www.linux-mag.com

www.linuxlinks.com

www.linuxquestions.org

www.blackdown.org

www.opensuse.org

www.linux.chinaunix.net

www.slackware.com

โดย มนตรี สีเทา ( RHCT , RHCE )
( Last update 02/02/07 )

การติดตั้ง OpenLDAP Server และ OpenLDAP Client พร้อมการคอนฟิก

            บทความนี้ผมจะแสดงการติดตั้งและคอนฟิก OpenLDAP Server และ Client ส่วนข้อมูลเบื้องต้นผมแสดงไว้ดังด้านล่างแล้วครับ
Software:  OS-Cent OS 4.4, openldap 2.2.13-6.4E
System name:   ldap.linuxgray.com
Domain name:   linuxgray.com
System IP:     192.168.1.212
หมายเหตุ ชื่อ Domain และ IP คุณสามารถเปลี่ยนตามการใช้งานของแต่ละองค์กรได้
Step #1. เตรียมพร้อม Package ครับต้องมีตามนี้ครับ
  compat-openldap.i386 0:2.1.30-6.4E
  openldap-clients.i386 0:2.2.13-6.4E
  openldap-devel.i386 0:2.2.13-6.4E
  openldap-servers.i386 0:2.2.13-6.4E
  openldap-servers-sql.i386 0:2.2.13-6.4E
คุณสามารถติดตั้งพวกมันได้ตามคำสั่งนี้ครับ
yum install *openldap* -y

Step #2. ทำการ Start Service ด้วยคำสั่ง

            [root@ldap ~]# chkconfig --levels 235 ldap on
            [root@ldap ~]# service ldap start 

Step #3. ทำการสร้าง LDAP root user password

            [root@ldap ~]# slappasswd
             New password:
             Re-enter new password:
              {SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G/DltW
            [root@ldap ~]#

Step #4. Update /etc/openldap/slapd.conf ให้กับ  root password

            [root@ldap ~]# vi /etc/openldap/slapd.conf

                #68 database        bdb

            #69 suffix          "dc=linuxgray,dc=com"

            #70 rootdn          "cn=Manager,dc=linuxgray,dc=com"

            #71 rootpw          {SSHA}cWB1VzxDXZLf6F4pwvyNvApBQ8G

 

Step #5. Start Service ด้วยคำสั่ง

                [root@ldap ~]# service ldap restart 

Step #6. สร้างuser ขึ้นมา Test

            [root@ldap ~]# useradd test1
            [root@ldap ~]# passwd test1
               Changing password for user test1.
                New UNIX password:
                Retype new UNIX password:
                passwd: all authentication tokens updated successfully.
            [root@ldap ~]# useradd test2
            [root@ldap ~]# passwd test2
                Changing password for user test2.
                New UNIX password:
                Retype new UNIX password:
                passwd: all authentication tokens updated successfully.
            [root@ldap ~]#  

Step #7. ทำการเปลี่ยน local users ให้เป็น LDAP

            [root@ldap ~]# grep root /etc/passwd > /etc/openldap/passwd.root
            [root@ldap ~]# grep test1 /etc/passwd > /etc/openldap/passwd.test1
            [root@ldap ~]# grep test2 /etc/passwd > /etc/openldap/passwd.test2

 Step #8. Update ไฟล์  /usr/share/openldap/migration/migrate_common.ph

            #71 $DEFAULT_MAIL_DOMAIN = "linuxgray.com";

            #74 $DEFAULT_BASE = "dc=linuxgray,dc=com";

 

Step #9. ทำการเปลี่ยน passwd.ให้เป็นไฟล์ ldif (LDAP Data Interchange Format) 

            [root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.root /etc/openldap/root.ldif
            [root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.test1 /etc/openldap/test1.ldif
            [root@ldap ~]# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.test2 /etc/openldap/test2.ldif

 Step #10. Update ไฟล์ root.ldif ให้กับ "Manager" LDAP Server 

            [root@ldap ~]# vi /etc/openldap/root.ldif

                        #1 dn: uid=root,ou=People,dc=linuxgray,dc=com

                        #2 uid: root

                        #3 cn: Manager

                        #4 objectClass: account

 

Step #11. สร้าง domain ldif  (/etc/openldap/linuxgray.com.ldif)

            [root@ldap ~]# cat /etc/openldap/linuxgray.com.ldif

                        dn: dc=linuxgray,dc=com

                        dc: linuxgray

                        description: LDAP Admin

                        objectClass: dcObject

                        objectClass: organizationalUnit

                        ou: rootobject

                        dn: ou=People, dc=linuxgray,dc=com

                        ou: People

                        description: Users of linuxgray

                        objectClass: organizationalUnit

 Step #12. ทำการ Import users เข้าไปใน LDAP ด้วยคำสั่ง

            [root@ldap ~]# ldapadd -x -D "cn=Manager,dc=linuxgray,dc=com" -W -        f  /etc/openldap/linuxgray.com.ldif
                Enter LDAP Password:
                adding new entry "dc=linuxgray,dc=com"
                adding new entry "ou=People, dc=linuxgray,dc=com"
            [root@ldap ~]#

 

Step #13. ให้ทำการ Restart Service อีกครั้งครับ

            [root@ldap ~]# service ldap restart 

 

Step #14. จากนั้นลองมา Test LDAP Server กันครับ ด้วยคำสั่ง

            [root@ldap ~]# ldapsearch -x -b 'dc=linuxgray,dc=com' '(objectclass=*)' 

 เป็นอันเสร็จเรียบร้อยครับสำหรับ OpenLDAP Server เห็นไหมครับว่าไม่ได้ยากอย่าที่หลายๆท่านคิดเลบครับ เดี๋ยวต่อไปก็จะเป็นการติดตั้ง OpenLDAP Client บ้างครับ ว่าแล้วอย่าเสียเวลาครับ ไปดูวิธีทำกันเลยครับแบบทีละขั้นตอนเลย

 

Step #1. ก่อนอื่นก็ต้องมีติดตั้ง Package กันก่อนครับเราจะใช้ YUM ครับ

                [root@ldapclient ~]#  yum install authconfig

 

Step #2. จากนั้นใช้คำสั่ง

                [root@ldapclient ~]# authconfig

 

Step #3. จากนั้นมาทำการตั้งค่าต่างๆ ให้ตรงกับค่าที่อยู่บน OpenLDAP Server

         [*] Use LDAP     [*] Use LDAP Authentication

    [Both should be checked]

        Click "Next".

        [ ] Use TLS   
        Server: ldap.linuxgray.com
        Base DN: dc=linuxgray,dc=com

        Click "Ok" to confirm.

เรียบร้อยครับสำหรับ OpenLDAP Client ลองทำดูครับได้ผลยังไงอย่าลืมส่งอีเมล์มาแจ้งด้วยนะครับ

โปรดติดตามบทความเรื่องต่อไปครับ

ขอบคุณครับ

 

 

 

 
Design by Thanathit (i'm Goal)
: Home :
: News :
 
Linux is a registered trademark of Linus Torvalds.All other trademarks are trademarks of their respective owners.
Copyright Linuxgray Training Center 2006 - 2007