This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:jbrant:csit1320:ldap_install [2010/05/13 18:13] – jbrant | user:jbrant:csit1320:ldap_install [2010/05/15 11:12] (current) – jbrant | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | The document that I followed to install ldap and kerbrouce sugested that I setup log monitoring so that is thee first thing I did was: | ||
+ | cd /var/log; tail -F daemon.log user.log auth.log debug kern.log syslog dmesg messages kerberos/ | ||
+ | |||
+ | My system was set up with three servers, one system where the ldap and Kerbrose Application was installed and two cleint systems: | ||
+ | |||
+ | |||
+ | *vm14.student.lab Application server ip 10.88.3.14 | ||
+ | *vm15.student.lab Client system | ||
+ | *vm16.student.lab | ||
+ | |||
+ | |||
+ | Next I needed to setup the host files on each system. \\ | ||
+ | Host file for vm14: | ||
+ | |||
+ | 10.80.3.14 | ||
+ | 10.80.3.15 | ||
+ | 10.80.3.16 | ||
+ | |||
+ | Host file for vm15: | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | Host file for vm16: | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | Log on to vm14.student.lab \\ | ||
+ | NOTE from this point on all entries will be shown in **Bold** and where you see // | ||
+ | |||
+ | ====== Server installation ====== | ||
+ | |||
+ | The process that I followed sugested that the server compnent to install is called slapd | ||
+ | |||
+ | apt-get install slapd ldap-utils | ||
+ | |||
+ | Debconf answers for reference: | ||
+ | Omit OpenLDAP server configuration? | ||
+ | |||
+ | DNS domain name: **student.lab** | ||
+ | |||
+ | Organization name? **student.lab** | ||
+ | |||
+ | Administrator password: // | ||
+ | |||
+ | Confirm password: // | ||
+ | |||
+ | Database backend to use: **HDB** | ||
+ | |||
+ | Do you want the database to be removed when slapd is purged? **No** | ||
+ | |||
+ | Allow LDAPv2 protocol? **No** | ||
+ | |||
+ | Enable the following two lines in / | ||
+ | |||
+ | %%//BASE dc=student, dc=lab// %% \\ | ||
+ | %%//URI ldap:// | ||
+ | |||
+ | ====== Server Configuration ====== | ||
+ | |||
+ | Then, let's edit the server' | ||
+ | Make sure all the schema files are enabled: | ||
+ | |||
+ | **include / | ||
+ | **include / | ||
+ | **include / | ||
+ | **include / | ||
+ | |||
+ | Change the verbosity level from 0 or “none” to 256: | ||
+ | |||
+ | **loglevel 256** | ||
+ | |||
+ | Search for line “index objectClass eq” and add the second line below | ||
+ | |||
+ | index objectClass eq \\ | ||
+ | **index uid eq** | ||
+ | |||
+ | To apply the new index option, run the following commands: | ||
+ | |||
+ | **invoke-rc.d slapd stop** \\ | ||
+ | **slapindex** \\ | ||
+ | **chown -R openldap: | ||
+ | **invoke-rc.d slapd start** \\ | ||
+ | **Initial test using ldapsearch and slapcat** | ||
+ | |||
+ | **ldapsearch -x** | ||
+ | |||
+ | # extended LDIF \\ | ||
+ | # \\ | ||
+ | # LDAPv3 \\ | ||
+ | # base < | ||
+ | # filter: (objectclass=*)\\ | ||
+ | # requesting: ALL\\ | ||
+ | # | ||
+ | |||
+ | # student.lab \\ | ||
+ | dn: dc=student, | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | o: student.lab \\ | ||
+ | dc: student | ||
+ | |||
+ | # admin, student.lab \\ | ||
+ | dn: cn=admin, | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | cn: admin \\ | ||
+ | description: | ||
+ | |||
+ | # search result \\ | ||
+ | search: 2 \\ | ||
+ | result: 0 Success | ||
+ | |||
+ | # numResponses: | ||
+ | # numEntries: 2 | ||
+ | |||
+ | **slapcat** | ||
+ | |||
+ | dn: dc=student, | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | o: student.lab \\ | ||
+ | dc: student \\ | ||
+ | structuralObjectClass: | ||
+ | etc … | ||
+ | |||
+ | dn: cn=admin, | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | cn: admin \\ | ||
+ | description: | ||
+ | userPassword:: | ||
+ | structuralObjectClass: | ||
+ | entryUUID: 350b330a-87d3-102c-8c1d-1ffeac40db98 \\ | ||
+ | creatorsName: | ||
+ | restarting | ||
+ | |||
+ | To load the LDIF file into the server \\ | ||
+ | **Invoke-rc.d slapd stop** \\ | ||
+ | **slapadd -c -v -l / | ||
+ | **invoke-rc.d slapd start** | ||
+ | |||
+ | Next I use ldapsearch to verify the entries have been created.\\ | ||
+ | **ldapsearch -x ou=people** | ||
+ | |||
+ | # extended LDIF \\ | ||
+ | # \\ | ||
+ | # LDAPv3 \\ | ||
+ | # base < | ||
+ | # filter: ou=people \\ | ||
+ | # requesting: ALL \\ | ||
+ | # | ||
+ | |||
+ | # People, student.lab \\ | ||
+ | dn: ou=People, | ||
+ | ou: People \\ | ||
+ | objectClass: | ||
+ | |||
+ | # search result \\ | ||
+ | search: 2 \\ | ||
+ | result: 0 Success | ||
+ | |||
+ | # numResponses: | ||
+ | # numEntries: 1 | ||
+ | |||
+ | ====== User Creation ====== | ||
+ | |||
+ | |||
+ | Next I created a user accounts by editing: / | ||
+ | |||
+ | **vi / | ||
+ | |||
+ | dn: cn=**mirko**, | ||
+ | cn: **mirko** \\ | ||
+ | gidNumber: **20000** \\ | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | |||
+ | dn: uid=**mirko**, | ||
+ | uid: **mirko** \\ | ||
+ | uidNumber: **20000** \\ | ||
+ | gidNumber: **20000** \\ | ||
+ | cn: **Mirko** \\ | ||
+ | sn: **Mirko** \\ | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | loginShell: /bin/bash \\ | ||
+ | homeDirectory: | ||
+ | |||
+ | To load the LDIF file into the server: \\ | ||
+ | |||
+ | **ldapadd -c -x -D cn=admin, | ||
+ | Enter LDAP Password: // | ||
+ | |||
+ | adding new entry “cn=mirko, | ||
+ | |||
+ | adding new entry “uid=mirko, | ||
+ | |||
+ | Now to define the new user's password: \\ | ||
+ | **ldappasswd -x -D cn=admin, | ||
+ | |||
+ | New password: NEW USER // | ||
+ | |||
+ | Re-enter new password: NEW USER // | ||
+ | |||
+ | Enter LDAP Password: //ADMIN PASSWORD// | ||
+ | |||
+ | next I verified that the account is setup. \\ | ||
+ | **ldapsearch -x uid=mirko** | ||
+ | |||
+ | # extended LDIF \\ | ||
+ | # \\ | ||
+ | # LDAPv3 \\ | ||
+ | # base < | ||
+ | # filter: uid=mirko \\ | ||
+ | # requesting: ALL | ||
+ | # | ||
+ | |||
+ | # mirko, people, student.lab \\ | ||
+ | dn: uid=mirko, | ||
+ | uid: mirko \\ | ||
+ | uidNumber: 20000 \\ | ||
+ | gidNumber: 20000 \\ | ||
+ | cn: Mirko \\ | ||
+ | sn: Mirko \\ | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | loginShell: /bin/bash \\ | ||
+ | homeDirectory: | ||
+ | |||
+ | # search result \\ | ||
+ | search: 2 \\ | ||
+ | result: 0 Success | ||
+ | |||
+ | # numResponses: | ||
+ | # numEntries: 1 | ||
+ | |||
+ | ====== NSS configuration ====== | ||
+ | |||
+ | |||
+ | To enable the system see LDAP accounts, we need to install libnss-ldap \\ | ||
+ | **apt-get install libnss-ldap nscd** | ||
+ | |||
+ | LDAP server URI: %%ldap://%% **10.80.3.14 /** | ||
+ | |||
+ | Distinguished name of the search base: **dc=student, | ||
+ | |||
+ | LDAP version to use: **3** | ||
+ | |||
+ | Does the LDAP database require login? **No** | ||
+ | |||
+ | Special LDAP privileges for root? **No** \\ | ||
+ | Make the configuration file readable/ | ||
+ | Allow LDAP admin account to behave like local root? **Yes** | ||
+ | |||
+ | Make local root Database admin. **No** | ||
+ | |||
+ | Does the LDAP database require login? **No** | ||
+ | |||
+ | LDAP administrative account: **cn=admin, | ||
+ | |||
+ | LDAP administrative password: // | ||
+ | |||
+ | Local crypt to use when changing passwords. **md5** | ||
+ | |||
+ | To configure the NSS module further: | ||
+ | |||
+ | **vi / | ||
+ | |||
+ | base **dc=student, | ||
+ | %%uri ldap://%% **10.80.3.14** | ||
+ | |||
+ | Finally, to activate the LDAP NSS module: | ||
+ | |||
+ | **vi / | ||
+ | |||
+ | replacing the following two lines: | ||
+ | |||
+ | passwd: **files ldap**\\ | ||
+ | group: **files ldap** | ||
+ | |||
+ | ====== PAM configuration ====== | ||
+ | |||
+ | |||
+ | The final step in this article pertains to integrating LDAP into the system authentication procedure. \\ | ||
+ | Let's install and configure libpam-ldap. (You might have already done this step automatically, | ||
+ | |||
+ | **apt-get install libpam-ldap** | ||
+ | |||
+ | Make local root Database admin. **No** | ||
+ | |||
+ | Does the LDAP database require login? **No** | ||
+ | |||
+ | Local crypt to use when changing passwords. **md5** | ||
+ | |||
+ | To configure the PAM module: | ||
+ | |||
+ | **vi / | ||
+ | |||
+ | base **dc=student, | ||
+ | %%uri ldap: // | ||
+ | |||
+ | **vi / | ||
+ | need to make sure these line are included | ||
+ | |||
+ | **account sufficient pam_unix.so** \\ | ||
+ | **account required pam_ldap.so** | ||
+ | |||
+ | # Enable if using Kerberos: #account required pam_krb5.so | ||
+ | |||
+ | **vi / | ||
+ | |||
+ | need to make sure these line are included | ||
+ | |||
+ | # Disable the three lines if using Kerberos: | ||
+ | **auth [success=1 default=ignore] pam_unix.so nullok_secure** | ||
+ | **auth required pam_ldap.so use_first_pass** | ||
+ | **auth required pam_permit.so** | ||
+ | |||
+ | # Enable the three lines if using Kerberos: | ||
+ | #auth sufficient pam_unix.so nullok_secure | ||
+ | #auth sufficient pam_krb5.so use_first_pass | ||
+ | #auth required pam_deny.so | ||
+ | |||
+ | **vi / | ||
+ | |||
+ | need to make sure these lines are included | ||
+ | |||
+ | password sufficient pam_unix.so nullok obscure md5 | ||
+ | |||
+ | #Disable if using Kerberos: | ||
+ | #password required pam_ldap.so use_first_pass | ||
+ | |||
+ | #Enable if using Kerberos: | ||
+ | password required pam_krb5.so use_first_pass | ||
+ | / | ||
+ | session required pam_unix.so | ||
+ | session required pam_mkhomedir.so skel=/ | ||
+ | |||
+ | # Enable if using Kerberos: | ||
+ | session optional pam_krb5.so minimum_uid=1000 | ||
+ | |||
+ | |||
+ | ====== Client Configuration ====== | ||
+ | |||
+ | |||
+ | These commands need to run on both clients\\ | ||
+ | **apt_get install pam_ldap libnss_ldap** \\ | ||
+ | **apt-get install pam_ldap libnss_ldap** \\ | ||
+ | **apt-get install pam-ldap libnss-ldap** \\ | ||
+ | **apt-get install libpam-ldap** | ||
+ | |||
+ | After that to save time and reduce typos I scp these files over to vm15 and vm16 from vm14 | ||
+ | |||
+ | / | ||
+ | / | ||
+ | /etc/pam.d/ common-auth \\ | ||
+ | / | ||
+ | / | ||
+ | |||
+ | log in to vm14 and do a: | ||
+ | |||
+ | scp / | ||
+ | scp / | ||
+ | |||
+ | This finishes the LDAP install next comes the Kerberos install. | ||
+ | |||
+ | |||
+ | ==== Refrance: ==== | ||
+ | http:// |