Network Information Services (NIS) Setup
NIS allows users to login from any of several networked computers
and access the same user account. The necessary steps to set up
NIS are:
-
Choose one machine to be your NIS Server
-
Configure the NIS Server on that machine
-
Configure every other machine in the network to be a
client of that NIS Server
So you've decided to choose an NIS Server
We chose to use my SPARC machine as our NIS Server so that it
would not feel left out in our computational cluster. We wanted
to keep the cluster homogeneous, and since we had four PCs and
one SPARC, the one kid who was doing his own thing got
chosen. It didn't have to be this way, though. The
eeny-miney-moe method would have worked just as well.
Configuring the NIS Server
To configure the NIS Server, take the following steps on the
chosen machine:
- Install the RPM packages associated with the following
utilities:
portmap
yp-tools
ypserv
ypbind
- Choose a name for the NIS domain (I just used the hostname of
my computer: unisys01)
- Modify NISDOMAIN entry in /etc/sysconfig/network to say:
NISDOMAIN=(name you chose for NIS domain)
- Initialize server by running:
/usr/lib/yp/ypinit -m
- In /var/yp/Makefile change the "all" entry (this entry
determines which information to share with all the NIS
clients) so that passwd and group are the only two not
commented out (in other words, make sure the line at least
says):
all: passwd group
- Start the NIS services by typing:
/etc/rc.d/init.d/portmap start
/etc/rc.d/init.d/ypserv start
/etc/rc.d/init.d/yppasswdd start
/etc/rc.d/init.d/ypbind start
- Check to make sure the NIS services are running by typing:
/usr/sbin/rpcinfo -p | grep yp
You should see entries for each of the services you just
started
- Anytime you update the passwd, shadow, or group files, you
must update the NIS maps by typing:
cd /var/yp
make
This is very important to remember! I always forget, and it
always confuses the heck out of me why things aren't working
right.
- Make sure NIS services will start up at run time. Run ntsysv
and check in portmap, ypserv, yppasswdd, and ypbind.
Configuring the NIS Client
The following procedure must be performed on each NIS client:
- Install the RPM packages for the following utilities:
yp-tools
ypbind
- Verify the server allows you access to its remote procedure
call (RPC) services by running:
/usr/sbin/rpcinfo -p (server_name)
- Modify NISDOMAIN entry in /etc/sysconfig/network to the
following:
NISDOMAIN=(domain name that was chosen during server setup)
- Modify /etc/yp.conf to include the line:
domain (domain-name) server (server-name)
Make sure the server name is listed in your /etc/hosts file
- Remove any entries from your /etc/passwd, /etc/shadow, and
/etc/group files that you wish to be queried from the NIS
server
- Modify /etc/nsswitch.conf so the following entries look like
the following:
passwd: files nis
shadow: files nis
group: files nis
hosts: files dns
- Start the NIS client by typing the following:
/etc/rc.d/inint.d/ypbind start
- Make sure this service will start up at run time by typing
ntsysv and checking in ypbind