The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.

Things look quiet here. But I've been doing a lot of blogging at because I prefer WordPress now. Not all my posts there are FreeBSD related. I am in the midst of migrating The FreeBSD Diary over to WordPress (and you can read about that here). Once the migration is completed, I'll move the FreeBSD posts into the new FreeBSD Diary website.

Setting up FreeBSD as an NIS client --- by Eric Anderson 23 December 2000
Need more help on this topic? Click here
This article has no comments
Show me similar articles
This article was written by Eric Anderson.

So what if you want to use your FreeBSD box as a client on a network that is running NIS?  Simple!  This should walk you through most of the setup.   Of course, have FreeBSD 3.3 or greater installed with your network settings already working before doing this.

Setting up the client
We are going to assume a few things about your setup.  Your NIS domain is, and your NIS servers are nisserver1 (master) and nisserver2 (slave).   Edit your /etc/rc.conf and add the following lines:

The spacing is important on some versions of FreeBSD, so be careful to keep the spacing correct.

Now, edit your /etc/group file, and add a + to the end (last line). It should look something like:

Editing name resolution order
Next, edit your /etc/host.conf file, and make sure you uncomment nis, so it looks something like:
# $FreeBSD: src/etc/host.conf,v 1999/08/29 14:18:44 peter Exp $
# First try the /etc/hosts file
# Now try the nameserver next.
# If you have YP/NIS configured, uncomment the next line
Editing the hosts file
Edit your /etc/hosts file and make sure you have the local machine, and both NIS servers in the list.  Add a +:: to the end (last line). It should look something like this (you may not have to do this if you are a name server):
# $FreeBSD: src/etc/hosts,v 1999/08/29 14:18:44 peter Exp $
# Host Database
# This file should contain the addresses and aliases
# for local hosts that share this file.
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/host.conf for the resolution 
# order.
#      localhost     fridge      nisserver1      nisserver2
Editing the master.passwd file
Now do a vipw master.passwd, and add a +::::::::: to the end (last line) of the file.  It should look something like this:
uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
xten:*:67:67::0:0:X-10 daemon:/usr/local/xten:/sbin/nologin
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin

Do NOT edit the passwd file, and make sure you have the right number of :'s.   Also, make sure you have the correct DNS settings in your /etc/resolv.conf file.

Need more help on this topic? Click here
This article has no comments
Show me similar articles