![]() |
||||||
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
||||
![]() |
|
![]() |
||||
![]() |
|
|||||
![]() |
|
|||||||||||||||||||
|
|||||||||||||||||||
NIS requires a server that maintains the main database of users, hosts, etc., and a number of clients that make use of this database. In addition, one or more slave servers can provide copies of the server database (also called maps, e.g. user map, host map, etc.). Example used: NIS Server name: amethyst.stones.com Slaves: beryl.stones.com Clients: chrysolite.supply.com, diolite.supply.com, emerald.mine.com
umask 022 Choose a domainname. The domainname must not be the same as the machine's or network's domain name. It may be entirely victitious, and is used only to identify all of the machines for a particular NIS network. Hence, machines with entirely different real domainnames can be included in a NIS network. For this example, the domainname shall be: precious.stones.incorporated: domainname precious.stones.incorporated Enter the domainname in the file /etc/domainname: precious.stones.incorporated Several files from the /etc directory will be used to create the initial maps for users, passwords, hosts, etc. It is recommended that these files be located in a new directory, so that they do not interfere with the ones in /etc. Moreover, security steps can be taken to disallow access to this new directory. mkdir /var/yp/etc Maps are now generated from files located in this directory. A makefile used to create these maps is located in /var/yp. It must be modified to use the new source directory /var/yp/etc. Two fields in /var/yp/Makefile need to be changed: DIR=/etc becomes DIR=/var/yp/etcand PWDIR=/etc becomes PWDIR=/var/yp/etcFiles from /etc and other locations can now be copied into /var/yp/etc to establish the source files. If any of these files do not exist, they can be created with no content using: touch /somedir/somefile Source Files:
cp /etc/auto_home /var/yp/etc
127.0.0.1 localhost Edit /var/yp/etc/netgroup and configure netgroups, if so desired:
stoneMachines (amethyst,,) (beryl,,) (chrysolite,,) (diolite,,) (emerald,,) Edit /etc/aliases to create redirects for e-mail accounts. Sendmail expects the aliases file to be in the /etc directory, which is why this file was not copied to /var/yp/etc. Mail re-directs are useful so that mail sent to any of the machines in the NIS network is re-directed to the correct mail server in that network. Add one line at the end of the file aliases for each user account:
joeuser:joeuser@amethyst.stones.com This step is temporary and will be undone in a later step: cp /etc/nsswitch.files /etc/nsswitch.conf To set-up the master NIS: /usr/sbin/ypinit -m When asked whether to stop at the first non-fatal error, type in y. This way, corrections can be made before the final maps are created. cp /etc/nsswitch.nis /etc/nsswitch.conf To start YP: /usr/lib/netsvc/yp/ypstart To stop YP: /usr/lib/netsvc/yp/ypstop Once configured, YP will be started automatically at boot time. When new users, hosts, etc. are added, the following command must be run to update the configuration: cd /var/yp For new users: make passwd For new netgroups: make netgroup For all: make When a user changes a password, these steps are not required!
umask 022 Set the domainname: domainname precious.stones.incorporated Enter the domainname in the file /etc/domainname: precious.stones.incorporated It is good practice to enter the master (server) name in /etc/hosts, so that the nodename as opposed to the full name can be used:
... cd /var/yp Configure the machine to become a client first, so that it can retrieve the maps from the server: /usr/sbin/ypinit -c When asked to enter the NIS master, enter the name of the master and any other slaves in the NIS network:
amethyst
/usr/lib/netsvc/yp/ypstop
/usr/lib/netsvc/yp/ypstart
/usr/sbin/ypinit -s amethyst
Set the domainname: domainname precious.stones.incorporated Enter the domainname in the file /etc/domainname: precious.stones.incorporated It is good practice to enter the master (server) name in /etc/hosts, so that the nodename as opposed to the full name can be used:
...
cp /etc/nsswitch.nis /etc/nsswitch.conf
ypinit -c Start YP:
/usr/lib/netsvc/yp/ypbind
#!/sbin/sh
|
|||||||||||||||||||