17.3. Setting Up an NIS Master Server

Before your system can become an NIS, the appropriate server programs must first be installed—if they are not, when you click on the NIS Server icon an error message will be displayed. Check your Linux distribution CD or website for a ypserv or nis-server package, which should contain all the needed commands and files.

The first step in setting up an NIS server is deciding on a domain name. Typically, this will be the same as your Internet domain (such as foo.com), but anything made up of letters, numbers, and dots is allowed. After deciding, the steps to follow are:

1.
On the module's main page, click on the NIS Server icon. This will take you to a form for enabling the server and configuring other options, as shown in Figure 17.2. The form will look the same on most Linux distributions, but on Caldera's OpenLinux it will have far fewer options.

Figure 17.2. The NIS server configuration form.


2.
Set the Enable NIS server? option to Yes. When the form is saved, the server processes will be started immediately and at each subsequent reboot.

3.
Enter your chosen domain into the Serve NIS domain field. This is better than choosing the Same as client option, even if they are going to be the same.

4.
Leave the Server type set to Master server. To set up a slave server, see Section 17.6 “Setting Up an NIS Slave Server”.

5.
If NIS clients are incapable of looking up hosts and addresses in DNS themselves, turn on the Lookup missing hosts in DNS? option to have the master server do lookups for them. Only very old client operating systems like SunOS 4 need this.

6.
In the NIS tables to serve field, select all the tables that you want to make available to clients. Some of the most commonly used tables and their contents are:

passwd UNIX users, as stored in the /etc/passwd file. Normally this contains passwords as well, instead of having them stored in a separate shadow table.

group UNIX groups, as normally found in the /etc/group file.

hosts Hosts and IP addresses, as found in the /etc/hosts file. Even though NIS can be used to store and lookup hostnames and addresses, it is almost always better to set up a DNS server instead.

shadow Additional user information, including passwords. If this table and passwd are selected, depending on your NIS Makefile configuration you may be able to edit extended user information, such as expiry and warning dates.

netgrp Netgroups, which are groups of hosts. These can be used when exporting directories via NFS, as explained in Chapter 6.

7.
If your network will have slave servers, it is advisable to set the Push updates to slaves? option to Yes. This way whenever a change is made to one of the NIS tables, all slave servers will be notified immediately so that they are in sync.

8.
Enter the IP addresses of any slaves (separated by spaces) into the Slave servers field.

9.
In the Master NIS files section, you can choose which files will be used as the sources for the NIS tables. Often by default the normal user, group, host, and other configuration files in /etc will be used, such as /etc/passwd, /etc/group, and /etc/hosts. This is not a good idea, though—instead, you should change the files for the tables that your server is using to similar filenames in the /var/yp directory, such as /var/yp/passwd and /var/yp/group. Once the server is running, it can be configured to become one of its own clients and so have access via NIS to any records in these files, instead of accessing them locally.

10.
When done, click the Save and Apply button. The NIS server will be started on your system, and be configured to start at boot time in future.

Now that the server is running, you can test it by configuring some other system as an NIS client for the chosen domain. Server settings on the form can be changed at any time by simply repeating the same steps, and they will become effective immediately.

To shut down your NIS server, the steps to follow are:

1.
Make sure any clients are no longer using your system as a server, either by turning off NIS on them altogether or having them use a different server.

2.
On the module's main page, click on the NIS Server icon to go to the server options form.

3.
Set the Enable NIS server? field to No.

4.
Click the Save and Apply button. The server processes on your system will be shut down, and prevented from starting at boot time in future.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.149.94