Changes

Jump to: navigation, search

OPS335 NIS Lab

423 bytes removed, 18:18, 5 January 2014
Revised Lab for Winter 2014. Moved NIS service to VM 2.
[[Category:OPS335]][[Category:OPS335 Labs]]
==NIS (Network Information Services)==
* An NIS server is used to synchronize system files and other information between machines in an NIS domain.
* In this lab you will set up your Fedora PC as both an NFS and NIS server. You will then use your VM's to serve as your NFS and NIS clients.
{{Admon/important|Prerequisites|Before you begin make sure all your Fedora 17 host and virtual machines are up to date (yum update).
Ensure both host and VM's have firewalls set up according to prior labs and all labs have been completed.
Ensure that your NFS server is running on the host and exporting the '/home' directory. }}
===PART A: Setting up your NIS Server===
*Install the NIS server and client onto your f17 host PCVM 2.
yum install ypserv ypbind
*Add the following line to the bottom of the file /etc/sysconfig/network
*Edit the file /etc/yp.conf and set up your domain:
domain <learn-id>.org server 127.0.0.1
*Edit the file /etc/nsswitch.conf and add "nis" to three lines:
passwd: files nis
shadow: files nis
group: files nis
 
*Create the file /var/yp/securenets:
host 127.0.0.1
*Backup the configuration file for NIS databases
cp /var/yp/Makefile /var/yp/Makefile.orig
*Modify the following two lines in /var/yp/Makefile from
MINUID=500
MINGID=500
to
MINUID=1000
MINGID=1000
* 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 the RPC and NIS traffic through your firewall (Hint: check the output of rpcinfo -p or iptables traffic on the "lo" interface)*Your host The machine will essentially be communicating with its own NIS server when using the Makefile*Now change to directory /var/yp and run this commandto build the information databases
make
*Enable and start the NIS binding (ypbind) service.
systemctl start ypbind.service
*You may need to enable another boolean relating to NIS.
getsebool -a | grep yp
*Use the following command to verify your NIS server is working - you should see your learnid password record.
ypcat passwd
*Run 'ypcat passwd' again.
*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.
*Now modify your firewall so that the VM's (client vm03 initially) will be able to access your NIS server. You will need to adjust your firewall - use netstat to determine what ports will be needed.
===PART B: Adding VM03 to your Examining a Problem Solved by NIS domain===*Ensure your VM03 is still mounting your home directory from the host machine VM 2 using autofs. If not revisit last weeks lab.
*Many of you had an issue last week when using NFS as you had differing GID & UID's between systems - when attempting to mount the home directory from the host you received various permission issues. In case you did not experience it, we will intentionally create this issue and then correct it with NIS.
*Run the following command
cat /etc/passwd | grep home
*Look at the existing users on VM 3 and compare them with the same users on the host machineVM 2. Find one whose credentials differ (if none do, create two). *For example on vm03VM 3:
[root@vm03 ~]# cat /etc/passwd | grep home
nis-user:x:1000:1000::/home/nis-user:/bin/bash
paul:x:1001:1001::/home/paul:/bin/bash
*And on the hostVM 2: [root@f17 fvm02 ~]# cat /etc/passwd | grep home
paul:x:1000:1000:paul:/home/paul:/bin/bash
nis-user:x:1001:1001::/home/nis-user:/bin/bash
*Now we will fix this problem by making this machine use NIS for user information
*Change users back to root
===Part C: Client Configuration===
*Install ypbind on your vm03.
* You may wish to follow the logs on vm03. In addition to your normal log in, ssh from the host to vm03 and get a continuous feed from the logs with:
tail -f /var/log/messages
*Edit /etc/yp.conf adding the following line:
domain <learnid>.org server 192.168.x.13
*Add the following line to the bottom of the file /etc/sysconfig/network
NISDOMAIN="<learn-id>.org"
*Again SSH to the machine, this time using your learnid account. You should now be able to see the files in your home directory with the correct mapping.
===Part CD: Obtaining autofs maps through NIS:===*Make sure autofs service is installed on your vmVM 3 (If you completed the nfs lab, it is). If it is not then install from yum, go back and complete the NFS lab now.*Copy the autofs files from vm03 to your host machineVM 2. scp /etc/auto.{home,master} root@f17vm02:/etc/
*Edit /etc/auto.master on the host and remove the 'etc' prefix from auto.home's path:
*You will need to look into the Makefile to determine how to add auto.home and auto.master to the list of files shared by NIS.
*After making changes to your Makefile, regenerate your maps again and run the same command as above. You should now see the file and its contents when you run ypcat auto.home.
[root@f16 vm02 yp]# ypcat auto.home
-fstype=nfs4,rw,nosuid,soft 192.168.70.1:/home/&
*On vm03 delete the autofs files, and edit the /etc/nsswitch.conf file so that autofs consults NIS. Reboot the machine.
*When the VM comes back up, SSH and ensure auto mounting of home occurred.
===Part DE: Adding the other VM's===*When you have successfully made this change on vm03, repeat these steps so that vm01 and vm02 will use NIS for user identification, and mount home directories using autofs.
==Completing the Lab==
932
edits

Navigation menu