Setting up a NIS Server -------------------------------------- 1) Copy /etc/nsswitch.nis to /etc/nsswith.conf 2) Choose a NIS domain name (darren.com) 3) Issue the following command: # domainname darren.com 4) Put the domain name in the following config file: # echo darren.com > /etc/defaultdomain 5) Touch the following files (they need to exist even if zero length): # cd /etc # touch ethers bootparams locale timezone netgroup netmasks 6) Issue the following command: # ypinit -m 7) You will be prompted to enter a list of servers. Your hostname should already . exist. 8) Type ^d (ctrl d) to continue. 9) You will be prompted to have the system quit on "non-fatal" errors. Type "no" 10) You will them be asked to verify the list of servers in your NIS Domain. Type "y" 11) Issue the following command: # /usr/lib/netsvc/yp/ypstart 12) You have now started the ypserv and ypbind daemons on the server. Setting up a NIS Client -------------------------------------- 1) Copy /etc/nsswitch.nis to /etc/nsswith.conf 2) Use the NIS master domain (darren.com). 3) Issue the following command: # domainname darren.com 4) Put the domain name in the following config file: # echo darren.com > /etc/defaultdomain 5) Issue the following command: # ypinit -c 6) You will be prompted to enter a list of servers. Enter the name of the master server if it does not already exist. 8) Type ^d (ctrl d) to continue. 9) You will them be asked to verify the list of servers in your NIS Domain. Type "y" 10) Issue the following command: # /usr/lib/netsvc/yp/ypstart 11) You have now started the ypserv and ypbind daemons on the client. 12) Issue the following command: # ypwhich -m 13) The output of the previous command will show you which machine the client has binded to. Setting up a NIS Slave ------------------------------------- A Slave server must be initialized as a NIS client first. 1) Copy /etc/nsswitch.nis to /etc/nsswith.conf 2) Use the NIS master domain (darren.com) 3) Issue the following command: # domainname darren.com 4) Put the domain name in the following config file: # echo darren.com > /etc/defaultdomain 5) Issue the following command: # ypinit -c 6) You will be prompted to enter a list of servers. Enter the name of the master if it does not already exist. 7) Type ^d (ctrl d) to continue. 9) You will them be asked to verify the list of servers in your NIS Domain. Type "y" 10) Issue the following command: # /usr/lib/netsvc/yp/ypstart 11) You have now started the ypserv and ypbind daemons on the slave. 12) Issue the following command: # ypinit -s "master" 13) The "master" server refers to the one you set up on the network already. Add your hostname under the master server. 14) Issue the following command: # /usr/lib/netsvc/yp/ypstop 15) The previous command stops all NIS services on the slave server. 16) Issue the following command: # /usr/lib/netsvc/yp/ypstart 17) The previous command starts the ypserv and ypbind daemons on the slave. 18) Issue the following command: # ypwhich -m 19) The output of the previous command will show you which machine the slave has binded to. Adding a user on the NIS Master -------------------------------------- #!! Be sure to reboot -- -r the NIS Master after the preliminary set up of NIS. 1) # useradd -u 605 -g 10 -d /export/home/user5 -m -s /bin/ksh user5 2) # passwd user5 3) # vi /etc/passwd user5:x:605:10::/home/user5:/bin/ksh #!! Remove /export from the home directory field if using automounter. 4) # vi /etc/auto_home user5 server:/export/home/user5 5) # cd /var/yp 6) # /usr/ccs/bin/make #!! Updtae NIS maps. 7) # cd /usr/lib/netsvc/yp 8) # ./ypstop 9) # ./ypstart 10) # vi /etc/dfs/dfstab share -F nfs -o rw /export/home 11) # unshareall 12) # shareall 13) # dfshares server 14) Log in on the client as the new user