System Administration Guide: Naming and Directory Services (NIS+)

Chapter 22 Removing NIS+

This chapter describes how to use the NIS+ directory administration commands to remove NIS+ from clients, servers, and the namespace as a whole.

For information on disassociating an NIS+ replica server from a directory so that it no longer acts as a replica for that domain, see nisrmdir Command.


Note –

NIS+ might not be supported in a future release. Tools to aid the migration from NIS+ to LDAP are available as of the Solaris 9 release. For more information, see System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) and visit NIS+ End-of-Feature (EOF) Announcement FAQ.


The NIS+ service is managed by the Service Management Facility. Administrative actions on this service, such as enabling, disabling, or restarting, can be performed by using the svcadm command. See NIS+ and the Service Management Facility for more information about using SMF with NIS+. For an overview of SMF, refer to Chapter 18, Managing Services (Overview), in System Administration Guide: Basic Administration. Also refer to the svcadm(1M) and svcs(1) man pages for more details.

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 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 Chapter 4, Configuring NIS+ With Scripts, run nisclient with the -r option:


client# 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 Chapter 4, Configuring NIS+ With Scripts, perform the following steps:

ProcedureHow to Remove NIS+ That Was Installed Using NIS+ Commands

  1. Remove the .rootkey file.


    client# rm -f /etc/.rootkey
  2. Stop the keyserver.


    client# svcadm disable /network/rpc/keyserv
  3. Stop the NIS+ service.

    This stops the rpc.nisd daemon and the nis_cachemgr.


    client# svcadm disable /network/rpc/nisplus:default
  4. Stop the name service cache (nscd).


    client# svcadm disable /system/name-service-cache:default
  5. Remove the /var/nis directory and files.


    clientmachine# 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 for information on removing the NIS+ name service from a network and returning to either NIS or /etc files for naming purposes.


Note –

You can replace a machine that you are using as an NIS+ server with another machine. See Replacing NIS+ Server Machines.


To remove NIS+ from a server, follow these steps:

ProcedureHow to Remove NIS+ From a Server

  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 or the NIS+ command set as described in Removing NIS+ That Was Installed Using NIS+ Commands.

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


    server# nisrmdir -f groups_dir.domainname
    server# nisrmdir -f org_dir.domainname
    
  3. Stop the keyserver.


    client# svcadm disable /network/rpc/keyserv
  4. Stop the NIS+ service.

    This kills the rpc.nisd daemon and the nis_cachemgr.


    server# svcadm disable /network/rpc/nisplus:default
  5. Stop the name service cache (nscd).


    server# svcadm disable /system/name-service-cache:default
  6. 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:

ProcedureHow to Remove the NIS+ Namespace

  1. Remove the .rootkey file from the root master.


    rootmaster# rm -f /etc/.rootkey
  2. 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, doc.com.

  3. Remove the root domain.


    rootmaster# nisrmdir -f domainname
    

    Where domainname is the name of the root domain, for example, doc.com.

  4. Stop the keyserver.


    client# svcadm disable /network/rpc/keyserv
  5. Stop the NIS+ service.

    This kills the rpc.nisd daemon and the nis_cachemgr.


    rootmaster# svcadm disable -t /network/rpc/nisplus:default
  6. Stop the name service cache (nscd).


    rootmaster# svcadm disable -t /system/name-service-cache:default
  7. 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+.

  8. Remove the existing /etc/defaultdomain file.


    rootmaster# rm /etc/defaultdomain
    
  9. Recreate the /etc/defaultdomain file with the new domain name.


    rootmaster# domainname > /etc/defaultdomain
  10. 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
  11. Remove the /var/nis directory and files.


    rootmaster# rm -rf /var/nis/*
  12. Start the NIS+ service.


    rootmaster# svcadm enable /network/rpc/nisplus:default