Changes

Jump to: navigation, search

OPS335 NIS Lab

73 bytes removed, 10:20, 23 September 2016
Moved NIS config onto host so we don't have to worry about VMs being started in a specific order.
== OBJECTIVE & PREPARATION==
* Add a new user to your '''vm2host''' with the same name as the one you created on '''vm3''' in lab 4b, but use a different password.* Download and run the [http://matrix.senecac.on.ca/~peter.callaghan/files/OPS335/nfs.bash nfs.bash] script on each of your machines. This will make your '''vm2host''' an nfs server sharing the home directories held there with the other vms. It will also make the other vms automatically try to mount the home directories held on '''vm2host''' into their own filesystem as soon as they boot.
* An NIS server is used to synchronize system files and other information between machines in an NIS domain.
* In this lab you will set a VM your '''host''' as an NIS server and share user information (names, groups, and passwords) with your other VM's.
{{Admon/important|Prerequisites|Before you begin make sure all your machines are up to date.
Ensure both host and VM's have firewalls set up according to prior labs and all labs have been completed. }}
== INVESTIGATION 1: SETTING UP YOUR NIS SERVER ==
*Install the NIS server and client onto your VM 2host.
yum install ypserv ypbind
*Add the following line to the bottom of the file /etc/sysconfig/network
* Verify that your servers (NFS, ypserv) are running correctly with the following command:
rpcinfo -p
*At this step you should edit your firewalls to allow RPC and NIS traffic through your firewall (Hint: check the output of rpcinfo -p or iptables traffic on the "lo" interface), but only if the traffic came from inside your virtual network.
*The machine will essentially be communicating with its own NIS server when using the Makefile
*Now change to directory /var/yp and run this command to build the information databases
*Run 'ypcat passwd' again.
*Note that the new user does not appear. In order for the new user to show up you will need to recreate the map files- change directory to /var/yp and run the "make" command again.
*Log out of '''VM2''', but leave it running
== INVESTIGATION 2: CLIENT CONFIGURATION ==
*Log into both '''vm2''' and '''vm3''' as the new user. Note how they require different passwords on different machines.
*Log out, and log back in as '''root''' (or use your normal user and '''su''') to continue.
*Install ypbind on your vm3.
tail -f /var/log/messages
*Edit /etc/yp.conf adding the following line:
domain <learnid>.org server 192.168.x.3*Add the following line to the bottom of the file /etc/sysconfig/network NISDOMAIN="<learn-id>.org"1
*Start the ypbind server with the command.
systemctl start ypbind.service
*You should be able to see the users from the server.
*If you added a mismatched user, you must update the map files on the server by running make again.
*Edit the /etc/nsswitch.conf file (on VM3 the VM only) and change the following lines so they appear as below:
passwd: nis files
shadow: nis files
*Ensure ypbind will start at boot and restart the vm.
*Note that a recent bug is making machines with ypbind running take extraodinarily long to shut down.
*Log into vm3 as the new user. You should now be able to use the password stored on '''vm2host'''.*Back on '''vm2host''' change the password for the new user and rebuild the maps. Try to log into '''vm3''' with the old password; it should now require the changed password.
== INVESTIGATION 3: ADDING THE OTHER VMS ==
*When you have successfully made this change on '''vm3''', repeat these steps so that '''vm1''' and '''vm2'['' will also use NIS for user identification from files located on '''vm2host'''.
**Warning: When configuring the location of the NIS server to bind to, use the ip address instead of the hostname. When the machine is booting, you have no guarantee that '''named''' starts before '''ypbind'''.
932
edits

Navigation menu