NIS+ and FNS Administration Guide
只搜寻这本书
以 PDF 格式下载本书

Removing NIS+

13

This chapter describes how to use the NIS+ directory administration commands to perform the following tasks:
Removing NIS+ From a Client Machinepage 245
Removing NIS+ From a Serverpage 246
Removing the NIS+ Namespacepage 248

Removing NIS+ From a Client Machine

This section described how to remove NIS+ from a client machine. Keep in mind that removing NIS+ from a client machine does not remove the NIS+ name service from your network. See "Removing the NIS+ Namespace" on page 248 for information on removing the NIS+ name service from a network and returning to either NIS or /etc files for name purposes.

Removing NIS+ That Was Installed Using nisclient

To remove NIS+ from a client machine that was set up as an NIS+ client using the nisclient -i script as described in NIS+ and DNS Setup and Configuration Guide, simply run nisclient with the -r option:

  clientmachine# nisclient -r  

nisclient -r simply undoes the most recent iteration of nisclient -i; it restores the previous naming system used by the client, such as NIS or /etc files.

Removing NIS+ That Was Installed Using NIS+ Commands

To remove NIS+ from a client machine that was set up as an NIS+ client using the nisaddcred, domainname, and nisinit commands as described in NIS+ and DNS Setup and Configuration Guide, perform the following steps:
  1. Remove the .rootkey file.


  clientmachine# rm -f /etc/.rootkey  

  1. Locate and kill the keyserv, rpc.nisd, nis_cachemgr, and nscd processes.


  rootmaster# ps -ef | grep rpc.nisd  
    root 137  1 67 16:34:44  ?  rpc.nisd  
  rootmaster# kill -9 137  
  rootmaster# ps -ef | grep keyserv  
    root 714  1 67 16:34:44  ?  keyserv  
  rootmaster# kill -9 714  
  rootmaster# ps -ef | grep nis_cachemgr  
    root 123  1 67 16:34:44  ?  nis_cachemgr  
  rootmaster# kill -9 123  
  rootmaster# ps -ef | grep nscd  
    root 707  1 67 16:34:44  ?  nscd  
  rootmaster# kill -9 707  

  1. Remove the /var/nis directory and files.


  rootmaster# rm -rf /var/nis/*  

Removing NIS+ From a Server

This section describes how to remove NIS+ from an NIS+ server.
Keep in mind that removing NIS+ from a server does not remove the NIS+ name service from your network. See "Removing the NIS+ Namespace" on page 248 for information on removing the NIS+ name service from a network and returning to either NIS or /etc files for naming purposes.

Removing NIS+ From a Server

To remove NIS+ from a server, follow these steps:
  1. Perform the steps necessary to remove NIS+ from a client.

    An NIS+ server is also an NIS+ client. This means that you must first remove the client-related part of NIS+. You can use nisclient -r as described in "Removing NIS+ That Was Installed Using nisclient" on page 245 or the NIS+ command set as described in "Removing NIS+ That Was Installed Using NIS+ Commands" on page 246.

  2. Remove the server's groups_dir and org_dir directories.


  server# nisrmdir -f groups_dir.domainname  
  server# nisrmdir -f org_dir.domainname  

  1. Locate and kill the keyserv, rpc.nisd, nis_cachemgr, and nscd processes on the server.


  server# ps -ef | grep rpc.nisd  
    root 137  1 67 16:34:44  ?  rpc.nisd  
  server# kill -9 137  
  server# ps -ef | grep keyserv  
    root 714  1 67 16:34:44  ?  keyserv  
  server# kill -9 714  
  server# ps -ef | grep nis_cachemgr  
    root 123  1 67 16:34:44  ?  nis_cachemgr  
  server# kill -9 123  
  server# ps -ef | grep nscd  
    root 707  1 67 16:34:44  ?  nscd  
  server# kill -9 707  

  1. Remove the /var/nis directory and files.


  rootmaster# rm -rf /var/nis/*  

Removing the NIS+ Namespace

To remove the NIS+ namespace and return to using either NIS or /etc files for name services, follow these steps:
  1. Remove the .rootkey file from the root master.


  rootmaster# rm -f /etc/.rootkey  

  1. Remove the groups_dir and org_dir subdirectories from the root master root domain.


  rootmaster# nisrmdir -f groups_dir.domainname  
  rootmaster# nisrmdir -f org_dir.domainname  

Where domainname is the name of the root domain, for example, wiz.com.
  1. Remove the root domain.


  rootmaster# nisrmdir -f domainname  

Where domainname is the name of the root domain, for example, wiz.com.
  1. Locate and kill the keyserv, rpc.nisd, nis_cachemgr, and nscd processes.


  rootmaster# ps -ef | grep rpc.nisd  
    root 137  1 67 16:34:44  ?  rpc.nisd  
  rootmaster# kill -9 137  
  rootmaster# ps -ef | grep keyserv  
    root 714  1 67 16:34:44  ?  keyserv  
  rootmaster# kill -9 714  
  rootmaster# ps -ef | grep nis_cachemgr  
    root 123  1 67 16:34:44  ?  nis_cachemgr  
  rootmaster# kill -9 123  
  rootmaster# ps -ef | grep nscd  
    root 707  1 67 16:34:44  ?  nscd  
  rootmaster# kill -9 707  

  1. Create a new domain.


  rootmaster# domainname name  

Where name is the name of the new domain; for example, the name of the domain before you installed NIS+.
  1. Remove the existing /etc/defaultdomain file.


  rootmaster# rm /etc/defaultdomain  

  1. Recreate the /etc/defaultdomain file with the new domain name.


  rootmaster# domainname > /etc/defaultdomain  

  1. Replace the original nsswitch.conf file.

    If you set up this server with nisserver -r, you can use:


  rootmaster# cp /etc/nsswitch.conf.no_nisplus /etc/nsswitch.conf  

Alternatively, you can copy over one of the default switch template files. To use the default NIS switch file template, you would type:

  rootmaster# cp /etc/nsswitch.nis etc/nsswitch.conf  

To use the default /etc files switch file template, you would type:

  rootmaster# cp /etc/nsswitch.files etc/nsswitch.conf  

  1. Restart the keyserv process.


  rootmaster# keyserv  

  1. Remove the /var/nis directory and files.


  rootmaster# rm -rf /var/nis/*  

  1. Now restart your other name service (NIS or /etc files).