Académique Documents
Professionnel Documents
Culture Documents
From Section6wiki
What is NIS?
Network Information Service (NIS) is used for keeping a centralized repository of users,
hostnames and other useful information in a computer network. In single server UNIX
environments, the list of users and groups is usually kept in a file such as /etc/passwd.
Using NIS adds a "global" directory which is used for authenticating users from any host
on the network.
Note: In the early days, NIS was called Yellow Pages. The developers had to change the
name after a copyright infringement lawsuit, yet many of the key programs associated
with NIS have kept their original names beginning with yp.
Getting Started
This tutorial covers mostly RPM based distributions of GNU/Linux such as Red Hat,
Fedora, or CentOS. There are also references to Debian based distrbutions such as
Ubuntu. For information pertaining to your particular distrbution, please consult your
documentation.
In Red Hat-based distributions need to add the NIS domain name we wish to use in the
/etc/sysconfig/network file. For this example, we will call the domain "LINUX-NIS".
#/etc/sysconfig/network
NISDOMAIN="LINUX-NIS"
In Debian based distributions we would edit the /etc/defaultdomain file and simply put
in the NIS domain name
#/etc/defaultdomain
LINUX-NIS
Also, in Debian-based distributions, we would edit the /etc/default/nis file and configure
this as a Master NIS server
#/etc/default/nis
NISSERVER=master
Both Linux distributions have a configuration file for YP. We need to edit our
/etc/yp.conf file. NIS servers also need to be NIS clients themselves, so we will have to
edit the yp.conf to point this file towards the server itself, or localhost.
Note: The ypxfrd and ypbind daemons start with the all-encompassing nis startup script
for Debian. These daemons will time out on starting due to the fact that the NIS domain
has not been initialized yet. This is expected. NFS domain initialization is covered in the
next section.
We need to make sure these daemons are running before continuing to the next step. We
can use the rpcinfo command to do this:
The ypbind and ypxfrd might be listed as running, even though they do not start properly
until after the initialization of the NIS domain. If they are running, we will restart these
daemons after the domain initialization is completed.
[root@nis-server1]# /usr/lib/yp/ypinit -m
At this point, we have to construct a list of the hosts which will run NIS servers. nis-
server1 is in the list of NIS server hosts. We must continue to add the names for the other
hosts, one per line. When we are done with the list, simply type "a".
Now we can run ypinit -s nis-server1 on all slave servers (If we have any slave servers).
Note: Make sure portmap is running before trying this step or you'll get errors, such as:
You will have to delete the /var/yp/LINUX-NIS directory and restart portmap,
yppasswd, and ypserv before you'll be able to do this again successfully.
Once this is complete, you then have to update the NIS domain's authentication files by
executing the make command in the /var/yp directory.
[root@nis-server1]# cd /var/yp
[root@nis-server1]# make
gmake[1]: Entering directory `/var/yp/LINUX-NIS'
Updating passwd.byname...
Updating passwd.byuid...
Updating netid.byname...
gmake[1]: Leaving directory `/var/yp/LINUX-NIS'
You can check to see if the user's authentication information has been updated by using
the ypmatch command, which should return the user's encrypted password string.
You can also use the getent command, which has similar syntax. Unlike ypmatch, getent
doesn't provide an encrypted password when run on an NIS server, it just provides the
user's entry in the /etc/passwd file. On a NIS client, the results are identical with both
showing the encrypted password.
From here you should be up and going with your new NIS domain. Have fun.
Retrieved from
"http://www.section6.net/wiki/index.php/Configuring_NIS_Services_in_Linux"
Views
• Article
• Discussion
• View source
• History
Personal tools
Navigation
• Main Page
• Community portal
• Current events
• Recent changes
• Random page
• Help
• Donations
Search
Toolbox