Setting up FreeBSD as an NIS clientThis 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 clientWe are going to assume a few things about your setup. Your NIS domain is domain.com, and your NIS servers are nisserver1 (master) and nisserver2 (slave). Edit your /etc/rc.conf and add the following lines:
nis_client_enable="YES" nisdomainname="domain.com" nis_client_flags="-S domain.com,nisserver1,nisserver2"
The spacing is important on some versions of FreeBSD, so be careful to keep the spacing
Now, edit your /etc/group file, and add a + to the end (last line). It should look something like:
dialer:*:68: network:*:69: nogroup:*:65533: nobody:*:65534: +
Editing name resolution orderNext, edit your /etc/host.conf file, and make sure you uncomment nis, so it looks something like:
# $FreeBSD: src/etc/host.conf,v 188.8.131.52 1999/08/29 14:18:44 peter Exp $ # First try the /etc/hosts file hosts # Now try the nameserver next. bind # If you have YP/NIS configured, uncomment the next line nis
Editing the hosts fileEdit 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 184.108.40.206 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. # # 127.0.0.1 localhost.yourdomain.com localhost 10.1.1.222 fridge.yourdomain.com fridge 10.1.1.76 nisserver1.yourdomain.com nisserver1 10.1.1.31 nisserver2.yourdomain.com nisserver2 +::
Editing the master.passwd fileNow 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.