|
NAMEypserv —
NIS database server
SYNOPSIS
DESCRIPTIONNIS is an RPC-based service designed to allow a number of UNIX-based machines to share a common set of configuration files. Rather than requiring a system administrator to update several copies of files such as /etc/hosts, /etc/passwd and /etc/group, which tend to require frequent changes in most environments, NIS allows groups of computers to share one set of data which can be updated from a single location.The The databases distributed by The databases, or maps as they are often called, are created by /var/yp/Makefile using several system files as source. The database files are in db(3) format to help speed retrieval when there are many records involved. In FreeBSD, the maps are always readable and writable only by root for security reasons. Technically this is only necessary for the password maps, but since the data in the other maps can be found in other world-readable files anyway, it does not hurt and it is considered good general practice. The SPECIAL FEATURESThere are some problems associated with distributing a FreeBSD password database via NIS: FreeBSD normally only stores encrypted passwords in /etc/master.passwd, which is readable and writable only by root. By turning this file into an NIS map, this security feature would be completely defeated.To make up for this, the FreeBSD version
of Furthermore, the getpwent(3) routines in the FreeBSD standard C library will only attempt to retrieve data from the master.passwd.byname and master.passwd.byuid maps for the superuser: if a normal user calls any of these functions, the standard passwd.byname and passwd.byuid maps will be accessed instead. The latter two maps are constructed by /var/yp/Makefile by parsing the master.passwd file and stripping out the password fields, and are therefore safe to pass on to unprivileged users. In this way, the shadow password aspect of the protected master.passwd database is maintained through NIS. NOTESSetting Up Master and Slave Serversypinit(8) is a convenient script that will help setup master and slave NIS servers.LimitationsThere are two problems inherent with password shadowing in NIS that users should be aware of:
SecurityIn general, any remote user can issue an RPC toypserv
and retrieve the contents of your NIS maps, provided the remote user knows
your domain name. To prevent such unauthorized transactions,
ypserv supports a feature called
securenets which can be used to restrict access to a
given set of hosts. At startup, ypserv will attempt to
load the securenets information from a file called
/var/yp/securenets. (Note that this path varies
depending on the path specified with the -p option,
which is explained below.) This file contains entries that consist of a
network specification and a network mask separated by white space. Lines
starting with “#” are considered to be comments. A sample
securenets file might look like this:
# allow connections from local host -- mandatory 127.0.0.1 255.255.255.255 # allow connections from any host # on the 192.168.128.0 network 192.168.128.0 255.255.255.0 # allow connections from any host # between 10.0.0.0 to 10.0.15.255 10.0.0.0 255.255.240.0 If The Note: while both of these access control mechanisms provide some security, they, like the privileged port test, are both vulnerable to “IP spoofing” attacks. NIS v1 compatibilityThis version ofypserv has some support for serving NIS
v1 clients. The FreeBSD NIS implementation only uses
the NIS v2 protocol, however other implementations include support for the v1
protocol for backwards compatibility with older systems. The
ypbind(8)
daemons supplied with these systems will try to establish a binding to an NIS
v1 server even though they may never actually need it (and they may persist in
broadcasting in search of one even after they receive a response from a v2
server). Note that while support for normal client calls is provided, this
version of ypserv does not handle v1 map transfer
requests; consequently, it cannot be used as a master or slave in conjunction
with older NIS servers that only support the v1 protocol. Fortunately, there
probably are not any such servers still in use today.
NIS servers that are also NIS clientsCare must be taken when runningypserv in a multi-server
domain where the server machines are also NIS clients. It is generally a good
idea to force the servers to bind to themselves rather than allowing them to
broadcast bind requests and possibly become bound to each other: strange
failure modes can result if one server goes down and others are dependent upon
on it. (Eventually all the clients will time out and attempt to bind to other
servers, but the delay involved can be considerable and the failure mode is
still present since the servers might bind to each other all over again).
Refer to the ypbind(8) man page for details on how to force it to bind to a particular server. OPTIONSThe following options are supported byypserv :
FILES
SEE ALSOypcat(1), db(3), hosts_access(5), rpc.yppasswdd(8), yp(8), ypbind(8), ypinit(8), yppush(8), ypxfr(8)HISTORYThis version ofypserv first appeared in
FreeBSD 2.2.
AUTHORSBill Paul <wpaul@ctr.columbia.edu>
Visit the GSP FreeBSD Man Page Interface. |