NIS

NAME
SYNOPSIS
DESCRIPTION

NAME

NIS- Network Information Service

SYNOPSIS

NIS

DESCRIPTION

NIS, formerly YP, supports remote data access to system parameters. Client NIS/YP systems request parameters from centralized NIS and YP servers. System parameter data include valid user and password combinations, host name and internet address pairs, internet names and addresses and other UNIX system-specific information.

In the context of MachTen, NIS and NISPLUS are used to refer to version 3 of the NIS protocol. YP is used to refer to an earlier version 2 of the NIS protocol. Separating the protocol versions provides for specific version 3 operations with some NIS servers, and version 2 operations with other servers. If the local network supports only version 2 operations, only YP configuration is necessary. If the local network supports version 3 operations, only NIS configuration is necessary. The division in the NIS and YP naming provides for flexibility in specifying version 3 or version 2 operations. You may specify one or both sets of configuration according to your needs.

Basic NIS Configuration Steps

The basic components for operating as an NIS client are pre-installed in the MachTen 4.1 system. To enable NIS operations, a system must be configured with one or more NIS server systems. The search order and search type for different NIS data pairs may be modified. Finally, the system configuration file, /etc/rc.conf, is modified to start automatic portmap and ypbind operations.

Set YP Configuration in /etc/yp.conf

To configure an NIS client, the /etc/yp.conf and/or the /etc/nis.conf files must be modified with the names or internet addresses of a list of potential YP and NIS servers that are to be consulted for any YP and NIS operations. The /etc/yp.conf file contains configuration for access to NIS version 2 servers. In /etc/yp.conf, set the internet address of a YP server on one or more ’ypserver’ lines:

ypserver 10.0.0.28

ypserver 10.0.0.29

Setting the Domain entry in the /etc/yp.conf file maps all operations for a specific domain to the specified ypserver:

domainname tenon.com

Set NIS Configuration in /etc/nis.conf

The /etc/nis.conf file controls access to NIS version 3 servers. For NIS version 3 operations, set zero or more ’nisserver’ lines with the addresses of the NIS servers to be contacted:

nisserver 10.0.0.30

nisserver 10.0.0.31

Domain-wide opreations may be specified with the ’domainname’ configuration line:

domainname tenon.com

Set Database Search Order

The data files and remote data sources that are searched to satisfy a request are important. Moreover, the order in which these elements are searched is equally important. The /etc/nsswitch.conf configuration file contains line-by-line entries that specify the data sources and the search order for each type of remote data request supported by the MachTen NIS and YP software. In the /etc/nsswitch.conf file, nisplus and nis+ are used to refer to NIS version 3 protocol operations. Nis and yp are used to refer to NIS version 2 protocol operations. The following is a copy of the default /etc/nsswitch.conf:

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry ’[NOTFOUND=return]’ means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# dbm Use DBM access
# files Use the local files
# [NOTFOUND=return] Stop searching if not found so far
#

passwd: dbm files nisplus nis
shadow: files nisplus nis
group: files nisplus nis

hosts: files dns nisplus nis

services: files nisplus
networks: files nisplus
protocols: files nisplus
rpc: files nisplus
ethers: nisplus [NOTFOUND=return] files
netmasks: nisplus [NOTFOUND=return] files
bootparams: nisplus [NOTFOUND=return] files

netgroup: nisplus

publickey: nisplus

automount: files nisplus
aliases: files nisplus

These settings contain a general purpose configuration which is appropriate for a wide variety of installations.

Test the Basic Configuration

After /etc/nis.conf, /etc/yp.conf and /etc/nsswitch.conf are set appropriately, it is possible to test that the basic NIS network configuration is operating properly. First, start the portmap and ypbind daemons to facillitate the test:

root@ppc0# /usr/sbin/portmap
root@ppc0# /usr/sbin/ypbind
root@ppc0# ps -ax
PID TT STAT TIME COMMAND
0 ? R < (kernel idle)
1 ? S 0:00 /sbin/init
63 ? S 0:00 /usr/sbin/syslogd
80 ? S 0:00 /usr/sbin/inetd
232 ? S 0:00 /usr/sbin/portmap
235 ? S 0:00 ypbind (slave)
236 ? S 0:00 ypbind (slave)
77 co U 0:00 /usr/sbin/macmntd
86 co S 0:00 /usr/bin/wind
88 w0 S 0:03 -csh (tcsh)
221 w0 S 0:06 vi
222 w1 S 0:00 -csh (tcsh)
237 w1 R 0:00 ps -ax

The first two lines of the demonstration output above first execute the portmap daemon, followed by the ypbind daemon. The ps -ax command shows that the /usr/sbin/portmap and the ypbind (slave) applications are initialized and waiting for NIS protocol operations. To test that the daemons can properly contact a localy YP server, use the ypmatch or ypcat applications:

root@ppc0# ypmatch holmgren passwd
holmgren:.w.Xh2GK09bAw:507:507:Steve Holmgren:/home/holmgren:/bin/bash
root@ppc0# ypcat hosts
10.1.1.2 ppc100
127.0.0.1 host.foo.com
127.0.0.1 localhost
10.1.1.1 lamp100
root@ppc0#

The ypmatch command (see man ypmatch for more information) contacts the local YP server with a request for user "holmgren" from the ’passwd’ database. The output of ypmatch is the entry from the centralized password database corresponding to the user "holmgren".

The ypcat command causes a dump of a complete database. In the example above, the ypcat hosts command was used to dump the complete hostname to internet address database. See man ypcat for more information on the ypcat command.

Configure Automatic Portmap and Ypbind Startup

After proper basic operations have been verified, the system should be configured to automatically start both portman and ypbind. This is done by modifying the /etc/rc.conf file:

START_portmap="yes"

START_ypbind="yes"

Any subsequent restarts of the system will cause both portmap and ypbind to be automatically started and NIS operations will automatically be invoked.

This documentation is no longer being maintained and may be inaccurate or incomplete. The Texinfo documentation is now the authoritative source.