1c1d06ca1SGarrett Wollman.\" Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca> 2c1d06ca1SGarrett Wollman.\" All rights reserved. 3c1d06ca1SGarrett Wollman.\" 4c1d06ca1SGarrett Wollman.\" Redistribution and use in source and binary forms, with or without 5c1d06ca1SGarrett Wollman.\" modification, are permitted provided that the following conditions 6c1d06ca1SGarrett Wollman.\" are met: 7c1d06ca1SGarrett Wollman.\" 1. Redistributions of source code must retain the above copyright 8c1d06ca1SGarrett Wollman.\" notice, this list of conditions and the following disclaimer. 9c1d06ca1SGarrett Wollman.\" 2. Redistributions in binary form must reproduce the above copyright 10c1d06ca1SGarrett Wollman.\" notice, this list of conditions and the following disclaimer in the 11c1d06ca1SGarrett Wollman.\" documentation and/or other materials provided with the distribution. 12c1d06ca1SGarrett Wollman.\" 3. The name of the author may not be used to endorse or promote 13c1d06ca1SGarrett Wollman.\" products derived from this software without specific prior written 14c1d06ca1SGarrett Wollman.\" permission. 15c1d06ca1SGarrett Wollman.\" 16c1d06ca1SGarrett Wollman.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 17c1d06ca1SGarrett Wollman.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18c1d06ca1SGarrett Wollman.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19c1d06ca1SGarrett Wollman.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 20c1d06ca1SGarrett Wollman.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21c1d06ca1SGarrett Wollman.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22c1d06ca1SGarrett Wollman.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23c1d06ca1SGarrett Wollman.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24c1d06ca1SGarrett Wollman.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25c1d06ca1SGarrett Wollman.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26c1d06ca1SGarrett Wollman.\" SUCH DAMAGE. 27c1d06ca1SGarrett Wollman.\" 288d6c73abSJoel Dahl.Dd December 14, 2011 29491a8429SRuslan Ermilov.Dt YP 8 303d45e180SRuslan Ermilov.Os 31c1d06ca1SGarrett Wollman.Sh NAME 32c1d06ca1SGarrett Wollman.Nm yp 330c319849SBill Paul.Nd description of the YP/NIS system 34c1d06ca1SGarrett Wollman.Sh SYNOPSIS 354b66483fSRuslan Ermilov.Nm 36c1d06ca1SGarrett Wollman.Sh DESCRIPTION 37c1d06ca1SGarrett WollmanThe 38c1d06ca1SGarrett Wollman.Nm YP 390c319849SBill Paulsubsystem allows network management of passwd, group, netgroup, hosts, 400c319849SBill Paulservices, rpc, bootparams and ethers file 410c319849SBill Paulentries through the functions 420c319849SBill Paul.Xr getpwent 3 , 430c319849SBill Paul.Xr getgrent 3 , 440c319849SBill Paul.Xr getnetgrent 3 , 450c319849SBill Paul.Xr gethostent 3 , 460c319849SBill Paul.Xr getnetent 3 , 470c319849SBill Paul.Xr getrpcent 3 , 480c319849SBill Pauland 490c319849SBill Paul.Xr ethers 3 . 500c319849SBill PaulThe 51edf0e5b3SMike Pritchard.Xr bootparamd 8 5200e68c0dSPhilippe Charnierdaemon makes direct 5300e68c0dSPhilippe Charnier.Tn NIS 5400e68c0dSPhilippe Charnierlibrary calls since there are no 5500e68c0dSPhilippe Charnierfunctions in the standard C library for reading bootparams. 5600e68c0dSPhilippe Charnier.Tn NIS 57248aee62SJacques Vidrinesupport is enabled in 581692a4f1SSheldon Hearn.Xr nsswitch.conf 5 . 590c319849SBill Paul.Pp 60c1d06ca1SGarrett WollmanThe 61c1d06ca1SGarrett Wollman.Nm YP 62c1d06ca1SGarrett Wollmansubsystem is started automatically in 630c319849SBill Paul.Pa /etc/rc 640c319849SBill Paulif it has been initialized in 6530d8a82fSPhilippe Charnier.Pa /etc/rc.conf 660c319849SBill Pauland if the directory 67edf0e5b3SMike Pritchard.Pa /var/yp 68e6676766SRuslan Ermilovexists (which it does in the default distribution). 69e6676766SRuslan ErmilovThe default 7000e68c0dSPhilippe Charnier.Tn NIS 7100e68c0dSPhilippe Charnierdomain must also be set with the 720c319849SBill Paul.Xr domainname 1 730c319849SBill Paulcommand, which will happen automatically at system startup if it is 740c319849SBill Paulspecified in 7530d8a82fSPhilippe Charnier.Pa /etc/rc.conf . 760c319849SBill Paul.Pp 7700e68c0dSPhilippe Charnier.Tn NIS 7800e68c0dSPhilippe Charnieris an 7900e68c0dSPhilippe Charnier.Tn RPC Ns -based 8000e68c0dSPhilippe Charnierclient/server system that allows a group of 8100e68c0dSPhilippe Charniermachines within an 8200e68c0dSPhilippe Charnier.Tn NIS 834e86fcacSSheldon Hearndomain to share a common set of configuration files. 844e86fcacSSheldon HearnThis permits a system 8500e68c0dSPhilippe Charnieradministrator to set up 8600e68c0dSPhilippe Charnier.Tn NIS 8700e68c0dSPhilippe Charnierclient systems with only minimal configuration 880c319849SBill Pauldata and add, remove or modify configuration data from a single location. 890c319849SBill Paul.Pp 9000e68c0dSPhilippe CharnierThe canonical copies of all 9100e68c0dSPhilippe Charnier.Tn NIS 9200e68c0dSPhilippe Charnierinformation are stored on a single machine 930c319849SBill Paulcalled the 94e6676766SRuslan Ermilov.Tn NIS 95e6676766SRuslan Ermilov.Em "master server" . 960c319849SBill PaulThe databases used to store the information are called 97e6676766SRuslan Ermilov.Tn NIS 98e6676766SRuslan Ermilov.Em maps . 99dd5527c6SMike PritchardIn 100b5c508fbSRuslan Ermilov.Fx , 101dd5527c6SMike Pritchardthese maps are stored in 102e6676766SRuslan Ermilov.Pa /var/yp/ Ns Aq Ar domainname 1030c319849SBill Paulwhere 104e6676766SRuslan Ermilov.Aq Ar domainname 10500e68c0dSPhilippe Charnieris the name of the 10600e68c0dSPhilippe Charnier.Tn NIS 1074e86fcacSSheldon Hearndomain being served. 1084e86fcacSSheldon HearnA single 10900e68c0dSPhilippe Charnier.Tn NIS 11000e68c0dSPhilippe Charnierserver can 1110c319849SBill Paulsupport several domains at once, therefore it is possible to have several 1124e86fcacSSheldon Hearnsuch directories, one for each supported domain. 1134e86fcacSSheldon HearnEach domain will have 1140c319849SBill Paulits own independent set of maps. 1150c319849SBill Paul.Pp 116dd5527c6SMike PritchardIn 117b5c508fbSRuslan Ermilov.Fx , 11800e68c0dSPhilippe Charnierthe 11900e68c0dSPhilippe Charnier.Tn NIS 12000e68c0dSPhilippe Charniermaps are Berkeley DB hashed database files (the 1210c319849SBill Paulsame format used for the 1220c319849SBill Paul.Xr passwd 5 123e6676766SRuslan Ermilovdatabase files). 124e6676766SRuslan ErmilovOther operating systems that support 12500e68c0dSPhilippe Charnier.Tn NIS 12600e68c0dSPhilippe Charnieruse old-style 127e6676766SRuslan Ermilov.Nm ndbm 128e6676766SRuslan Ermilovdatabases instead (largely because Sun Microsystems originally based 12900e68c0dSPhilippe Charniertheir 13000e68c0dSPhilippe Charnier.Tn NIS 131e6676766SRuslan Ermilovimplementation on 132e6676766SRuslan Ermilov.Nm ndbm , 133e6676766SRuslan Ermilovand other vendors have simply licensed 1340c319849SBill PaulSun's code rather than design their own implementation with a different 135e6676766SRuslan Ermilovdatabase format). 136e6676766SRuslan ErmilovOn these systems, the databases are generally split 1370c319849SBill Paulinto 138e6676766SRuslan Ermilov.Pa .dir 139c1d06ca1SGarrett Wollmanand 140e6676766SRuslan Ermilov.Pa .pag 141e6676766SRuslan Ermilovfiles which the 142e6676766SRuslan Ermilov.Nm ndbm 143e6676766SRuslan Ermilovcode uses to hold separate parts of the hash 1444e86fcacSSheldon Hearndatabase. 1454e86fcacSSheldon HearnThe Berkeley DB hash method instead uses a single file for 1464e86fcacSSheldon Hearnboth pieces of information. 1474e86fcacSSheldon HearnThis means that while you may have 1480c319849SBill Paul.Pa passwd.byname.dir 1490c319849SBill Pauland 1500c319849SBill Paul.Pa passwd.byname.pag 1510c319849SBill Paulfiles on other operating systems (both of which are really parts of the 152dd5527c6SMike Pritchardsame map), 153b5c508fbSRuslan Ermilov.Fx 154dd5527c6SMike Pritchardwill have only one file called 1550c319849SBill Paul.Pa passwd.byname . 1560c319849SBill PaulThe difference in format is not significant: only the 15700e68c0dSPhilippe Charnier.Tn NIS 15800e68c0dSPhilippe Charnierserver, 1590c319849SBill Paul.Xr ypserv 8 , 16000e68c0dSPhilippe Charnierand related tools need to know the database format of the 16100e68c0dSPhilippe Charnier.Tn NIS 1624e86fcacSSheldon Hearnmaps. 1634e86fcacSSheldon HearnClient 16400e68c0dSPhilippe Charnier.Tn NIS 16500e68c0dSPhilippe Charniersystems receive all 16600e68c0dSPhilippe Charnier.Tn NIS 16700e68c0dSPhilippe Charnierdata in 16800e68c0dSPhilippe Charnier.Tn ASCII 16900e68c0dSPhilippe Charnierform. 1700c319849SBill Paul.Pp 17100e68c0dSPhilippe CharnierThere are three main types of 17200e68c0dSPhilippe Charnier.Tn NIS 17300e68c0dSPhilippe Charniersystems: 174e6676766SRuslan Ermilov.Bl -enum 1750c319849SBill Paul.It 1761f1dcc1dSRuslan Ermilov.Tn NIS 1771f1dcc1dSRuslan Ermilovclients, 17800e68c0dSPhilippe Charnierwhich query 17900e68c0dSPhilippe Charnier.Tn NIS 18000e68c0dSPhilippe Charnierservers for information. 1810c319849SBill Paul.It 1821f1dcc1dSRuslan Ermilov.Tn NIS 1831f1dcc1dSRuslan Ermilovmaster servers, 18400e68c0dSPhilippe Charnierwhich maintain the canonical copies of all 18500e68c0dSPhilippe Charnier.Tn NIS 18600e68c0dSPhilippe Charniermaps. 1870c319849SBill Paul.It 1881f1dcc1dSRuslan Ermilov.Tn NIS 1891f1dcc1dSRuslan Ermilovslave servers, 19000e68c0dSPhilippe Charnierwhich maintain backup copies of 19100e68c0dSPhilippe Charnier.Tn NIS 19200e68c0dSPhilippe Charniermaps that are periodically 1930c319849SBill Paulupdated by the master. 1940c319849SBill Paul.El 1950c319849SBill Paul.Pp 196e6676766SRuslan ErmilovA 19700e68c0dSPhilippe Charnier.Tn NIS 19800e68c0dSPhilippe Charnierclient establishes what is called a 199edf0e5b3SMike Pritchard.Em binding 20000e68c0dSPhilippe Charnierto a particular 20100e68c0dSPhilippe Charnier.Tn NIS 20200e68c0dSPhilippe Charnierserver using the 2030c319849SBill Paul.Xr ypbind 8 2040c319849SBill Pauldaemon. 205c42ce50dSPhilippe CharnierThe 206c42ce50dSPhilippe Charnier.Xr ypbind 8 207c42ce50dSPhilippe Charnierutility checks the system's default domain (as set by the 2080c319849SBill Paul.Xr domainname 1 20900e68c0dSPhilippe Charniercommand) and begins broadcasting 21000e68c0dSPhilippe Charnier.Tn RPC 21100e68c0dSPhilippe Charnierrequests on the local network. 2120c319849SBill PaulThese requests specify the name of the domain for which 2130c319849SBill Paul.Xr ypbind 8 2144e86fcacSSheldon Hearnis attempting to establish a binding. 2154e86fcacSSheldon HearnIf a server that has been 2160c319849SBill Paulconfigured to serve the requested domain receives one of the broadcasts, 2170c319849SBill Paulit will respond to 2180c319849SBill Paul.Xr ypbind 8 , 2194e86fcacSSheldon Hearnwhich will record the server's address. 2204e86fcacSSheldon HearnIf there are several servers 2210c319849SBill Paulavailable (a master and several slaves, for example), 2220c319849SBill Paul.Xr ypbind 8 2234e86fcacSSheldon Hearnwill use the address of the first one to respond. 2244e86fcacSSheldon HearnFrom that point 22500e68c0dSPhilippe Charnieron, the client system will direct all of its 22600e68c0dSPhilippe Charnier.Tn NIS 22700e68c0dSPhilippe Charnierrequests to that server. 228c42ce50dSPhilippe CharnierThe 229c42ce50dSPhilippe Charnier.Xr ypbind 8 230c42ce50dSPhilippe Charnierutility will occasionally 231e6676766SRuslan Ermilov.Dq ping 232e6676766SRuslan Ermilovthe server to make sure it is still up 2334e86fcacSSheldon Hearnand running. 2344e86fcacSSheldon HearnIf it fails to receive a reply to one of its pings 2354a8d0283SMike Pritchardwithin a reasonable amount of time, 2360c319849SBill Paul.Xr ypbind 8 2370c319849SBill Paulwill mark the domain as unbound and begin broadcasting again in the 2380c319849SBill Paulhopes of locating another server. 2390c319849SBill Paul.Pp 24000e68c0dSPhilippe Charnier.Tn NIS 24100e68c0dSPhilippe Charniermaster and slave servers handle all 24200e68c0dSPhilippe Charnier.Tn NIS 24300e68c0dSPhilippe Charnierrequests with the 2440c319849SBill Paul.Xr ypserv 8 2450c319849SBill Pauldaemon. 246c42ce50dSPhilippe CharnierThe 247c42ce50dSPhilippe Charnier.Xr ypserv 8 248c42ce50dSPhilippe Charnierutility is responsible for receiving incoming requests from 24900e68c0dSPhilippe Charnier.Tn NIS 25000e68c0dSPhilippe Charnierclients, 2510c319849SBill Paultranslating the requested domain and map name to a path to the 2520c319849SBill Paulcorresponding database file and transmitting data from the database 2534e86fcacSSheldon Hearnback to the client. 2544e86fcacSSheldon HearnThere is a specific set of requests that 2550c319849SBill Paul.Xr ypserv 8 2560c319849SBill Paulis designed to handle, most of which are implemented as functions 2570c319849SBill Paulwithin the standard C library: 258e6676766SRuslan Ermilov.Bl -tag -width ".Fn yp_master" 259e6676766SRuslan Ermilov.It Fn yp_order 260e6676766SRuslan Ermilovcheck the creation date of a particular map 261e6676766SRuslan Ermilov.It Fn yp_master 262e6676766SRuslan Ermilovobtain the name of the 26300e68c0dSPhilippe Charnier.Tn NIS 26400e68c0dSPhilippe Charniermaster server for a given 2650c319849SBill Paulmap/domain 266e6676766SRuslan Ermilov.It Fn yp_match 267e6676766SRuslan Ermilovlookup the data corresponding to a given in key in a particular 2680c319849SBill Paulmap/domain 269e6676766SRuslan Ermilov.It Fn yp_first 270e6676766SRuslan Ermilovobtain the first key/data pair in a particular map/domain 271e6676766SRuslan Ermilov.It Fn yp_next 272e6676766SRuslan Ermilovpass 2730c319849SBill Paul.Xr ypserv 8 2740c319849SBill Paula key in a particular map/domain and have it return the 275edf0e5b3SMike Pritchardkey/data pair immediately following it (the functions 276edf0e5b3SMike Pritchard.Fn yp_first 277edf0e5b3SMike Pritchardand 278edf0e5b3SMike Pritchard.Fn yp_next 27900e68c0dSPhilippe Charniercan be used to do a sequential search of an 28000e68c0dSPhilippe Charnier.Tn NIS 28100e68c0dSPhilippe Charniermap) 282e6676766SRuslan Ermilov.It Fn yp_all 283e6676766SRuslan Ermilovretrieve the entire contents of a map 2840c319849SBill Paul.El 2850c319849SBill Paul.Pp 2860c319849SBill PaulThere are a few other requests which 287edf0e5b3SMike Pritchard.Xr ypserv 8 2885203edcdSRuslan Ermilovis capable of handling (i.e., acknowledge whether or not you can handle 289e6676766SRuslan Ermilova particular domain 290e6676766SRuslan Ermilov.Pq Dv YPPROC_DOMAIN , 291e6676766SRuslan Ermilovor acknowledge only if you can handle the domain and be silent otherwise 292e6676766SRuslan Ermilov.Pq Dv YPPROC_DOMAIN_NONACK ) 293e6676766SRuslan Ermilovbut 2940c319849SBill Paulthese requests are usually generated only by 295edf0e5b3SMike Pritchard.Xr ypbind 8 2960c319849SBill Pauland are not meant to be used by standard utilities. 2970c319849SBill Paul.Pp 2980c319849SBill PaulOn networks with a large number of hosts, it is often a good idea to 2990c319849SBill Pauluse a master server and several slaves rather than just a single master 3004e86fcacSSheldon Hearnserver. 3014e86fcacSSheldon HearnA slave server provides the exact same information as a master 3020c319849SBill Paulserver: whenever the maps on the master server are updated, the new 3030c319849SBill Pauldata should be propagated to the slave systems using the 3040c319849SBill Paul.Xr yppush 8 3054e86fcacSSheldon Hearncommand. 3064e86fcacSSheldon HearnThe 30700e68c0dSPhilippe Charnier.Tn NIS 308e6676766SRuslan Ermilov.Pa Makefile 309e6676766SRuslan Ermilov.Pq Pa /var/yp/Makefile 31053c40578SBrian Somerswill do this automatically if the administrator creates 31153c40578SBrian Somers.Pa /var/yp/Makefile.local 31253c40578SBrian Somersand empties the 31353c40578SBrian Somers.Va NOPUSH 31453c40578SBrian Somersvariable: 31553c40578SBrian Somers.Bd -literal -offset four 31653c40578SBrian Somers.Li NOPUSH= 31753c40578SBrian Somers.Ed 31853c40578SBrian Somers.Pp 319e6676766SRuslan Ermilov.Va ( NOPUSH 320e6676766SRuslan Ermilovis set to true by default because the default configuration is 32100e68c0dSPhilippe Charnierfor a small network with only one 32200e68c0dSPhilippe Charnier.Tn NIS 323e6676766SRuslan Ermilovserver). 324e6676766SRuslan ErmilovThe 3250c319849SBill Paul.Xr yppush 8 3260c319849SBill Paulcommand will initiate a transaction between the master and slave 3270c319849SBill Paulduring which the slave will transfer the specified maps from the 3280c319849SBill Paulmaster server using 3290c319849SBill Paul.Xr ypxfr 8 . 3300c319849SBill Paul(The slave server calls 3310c319849SBill Paul.Xr ypxfr 8 3320c319849SBill Paulautomatically from within 3330c319849SBill Paul.Xr ypserv 8 ; 3340c319849SBill Paultherefore it is not usually necessary for the administrator 3354e86fcacSSheldon Hearnto use it directly. 3364e86fcacSSheldon HearnIt can be run manually if 3374e86fcacSSheldon Hearndesired, however.) 3384e86fcacSSheldon HearnMaintaining 33900e68c0dSPhilippe Charnierslave servers helps improve 34000e68c0dSPhilippe Charnier.Tn NIS 34100e68c0dSPhilippe Charnierperformance on large 3420c319849SBill Paulnetworks by: 343e6676766SRuslan Ermilov.Bl -bullet 3440c319849SBill Paul.It 34500e68c0dSPhilippe CharnierProviding backup services in the event that the 34600e68c0dSPhilippe Charnier.Tn NIS 34700e68c0dSPhilippe Charniermaster crashes 3484a8d0283SMike Pritchardor becomes unreachable 3490c319849SBill Paul.It 3500c319849SBill PaulSpreading the client load out over several machines instead of 3510c319849SBill Paulcausing the master to become overloaded 3520c319849SBill Paul.It 35300e68c0dSPhilippe CharnierAllowing a single 35400e68c0dSPhilippe Charnier.Tn NIS 35500e68c0dSPhilippe Charnierdomain to extend beyond 3560c319849SBill Paula local network (the 3570c319849SBill Paul.Xr ypbind 8 3580c319849SBill Pauldaemon might not be able to locate a server automatically if it resides on 3594e86fcacSSheldon Hearna network outside the reach of its broadcasts. 3604e86fcacSSheldon HearnIt is possible to force 3610c319849SBill Paul.Xr ypbind 8 3620c319849SBill Paulto bind to a particular server with 3630c319849SBill Paul.Xr ypset 8 3644e86fcacSSheldon Hearnbut this is sometimes inconvenient. 3654e86fcacSSheldon HearnThis problem can be avoided simply by 3660c319849SBill Paulplacing a slave server on the local network.) 3670c319849SBill Paul.El 3680c319849SBill Paul.Pp 369dd5527c6SMike PritchardThe 370b5c508fbSRuslan Ermilov.Fx 3710c319849SBill Paul.Xr ypserv 8 372568fb879SRuslan Ermilovis specially designed to provide enhanced security (compared to 37300e68c0dSPhilippe Charnierother 37400e68c0dSPhilippe Charnier.Tn NIS 37500e68c0dSPhilippe Charnierimplementations) when used exclusively with 376b5c508fbSRuslan Ermilov.Fx 377dd5527c6SMike Pritchardclient 3784e86fcacSSheldon Hearnsystems. 3794e86fcacSSheldon HearnThe 380b5c508fbSRuslan Ermilov.Fx 381dd5527c6SMike Pritchardpassword database system (which is derived directly 38221421932SMike Pritchardfrom 38321421932SMike Pritchard.Bx 4.4 ) 38421421932SMike Pritchardincludes support for 385edf0e5b3SMike Pritchard.Em "shadow passwords" . 3864a8d0283SMike PritchardThe standard password database does not contain users' encrypted 3870c319849SBill Paulpasswords: these are instead stored (along with other information) 38892585090SMasafumi Max NAKANEin a separate database which is accessible only by the super-user. 38900e68c0dSPhilippe CharnierIf the encrypted password database were made available as an 39000e68c0dSPhilippe Charnier.Tn NIS 3910c319849SBill Paulmap, this security feature would be totally disabled, since any user 39200e68c0dSPhilippe Charnieris allowed to retrieve 39300e68c0dSPhilippe Charnier.Tn NIS 39400e68c0dSPhilippe Charnierdata. 3950c319849SBill Paul.Pp 396dd5527c6SMike PritchardTo help prevent this, 397b5c508fbSRuslan Ermilov.Fx Ns 's 39800e68c0dSPhilippe Charnier.Tn NIS 39900e68c0dSPhilippe Charnierserver handles the shadow password maps 40053c40578SBrian Somers.Pa ( master.passwd.byname , 40153c40578SBrian Somers.Pa master.passwd.byuid , 40253c40578SBrian Somers.Pa shadow.byname 4030c319849SBill Pauland 40453c40578SBrian Somers.Pa shadow.byuid ) 4050c319849SBill Paulin a special way: the server will only provide access to these 4060c319849SBill Paulmaps in response to requests that originate on privileged ports. 4070c319849SBill PaulSince only the super-user is allowed to bind to a privileged port, 4080c319849SBill Paulthe server assumes that all such requests come from privileged 4094e86fcacSSheldon Hearnusers. 4104e86fcacSSheldon HearnAll other requests are denied: requests from non-privileged 4114e86fcacSSheldon Hearnports will receive only an error code from the server. 4124e86fcacSSheldon HearnAdditionally, 413b5c508fbSRuslan Ermilov.Fx Ns 's 4140c319849SBill Paul.Xr ypserv 8 415e6676766SRuslan Ermilovincludes support for 416e6676766SRuslan Ermilov.An Wietse Venema Ns 's 417e6676766SRuslan Ermilovtcp wrapper package; with tcp 4180c319849SBill Paulwrapper support enabled, the administrator can configure 4190c319849SBill Paul.Xr ypserv 8 4200c319849SBill Paulto respond only to selected client machines. 4210c319849SBill Paul.Pp 42200e68c0dSPhilippe CharnierWhile these enhancements provide better security than stock 423a654c53eSRuslan Ermilov.Tn NIS , 4244e86fcacSSheldon Hearnthey are by no means 100% effective. 4254e86fcacSSheldon HearnIt is still possible for 4260c319849SBill Paulsomeone with access to your network to spoof the server into disclosing 4270c319849SBill Paulthe shadow password maps. 4280c319849SBill Paul.Pp 429dd5527c6SMike PritchardOn the client side, 430b5c508fbSRuslan Ermilov.Fx Ns 's 431e6676766SRuslan Ermilov.Xr getpwent 3 4320c319849SBill Paulfunctions will automatically search for the 4330c319849SBill Paul.Pa master.passwd 4344e86fcacSSheldon Hearnmaps and use them if they exist. 4354e86fcacSSheldon HearnIf they do, they will be used, and 4360c319849SBill Paulall fields in these special maps (class, password age and account 4374e86fcacSSheldon Hearnexpiration) will be decoded. 438e6676766SRuslan ErmilovIf they are not found, the standard 4390c319849SBill Paul.Pa passwd 4400c319849SBill Paulmaps will be used instead. 4410c319849SBill Paul.Sh COMPATIBILITY 442b5c508fbSRuslan ErmilovWhen using a 443b5c508fbSRuslan Ermilov.No non- Ns Fx 444e6676766SRuslan Ermilov.Tn NIS 445e6676766SRuslan Ermilovserver for 446d29b3051SBrian Feldman.Xr passwd 5 447b5c508fbSRuslan Ermilovfiles, it is unlikely that the default MD5-based format that 448b5c508fbSRuslan Ermilov.Fx 449d29b3051SBrian Feldmanuses for passwords will be accepted by it. 450e6676766SRuslan ErmilovIf this is the case, the value of the 451e6676766SRuslan Ermilov.Va passwd_format 452e6676766SRuslan Ermilovsetting in 453d29b3051SBrian Feldman.Xr login.conf 5 454e6676766SRuslan Ermilovshould be changed to 455e6676766SRuslan Ermilov.Qq Li des 456e6676766SRuslan Ermilovfor compatibility. 457d29b3051SBrian Feldman.Pp 458e6676766SRuslan ErmilovSome systems, such as 459e6676766SRuslan Ermilov.Tn SunOS 460e6676766SRuslan Ermilov4.x, need 46100e68c0dSPhilippe Charnier.Tn NIS 46200e68c0dSPhilippe Charnierto be running in order 4636f238937SDima Dorfmanfor their hostname resolution functions 464*548afe2bSChristian Brueffer.Po Fn gethostbyname , 4653dcd2b7eSRuslan Ermilov.Fn gethostbyaddr , 466*548afe2bSChristian Bruefferetc. 467*548afe2bSChristian Brueffer.Pc 468*548afe2bSChristian Bruefferto work properly. 4694e86fcacSSheldon HearnOn these systems, 4700c319849SBill Paul.Xr ypserv 8 47100e68c0dSPhilippe Charnierperforms 47200e68c0dSPhilippe Charnier.Tn DNS 47300e68c0dSPhilippe Charnierlookups when asked to return information about 474e6676766SRuslan Ermilova host that does not exist in its 4750c319849SBill Paul.Pa hosts.byname 4760c319849SBill Paulor 4770c319849SBill Paul.Pa hosts.byaddr 478dd5527c6SMike Pritchardmaps. 479b5c508fbSRuslan Ermilov.Fx Ns 's 48000e68c0dSPhilippe Charnierresolver uses 48100e68c0dSPhilippe Charnier.Tn DNS 48200e68c0dSPhilippe Charnierby default (it can be made to use 483e6676766SRuslan Ermilov.Tn NIS , 48400e68c0dSPhilippe Charnierif desired), therefore its 48500e68c0dSPhilippe Charnier.Tn NIS 486e6676766SRuslan Ermilovserver does not do 48710edb738SNik Clayton.Tn DNS 48800e68c0dSPhilippe Charnierlookups 4894e86fcacSSheldon Hearnby default. 4904e86fcacSSheldon HearnHowever, 4910c319849SBill Paul.Xr ypserv 8 49200e68c0dSPhilippe Charniercan be made to perform 49300e68c0dSPhilippe Charnier.Tn DNS 49400e68c0dSPhilippe Charnierlookups if it is started with a special 4954e86fcacSSheldon Hearnflag. 4964e86fcacSSheldon HearnIt can also be made to register itself as an 49700e68c0dSPhilippe Charnier.Tn NIS 49800e68c0dSPhilippe Charnierv1 server 4990c319849SBill Paulin order to placate certain systems that insist on the presence of 500dd5527c6SMike Pritcharda v1 server 501*548afe2bSChristian Brueffer.Po Fx 50200e68c0dSPhilippe Charnieruses only 50300e68c0dSPhilippe Charnier.Tn NIS 50400e68c0dSPhilippe Charnierv2, but many other systems, 505dd5527c6SMike Pritchardincluding 506dd5527c6SMike Pritchard.Tn SunOS 507*548afe2bSChristian Brueffer4.x, search for both a v1 and v2 server when binding 508*548afe2bSChristian Brueffer.Pc . 509b5c508fbSRuslan Ermilov.Fx Ns 's 5100c319849SBill Paul.Xr ypserv 8 51100e68c0dSPhilippe Charnierdoes not actually handle 51200e68c0dSPhilippe Charnier.Tn NIS 513e6676766SRuslan Ermilovv1 requests, but this 514e6676766SRuslan Ermilov.Dq "kludge mode" 5150c319849SBill Paulis useful for silencing stubborn systems that search for both 5160c319849SBill Paula v1 and v2 server. 5170c319849SBill Paul.Pp 5180c319849SBill Paul(Please see the 5190c319849SBill Paul.Xr ypserv 8 5200c319849SBill Paulmanual page for a detailed description of these special features 5210c319849SBill Pauland flags.) 5228d6c73abSJoel Dahl.Sh SEE ALSO 5238d6c73abSJoel Dahl.Xr domainname 1 , 5248d6c73abSJoel Dahl.Xr ypcat 1 , 5258d6c73abSJoel Dahl.Xr ypmatch 1 , 5268d6c73abSJoel Dahl.Xr ypwhich 1 , 5278d6c73abSJoel Dahl.Xr nsswitch.conf 5 , 5288d6c73abSJoel Dahl.Xr yp_mkdb 8 , 5298d6c73abSJoel Dahl.Xr ypbind 8 , 5308d6c73abSJoel Dahl.Xr ypinit 8 , 5318d6c73abSJoel Dahl.Xr yppoll 8 , 5328d6c73abSJoel Dahl.Xr yppush 8 , 5338d6c73abSJoel Dahl.Xr ypserv 8 , 5348d6c73abSJoel Dahl.Xr ypset 8 , 5358d6c73abSJoel Dahl.Xr ypxfr 8 5369cbda590SRuslan Ermilov.Sh HISTORY 5379cbda590SRuslan ErmilovThe 5389cbda590SRuslan Ermilov.Nm YP 5399cbda590SRuslan Ermilovsubsystem was written from the ground up by 5409cbda590SRuslan Ermilov.An Theo de Raadt 5419cbda590SRuslan Ermilovto be compatible to Sun's implementation. 5429cbda590SRuslan ErmilovBug fixes, improvements 5439cbda590SRuslan Ermilovand 5449cbda590SRuslan Ermilov.Tn NIS 5459cbda590SRuslan Ermilovserver support were later added by 5469cbda590SRuslan Ermilov.An Bill Paul . 5479cbda590SRuslan ErmilovThe server-side code was originally written by 5489cbda590SRuslan Ermilov.An Peter Eriksson 5499cbda590SRuslan Ermilovand 5509cbda590SRuslan Ermilov.An Tobias Reber 5519cbda590SRuslan Ermilovand is subject to the GNU Public License. 5529cbda590SRuslan ErmilovNo Sun code was 5539cbda590SRuslan Ermilovreferenced. 5540c319849SBill Paul.Sh BUGS 555dd5527c6SMike PritchardWhile 556b5c508fbSRuslan Ermilov.Fx 55700e68c0dSPhilippe Charniernow has both 55800e68c0dSPhilippe Charnier.Tn NIS 55900e68c0dSPhilippe Charnierclient and server capabilities, it does not yet have support for 5606a6c4c22SMike Pritchard.Xr ypupdated 8 5610c319849SBill Paulor the 5620c319849SBill Paul.Fn yp_update 5634e86fcacSSheldon Hearnfunction. 5644e86fcacSSheldon HearnBoth of these require secure 565e6676766SRuslan Ermilov.Tn RPC , 56600e68c0dSPhilippe Charnierwhich 567b5c508fbSRuslan Ermilov.Fx 568e6676766SRuslan Ermilovdoes not 5690c319849SBill Paulsupport yet either. 5700c319849SBill Paul.Pp 5710c319849SBill PaulThe 5720c319849SBill Paul.Xr getservent 3 5730c319849SBill Pauland 5740c319849SBill Paul.Xr getprotoent 3 57500e68c0dSPhilippe Charnierfunctions do not yet have 57600e68c0dSPhilippe Charnier.Tn NIS 5774e86fcacSSheldon Hearnsupport. 5784e86fcacSSheldon HearnFortunately, these files 579e6676766SRuslan Ermilovdo not need to be updated that often. 5800c319849SBill Paul.Pp 581edf0e5b3SMike PritchardMany more manual pages should be written, especially 582edf0e5b3SMike Pritchard.Xr ypclnt 3 . 583c1d06ca1SGarrett WollmanFor the time being, seek out a local Sun machine and read the 584c1d06ca1SGarrett Wollmanmanuals for there. 5850c319849SBill Paul.Pp 586c1d06ca1SGarrett WollmanNeither Sun nor this author have found a clean way to handle 587c1d06ca1SGarrett Wollmanthe problems that occur when ypbind cannot find its server 588c1d06ca1SGarrett Wollmanupon bootup. 589