classes:la_slapd
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
classes:la_slapd [2016/12/14 19:49] – curry_searle | classes:la_slapd [2016/12/15 20:43] (current) – curry_searle | ||
---|---|---|---|
Line 2: | Line 2: | ||
The outline of this tutorial contains the following sections: | The outline of this tutorial contains the following sections: | ||
- | - Server: Configure OpenLDAP and add users | + | - [[classes: |
- | - Server: Configure NFS to export home directories | + | - [[classes: |
- | - Client: Configure PAM to authenticate using our OpenLDAP directory | + | - [[classes: |
- | - Client: Configure AutoFS to auto-mount user home directories from the server to the client | + | - [[classes: |
- | For this tutorial we will create three users in our LDAP directory, Tom, Olive and Kevin; all with the password of '' | + | For this tutorial we will create three users in our LDAP directory, Tom, Olive and Kevin; all with the password of '' |
- | === Server: Configure OpenLDAP and add users === | ||
- | Let's get started by logging into our server and installing OpenLDAP: | ||
- | < | ||
- | sudo apt-get -y install slapd ldap-utils | ||
- | </ | ||
- | When prompted, enter a password for your LDAP '' | ||
- | |||
- | Using your favorite editor, modify / | ||
- | < | ||
- | TLS_CACERT | ||
- | |||
- | BASE dc=itsm, | ||
- | URI ldap:// | ||
- | </ | ||
- | |||
- | Restart the ldap service to reload the new configuration: | ||
- | < | ||
- | sudo service slapd restart | ||
- | </ | ||
- | |||
- | Confirm the slapd service is running; you should see a line, '' | ||
- | < | ||
- | service slapd status | ||
- | ● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol) | ||
- | | ||
- | | ||
- | Docs: man: | ||
- | Tasks: 3 | ||
- | | ||
- | CPU: 52ms | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | Confirm your ldap server is answering requests by giving it a simple request: | ||
- | < | ||
- | ldapsearch -x | ||
- | # extended LDIF | ||
- | # | ||
- | # LDAPv3 | ||
- | # base < | ||
- | # filter: (objectclass=*) | ||
- | # requesting: ALL | ||
- | # | ||
- | |||
- | # itsm.unt.edu | ||
- | dn: dc=itsm, | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | o: unt.edu | ||
- | dc: itsm | ||
- | |||
- | # admin, itsm.unt.edu | ||
- | dn: cn=admin, | ||
- | objectClass: | ||
- | objectClass: | ||
- | cn: admin | ||
- | description: | ||
- | |||
- | # search result | ||
- | search: 2 | ||
- | result: 0 Success | ||
- | |||
- | # numResponses: | ||
- | # numEntries: 2 | ||
- | </ | ||
- | like this | ||
- | Now that we have our LDAP server running, lets populate it with some users. Create a file named '' | ||
- | < | ||
- | dn: uid=tom, | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | cn: tom | ||
- | uid: tom | ||
- | uidNumber: 5010 | ||
- | gidNumber: 9010 | ||
- | homeDirectory: | ||
- | loginShell: /bin/bash | ||
- | gecos: tom | ||
- | userPassword: | ||
- | shadowLastChange: | ||
- | shadowMax: 0 | ||
- | shadowWarning: | ||
- | |||
- | dn: uid=olive, | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | cn: olive | ||
- | uid: olive | ||
- | uidNumber: 5011 | ||
- | gidNumber: 9011 | ||
- | homeDirectory: | ||
- | loginShell: /bin/bash | ||
- | gecos: olive | ||
- | userPassword: | ||
- | shadowLastChange: | ||
- | shadowMax: 0 | ||
- | shadowWarning: | ||
- | |||
- | dn: uid=kevin, | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | objectClass: | ||
- | cn: kevin | ||
- | uid: kevin | ||
- | uidNumber: 5012 | ||
- | gidNumber: 9012 | ||
- | homeDirectory: | ||
- | loginShell: /bin/bash | ||
- | gecos: kevin | ||
- | userPassword: | ||
- | shadowLastChange: | ||
- | shadowMax: 0 | ||
- | shadowWarning: | ||
- | </ | ||
- | |||
- | Now that we have a data file containing user information, | ||
- | < | ||
- | ldapadd -a -D ' | ||
- | Enter LDAP Password: | ||
- | adding new entry " | ||
- | |||
- | adding new entry " | ||
- | |||
- | adding new entry " | ||
- | </ | ||
- | |||
- | We can confirm the users were added by performing another '' | ||
- | < | ||
- | ldapsearch -x objectClass=account dn cn uidnumber gidnumber | ||
- | # extended LDIF | ||
- | # | ||
- | # LDAPv3 | ||
- | # base < | ||
- | # filter: objectClass=account | ||
- | # requesting: dn cn uidnumber gidnumber | ||
- | # | ||
- | |||
- | # tom, itsm.unt.edu | ||
- | dn: uid=tom, | ||
- | cn: tom | ||
- | uidNumber: 5010 | ||
- | gidNumber: 9010 | ||
- | |||
- | # olive, itsm.unt.edu | ||
- | dn: uid=olive, | ||
- | cn: olive | ||
- | uidNumber: 5011 | ||
- | gidNumber: 9011 | ||
- | |||
- | # kevin, itsm.unt.edu | ||
- | dn: uid=kevin, | ||
- | cn: kevin | ||
- | uidNumber: 5012 | ||
- | gidNumber: 9012 | ||
- | |||
- | # search result | ||
- | search: 2 | ||
- | result: 0 Success | ||
- | |||
- | # numResponses: | ||
- | # numEntries: 3 | ||
- | </ | ||
- | |||
- | === Client: Configure PAM authentication to use LDAP === | ||
- | |||
- | Now that we have our OpenLDAP server configured and populated with users, we can move on to configuring our linux workstation to authenticate using our LDAP directory. | ||
- | |||
- | Logon to the client system ('' | ||
- | < | ||
- | sudo apt-get -y install ldap-auth-client nscd autofs | ||
- | </ | ||
- | |||
- | Configure ldap-auth-config: | ||
- | < | ||
- | sudo dpkg-reconfigure ldap-auth-config | ||
- | </ | ||
- | |||
- | Include the following settings: | ||
- | < | ||
- | LDAP Server URI: ldap:// | ||
- | Distinguised name of the search base: dc=itsm, | ||
- | LDAP version to use: 3 | ||
- | Make local root Database admin: Yes | ||
- | Does the LDAP require login: No | ||
- | LDAP account for root: cn=admin, | ||
- | LDAP root account password | ||
- | </ | ||
- | |||
- | Configure NSS authentication client for LDAP: | ||
- | < | ||
- | sudo auth-client-config -t nss -p lac_ldap | ||
- | </ | ||
- | - /etc/auth | ||
- | |||
- | Update PAM configuration: | ||
- | < | ||
- | sudo pam-auth-update | ||
- | </ | ||
- | Ensure the following are checked and choose Ok: | ||
- | < | ||
- | PAM profiles to enable: | ||
- | * Unix authentication | ||
- | * LDAP Authentication | ||
- | * Register user sessions in the systemd control group hierarchy | ||
- | </ | ||
- | |||
- | Restart the NSCD service: | ||
- | < | ||
- | sudo service nscd restart | ||
- | </ | ||
- | |||
- | Edit ''/ | ||
- | < | ||
- | # | ||
- | password | ||
- | </ | ||
- | |||
- | Confirm the client sees the LDAP accounts as available for authentication; | ||
- | < | ||
- | getenet passwd | ||
- | ... | ||
- | tom: | ||
- | olive: | ||
- | kevin: | ||
- | </ | ||
- | |||
- | Test authentication using '' | ||
- | < | ||
- | su - kevin | ||
- | Password: | ||
- | No directory, logging in with HOME=/ | ||
- | groups: cannot find name for group ID 9012 | ||
- | kevin@cls-kvm2:/ | ||
- | </ | ||
- | |||
- | In the next step we will resolve the '' | ||
- | |||
- | Still on the client machine, install our AutoFS dependencies: | ||
- | < | ||
- | |||
- | </ |
classes/la_slapd.1481773776.txt.gz · Last modified: 2016/12/14 19:49 by curry_searle