Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Mar 1997 22:39:20 -0500
From:      "Troy Settle" <rewt@i-Plus.net>
To:        freebsd-questions@freebsd.org, breyer@breyer.com, breyer@breyer.jsnet.com
Subject:   Re: How do I create an NIS Master?
Message-ID:  <199703050326.WAA09349@Radford.i-Plus.net>
In-Reply-To: <331BEA53.5FB8@barcode.co.il>

next in thread | previous in thread | raw e-mail | index | archive | help
> Larry Breyer wrote:
> > 
> > Hello,
> > 
> > I ran "NIS Master" through your search engine and got two
> > 1000 pt. hits.  Unfortunately the links were no good.  So,
> > I ask, how do I create an NIS Master with FreeBSD?
> > 
> > thanks,
> > 
> > Larry Breyer
> > 408-222-7027
> 
> Start by reading 'man yp', and then go on to read the manpages for the
> utilities and daemons mentioned there.
> 
> Basically, you need to set up a couple of options in /etc/sysconfig, and
> build the NIS database itself (by running make in /var/yp, after
> creating a NIS domain and possibly editing the Makefile there).
> 
> Nadav
> 

And when/if you get stumped (Like I did), try this, it was given to 
me by somone (ksh?) on irc #FreeBSD.  All that's missing, is a simple 
way to add/remove users.  But nothing a few simple scripts can't 
handle.

--- yp.readme ---

The NIS support in FreeBSD is fairly complete. rpc.ypupdated is only
available if you have Secure RPC, which FreeBSD doesn't currently
support. (Though with any luck it will before too long.) However it's
not mornally needed for plain NIS support. The getservent(3) code was
updated to support NIS before 2.1.5 was released. 2.1.6 and 2.2 will
have it too. (getservent(3) is for reading /etc/services). The
getprotoent(3) code in libc still doesn't have YP support, however the
/etc/protocols file is quite small and doesn't tend to change very
often. I plan to add NIS client support for this eventually though.

Everything else is there. FreeBSD has NIS client and server support
starting with 2.1.0. There were a few bug fixes for 2.1.5 (and
there'll be a few more for 2.1.6). 2.2.0 will have all new server
support (the existing code was written by other people and ported to
FreeBSD by me, and is subject to the GPL; the new code is all written
by me and is covered by a BSD-style copyright).

Anyway. Assuming you know how to use NIS, you should be able to get
FreeBSD's NIS support to do what you want. One machine will need to
run ypserv and yppasswdd (or rpc.yppasswdd in 2.2.x) in order to be a
server. Both will need to be configured as clients. (The one which is
a server will be a client of itself, if that makes any sense.) Read
the passwd(5) man page to see how to set up /etc/master.passwd for the
client support. To create a server, do the following:

# domainname your.chosen.nis.domain.name
# cd /var/yp
# ln -s Makefile.dist Makefile (do this if /var/yp/Makefile doesn't
# exist) cp /etc/master.passwd . hostname > ypservers make ypserv
# yppasswdd -m /var/yp/master.passwd -s -f <edit /etc/sysconfig, and
# set the following things:

  defaultdomainname=your.chosen.nis.domain
  nis_serverflags="-dns"
  yppasswddflags="-m /var/yp/master.passwd -s -f"
  This will cause ypserv and yppasswdd to start each time the system
  is booted.>
This will create the NIS maps and start ypserv and yppasswdd. (On
2.2.x, rpc.yppasswdd has different comand line switches, and there's
also an rpc.ypxfrd which is useful for sites with NIS master and slave
servers.) Note: Up until 2.2, you are required to run ypbind on the
server.  For the clients, just do this: # domainname
your.chosen.nis.domain.name # ypbind -s # <edit /etc/sysconfig and set
the following things:
  defaultdomainname=your.chosen.nis.domain
  nis_clientflags="-s"
  This will cause ypbind to start when the system is booted.>
# <vipw and add the following line:
+:::::::::
This will check the yppasswd maps for passwords if they are not stored
in /etc/master.passwd.> # <edit /etc/group and also add the following
line: +::: getgrent() and the other group calls will check the ypgroup
maps for groups if they are not in /etc/group.> Ultimately I hope to
add NIS+ support, but this is a little ways off yet. It probably won't
appear until FreeBSD 3.0 (at least) and probably later.

--- yp.readme ---

Good luck,
--
Troy Settle <st@i-Plus.net>
Network Administrator, iPlus Internet Services
http://www.i-Plus.net

( Stuff I said does not reflect the company I work  )
( for unless I'm speaking on behalf of said company )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703050326.WAA09349>