SUMMARY: Removing NIS (or NIS+)

From: Jamie Bubenicek (jab@nrg.com)
Date: Wed Jul 12 1995 - 09:03:00 CDT


Hello fellow Sun-Managers,
 
  Well I couldn't ask to belong to a better group. As always, the
response to my problem was quick and to the point. NIS+ has been completely
removed from our two SS20's running Solaris 2.4 (Now the real hell,
getting it in correctly, but that's another day).
   

==========================================
THANKS TO:

Andrej.Misik@fmph.uniba.sk
mfischer@nsi.edu
joel@virtualvegas.com
miquel@proton.uab.es
mnk@wuerl.wustl.edu
Andrew Mellanby
cramsey@strat-sys.bt.co.uk
johnm@pwj.com
Nuno.Canas@solsuni.pt
trevor@if.ssci.liv.ac.uk
trevor@if.ssci.liv.ac.uk
chrisl@tpc.bt.co.uk
imp@orbotech.co.il
coppelli@sun3.dsea.unipi.it
mo!chiron.nabaus.com.au!jeremyh@ucsd.edu

===========================================
>>>>
My orginal question:

  I am working on setting (or re-setting) up our two SS20's running
Solaris 2.4. NIS (or NIS+) is _somewhat_ running on these systems. I want
to completely remove it (like it was never there.)
 
First, could someone please tell me how I could find out which NIS or
NIS+ was installed. Second, recommendations on how exactly I can get it
out cleanly.
>>>>

>>>>
=============================================
fix was:

ps -ef | grep rpc.nisd (NIS+)
ps -ef | grep ypbind (NIS)

