Technical article 105947

How to disable Network Information Service (NIS) on OpenServer 5.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

I have a system that was set up to be an NIS client or server and now I want to prevent NIS from running on it.

Solution

With NIS implemented, the user cannot simply invoke mkdev nis (or /etc/yp/ypinit) to remove NIS, once it has been configured.

The following instructions have three parts:
- Part I is for NIS clients

- Part II is for NIS slave or copy-only servers

- Part III is for NIS masters
I. For NIS clients:
---------------------------------------------------------------------

1. Take the system to single-user (maintenance) mode. Remove any "+:" entries from files that were NIS distributed; in particular, the /etc/passwd and /etc/group files. To see what other files may have been NIS distributed, look at the contents of the file /etc/yp/YP_MAP_X_LATE on your SCO NIS master (or equivalent on a non-SCO NIS master).

2. Reset the NIS domainname to null, or blank by running:

# domainname ""

Then run the command "domainname" with no arguments to ensure that it returns a blank. This will prevent the NIS startup file (/etc/nis or /etc/rc2.d/S85nis) from running.

3. Remove /bin/yppasswd (which is merely a link to /bin/passwd):

# rm /bin/yppasswd

4. Edit the file /etc/default/security and change the entry "NIS_ENABLED=Y" to "NIS_ENABLED=N".

5. Reboot the system.
II. For NIS slave or copy-only servers:
------------------------------------------------------------

If the system is a slave server or copy-only server, follow the steps described in the SCO OpenServer Networking Guide, Chapter 8, "Configuring the Network Information Service (NIS)", Section titled "Removing an NIS server from the server list", included here for your convenience:

Networking Guide Chapter 8, Configuring the Network Information Service (NIS)

Removing an NIS server from the server list

To remove a slave or copy-only server from an NIS domain:

1. Remove the NIS package from the server using the Software Manager.

2. Edit the ypservers map on the master server and propagate it to other servers.

CAUTION: Do not use the following procedure to remove a master server.
If you do, you must reconfigure your NIS network. Rather, refer to
``Changing the master NIS server''.

When SCO NIS is removed from a system, the /etc/passwd.local file is removed. The /etc/passwd file, which under NIS included both distributed and local accounts, becomes the authoritative password file. This means that distributed NIS accounts become regular user accounts when NIS is removed. If you want to restrict users with distributed NIS accounts from using the old server, you must remove their accounts before returning the old server to multiuser mode.

NOTE: Although you can prevent NIS maps from reaching a server by killing its NIS daemon processes, the master still attempts to reach the server during map propagation, adding an unnecessary burden to the system. For this reason, you should remove NIS from the server.

Follow these steps to remove a server:

1. Log into the old server in system maintenance mode.

2. Run the Software Manager (or custom) to remove the following NIS package:

Base Network Information System (NIS)

This can be seen by expanding the SCO NFS component.

3. If necessary, modify or retire previously distributed accounts; refer
  to ``Adding and modifying user accounts'' in the System
  Administration Guide or ``Removing or retiring a user account'' in
  the System Administration Guide for more information.

4. If necessary, remove root's crontab entries for NIS map transfers.

5. Reboot the system and return to multiuser mode. If kernel parameters were adjusted when NIS was removed, you are also prompted to relink the kernel.

6. Log into the master server in multiuser mode.

7. Edit the ypservers map to remove the old server's name and
  propagate the changed map to other servers. See ``Modifying
  existing maps'' for the procedure for editing and propagating an
  existing map. The ASCII file for the ypservers map is located at
  /etc/yp/ypservers.
III. For an NIS master server:
-------------------------------------------------------------

If the system is a master server, follow the steps described in the SCO OpenServer Networking Guide, Chapter 8, "Configuring the Network Information Service (NIS)", Section titled "Changing the master NIS server", included here for your convenience:

Networking Guide Chapter 8, Configuring the Network Information Service (NIS)

Changing the master NIS server

You may need to change your master server, for example, if you rearrange server configuration or the master server host is removed from service. Any server in the NIS domain can become the new master server because each one has all active maps. However, because the old NIS master's name is contained in the existing map, you can neither use an existing copy at the new master nor send a copy there with ypxfr. Rather, you must re-create these maps by running ypmake (or make) on the new master server to associate the new server listing with each map.

The old master server must be running NIS to complete this procedure. This is because nonmaster servers consult their own copies of maps, which include the name of the old master server, when they receive a map transfer request originating from yppush on the master. New maps with the new master server listing must come from the old master server for the maps to be incorporated on slave and copy-only servers. Therefore, if the old master is not available when you change master servers, you must rebuild your entire NIS system from scratch.

CAUTION: Changing master servers is a major reconfiguration of your network and should not be undertaken unless absolutely necessary. Make sure you understand the procedure thoroughly and back up your network configuration files before you begin.

The procedures described here assume that the new master is running SCO NIS. Other implementations of NIS configure servers in a different way; consult the documentation for your version of NIS before changing master servers.

To change NIS master servers, follow these steps:

1. Log into the new master server in multiuser mode.

2. Copy the /etc/passwd.yp file from the old master. If this file is not available, you must re-create distributed accounts manually. If you have modified the /etc/yp/ypmake or /etc/yp/Makefile file, you must also copy it from the old master.

3. Run the following commands to rebuild the maps:

cd /etc/yp
rm *.time
ypmake NOPUSH=1

By removing the timestamp files, you force the maps to be rebuilt regardless of prior modifications. The NOPUSH option to ypmake prevents maps from being pushed to other servers until you have completed this entire procedure.

4. If the map only exists as a ndbm database, you can remake it on the new master by unassembling an existing copy from any NIS server and running the unassembled version back through makedbm. For example, enter:

cd /etc/yp
ypcat -k mymap | ./makedbm - domain_name/mymap

5. Log into the old master server.

6. Copy the new maps from the new master server with the following command:

/etc/yp/ypxfr -h new_master -f mapname

This command must be run on the old master for every current NIS map. The -h option forces ypxfr to transfer the map from the new master; the -f option forces the transfer even if the contents of the old and new maps are the same.

7. Propagate the new maps from the old master server by running the following command on the old master server:

/etc/yp/yppush mapname

This command must be run on the old master for every current NIS map. When this is completed, all nonmaster servers will have received maps that include the new master listing.

8. If you are removing the old master server from NIS service, edit the
  ypservers map on the new master server following the instructions
  in ``Removing an NIS server from the server list''.

You can automate the map transfer procedure on the old master server using shell scripts and other tools. For example, the following shell script automatically completes steps 6 and 7:

\:
MAPS=`oawk '{print $1 ; }' /etc/yp/YP_MAP_X_LATE`
for map in $MAPS; do
echo moving $map
ypxfr -h new_master -f $map
yppush $map
done
Make sure your /etc/yp/YP_MAP_X_LATE file is current before running
this command; for more information, refer to ``NIS maps''.

See also

TA102425, "Known problems and solutions for NIS in OpenServer 5."

From the Xinuos technical article database, record 105947. Reproduced with permission. The original is at www.sco.com/ta/105947, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.