Changes

Jump to: navigation, search

OPS335-Lab-ldap

350 bytes added, 13:38, 15 April 2020
m
INVESTIGATION 2: Adding Users to LDAP
* You may find it helpful to add a record for vm4 in your DNS, and set up ssh-keys login to vm4.
TThe The root password is '''seneca99'''.
OpenLDAP has been set up on it using [https://www.itzgeek.com/how-tos/linux/centos-how-tos/step-step-openldap-server-configuration-centos-7-rhel-7.html this itzgeek guide]. You should read that guide even though you don't need to perform all those steps yourself.
$DEFAULT_BASE = "dc=andrew,dc=ops";
$EXTENDED_SCHEMA = 1;</source>
*Add/Create a new user to this machine with your username senecaID and a UID of 10000. Set their password as well.
*Migrating them into LDAP will take several steps:
*Extract the passwd entries of your new user from /etc/passwd to a file called ldapusers.entry
</source>
*Use the '''ldapadd''' command to enter this new information into the database (see the Itzgeek [https://www.itzgeek.com/how-tos/linux/centos-how-tos/step-step-openldap-server-configuration-centos-7-rhel-7.html/2 tutorial ] for an example). As before use simple authentication, the distinguished name of the ldap administrator, and get prompted for a password.
* Use '''ldapsearch''' to confirm that the new users have been added to the database. You should get output similar to the following:
<source>
dc: andrew
# Managerldaproot, andrew.opsdn: cn=Managerldaproot,dc=andrew,dc=ops
objectClass: organizationalRole
cn: Managerldaprootdescription: Directory LDAP Manager
# People, andrew.ops
== INVESTIGATION 3: Authenticating against LDAP ==
* Read the [https://www.itzgeek.com/how-tos/linux/centos-how-tos/step-step-openldap-server-configuration-centos-7-rhel-7.html/2 second ] page of the Itzgeek guide for instructions on how to configure a CentOS machine to authenticate against an LDAP server.* Prior to doing anything with it, backup your current configuration * Follow those instructions for '''vm1''', '''vm2''', and '''vm3'''. Make sure that you update the IP address of your server in the arguments to the '''authconfig ''' command.
* Confirm that you can log in using all three usernames on all your nested VMs (except vm4).
*Most updates will be run with specially formatted ldif files. These use the same structure as the files you created to add users, but will be shorter as they will only be changing one attribute.
*Each entry in an ldif file identifies an object to work with, and a changetype (which is an action to take on that object). Depending on the changetype, there might be an extra line for information to be changed or added.
*Write an ldif file called '''update1.ldif''' that will '''add ''' the attribute roomNumber to the user with your username. Set the value of roomNumber to be the room your class takes place in.
*Use '''ldapmodify''' to apply this file to your database, then run a search to confirm the new entry has been added.
*Write a new ldif file called '''update2.ldif''' that will '''replace ''' the email '''mail''' address of the user with your username so that it has your actual Seneca email address. Use '''ldapmodify''' again to apply this change to the database.*Write a third ldif file called '''update3.ldif''' to '''delete ''' the user john from the database, then apply that change using '''ldapmodify''' again.
*Use '''ldapsearch''' to confirm that these changes have taken place.
*Note that it is possible to write ldif files to make multiple changes at once, but that is beyond this course.
572
edits

Navigation menu