mv /etc/nsswitch.conf /etc/nsswitch.conf.nisplus
cp /etc/nsswitch.files /etc/nsswitch.conf
rm /etc/defaultdomain
rm /etc/.rootkey
passwd -d root
keylogout -f
rm /var/nis/*
reboot

============================================

NIS+ was installed on my system, I can not summarize on NIS.

Below is mail I received, I am sure with it anyone could remove NIS.

        Hi Jamie!
 
> First, could someone please tell me how I could find out which NIS or
> NIS+ was installed.

        If you are running ypbind ( ps -ef | grep ypbind - solaris,
        ps -augx | grep ypbind - sunos) you are running YP. If there is
        a file /var/nis/NIS_COLD_START, you are running NIS+. If neither
        is true, you are not running NIS+ nor NIS. Also look into
        /etc/nsswitch.conf (see /etc/nsswitch.conf(4) ).

> Second, recommendations on how exactly I can get it
> out cleanly.

        Just

cp /etc/nsswitch.files /etc/nsswitch.conf
rm -rf /var/nis/*
reboot

        Hope this helps.

NEXT

As root, do a "ps -ef" and check for ypbind or nis_cachemgr. If you have
the former, you're a YP (NIS) client. If you have the latter, you're an
NIS+ client.
 
To get rid of either, do the following:
 
# rm -rf /var/nis/
# rm -rf /var/yp/
# rm /etc/defaultdomain
# reboot

NEXT

You need to shutdown the nis_ client first (i.e. bind), go to the server
and shuitdown the daemon (i.e. rpc.nisd), remove all the files under the
nis_cache under /var directory. Also you need to remove /etc/.rootkey.
 
-- Joel

NEXT

1) nis and nis+ packages are:
 
        SUNWnisr Network Information System, (Root)
        SUNWnisu Network Information System, (Usr)
 
   you can check whether they were copied at install time with
 
        `pkginfo <pkg_name> `
 
2) check the man pages for nisfiles(4) and ypfiles(4), there you'll find
   the files and directories used by NIS+ and NIS (formerly YP)
 
3) you can see wheter NIS+ is running in your system with the command
 
        ps -ef | grep "rpc.nisd"
 
   if NIS+ is running you should have a process for the `rpc.nisd` daemon.
 
   if you are running NIS+ you can used the commands nisrm(1) and nisrmdir(1)
   to remove objects and directories in the NIS+ table (see man pages for
   more information)
 
4) if you are running NIS then you will have the daemon `ypbind' running
 
        ps -ef | grep "ypbind"
 
   removing NIS database must be done by hand, most of the files are
   stored under `/var/yp'
 
5) both services are started at boot time using the script in
   `/etc/init.d/rpc' , you should take a look to it to find out the
   files and directories used to set up these services and the daemons in
   charge of them
 
 
hope this helps you. miquel

NEXT

Check out the /etc/nsswitch.conf file on your system. If it says nis in
it, then that is that you have. Or it may say nisplus instead. To reset
things, you can run the script which sets up the server and that will
restart things. It will also give you the command you need to restore
your systems to no NIS/NIS+ use.
 
Have a good day.

NEXT

It all centres around the /etc/nsswitch.conf file,
for nis, it will have lines like
networks: nis [NOTFOUND=return] files
 
for nis+:
networks: nisplus [NOTFOUND=return] files
 
for neither:
networks: files
 
Here is how to remove it .. but I would advise you to read the Name service
configuration guide and name service Administration guide before you attempt
anything. Also, do you fully understand the implications ? eg. Does the
automounter get it's maps from a NIS table ? If so, you could be in trouble
if you remove it. Always ensure you have a FULL BACKUP of your root
partition before starting.
Anyway....
To remove whichever nameservice
 
a) cp /etc/nsswitch.files /etc/nsswitch.conf
 
b) kill nis daemons ( rpc.nisd and niscachemgr )
 
c) cd /var/nis ; rm -r *
 
d) change root passwd ;rm /etc.rootkey; keylogout -f
 
e) reboot
 
You can also remove /usr/lib/nis .. if you want to be thorough
 
Andrew Mellanby
Computing Officer, Dept. Math.Sciences,
University of Aberdeen
dd

NEXT

Jamie,
Jamie,
        The simplest way of determining as to whether or not you are running NIS or NIS + is to look at the /var directory. If you are running NIS+ there will be a directory /var/nis with another directory under that with the same name as the hostname of
the machine, (assuming your machine is a NIS+ server).
NIS + is to look at the /var directory. If you are running NIS+ there will be a directory /var/nis with another directory under that with the same name as the hostname of the As far as removing NIS+ goes, it is simply a case of removing the directory /va
r/nis, changing the domain name to noname and rebooting. If you are running NIS+ in YP compat mode you may need to remove the directory /var/yp. WHen you reboot the nis server demon shouldn't start and you can then do as you will with the machine.
        If the machine is running NIS then you just remove the /var/yp directory and change the domainname before rebooting.
        
Hope this helps,
 
Chris.
 
PS There is a command called nisrmdir on Sol 2.4 systems which can be used as well, but I've always used the above and it's worked.

NEXT

You can determine which protocol is running by looking at a ps -ef output. NIS+
will have a rpc.nisd running and I think that NIS will have something yp****
 
getting rid of it is pretty easy. remove the directory under /var nis=NIS+ &
yp=NIS. If you aren't feeling particularly brave rename the directory.
 

NEXT

If you didn't puchase the NISkit you are running NIS+
You can do it with NIS compatibility with the option -Y.
 
To remove it just do the following:
 
cp /etc/nsswitch.files /etc/nsswitch.conf
rm -f /etc/defaultdomain
rm -f /var/nis/*
 
Done...
Just reboot

NEXT

If you want the machines to just use /etc files
then just change the /etc/nsswitch.conf file on each
of them and that will stop them using nis,nis+
Have a look at the man page for nsswitch.conf.
Basically all you have to do is change all entries
to just "files". I don't know if there is a way
to deinstall the code but that doesn't matter really
once its disabled in this way. Oh and you must reboot
after altering the file.
 
Are you *sure* this is what you want though? Using
files is pretty awkward when you have more than a couple
of machines. A separate passwd file for every host
is needed for example.

NEXT

Jamie
 
Try running sys-unconfigure. Read the man pages to see all the effects that
this has but I think it will do the trick....
 
Regards,
Chris.

NEXT

Hello !
 
2. Generally speaking /usr/sbin/sys-unconfig always brings
   you system to "blank" state and after rebooting
   you have a chance to configure it according to your wish.
 
1. Look in /etc/nsswitch.conf.
   It may give you a hint of what your system is using now.
   Also look at ps output. If you see nis_cachemgr running
   then it is NIS+ environment definitly. And if you'll see
   ypbind it is NIS.
 
Regards,

NEXT

If you use NIS+ naming service there is deamon rpc.nisd
You should must delete the directory /var/nis
 
( ps -ef | grep rpc.nisd )
If there is DNS naming service there is deamon in.named
In this case the file /var/named/ and /etc/named.boot and /etc/resolv.conf
( for server ) or /etc/resolv.conf ( if your machine is client DNS )
You must killed the deamon and if you wish delete the file.
Perhaps the files not delete ( It is useful file for remenber set )
 
I don't know for the NIS

NEXT

First, could someone please tell me how I could find out which NIS or
NIS+ was installed.
 
use pkginfo to find which packages are installed on your system, then use
the -l option to find out all about them.
 
 pkginfo -l SUNWnisr
 pkginfo -l SUNWnisu
 
  Second, recommendations on how exactly I can get it
out cleanly.
 
swap nsswitch.conf files
cd /etc
mv nsswitch.conf nsswitch.conf.nisplus
cp nsswitch.files nsswitch.conf
 
remove the NIS+ startup key
rm /var/nis/NIS_COLDSTART
 
reboot
 
I think this does it all, but check for the credentials file, you may have to

remove or rename it, check man pages nis+ and nisfiles
 

NEXT

THANKS EVERYONE!!!!!

-- 
%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
                                              
        |Jamie Bubenicek              |          :::/      .::./      ::::::/
        |Los Angeles, CA  90036       |          :::/    .::::::./    :::/ ::/
        |E-Mail: jab@nrg.com          |          :::/    :::/ :::/    ::::::/
        | \o/ \ / \o/ \ / \o/ \ / \o/ |     :::/ :::/    ::::::::/    ::::::/
        |  |   |   |   |   |   |   |  |     ::::::::/    :::/ :::/    :::/ ::/
        | / \ /o\ / \ /o\ / \ /o\ / \ |      ::::::/  :: :::/ :::/ :: ::::::/

%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:29 CDT