Author: Ross Dickey
Date: 16-04-08 21:38
I found this article on setting up NIS on FreeBSD:
http://www.freebsddiary.org/nis-client.php
It's a bit outdated and doesn't work anymore. So I updated it, but I don't know where/how to submit it, or how to make the cool formatting. Here's the text for now in case someone needs it. Worksforme on 7.0-release. Not sure about forward/backward compatability:
Setting up the client
We 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 -S domain.com,nisserver1,nisserver2"
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:
dialer:*:68:
network:*:69:
nogroup:*:65533:
nobody:*:65534:
+:::
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):
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 nsswitch.conf file
Edit your /etc/nsswitch.conf file, and change these lines:
group: compat
passwd: compat
hosts: files dns
To this:
group: files nis
passwd: files nis
hosts: files dns nis
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.
The easiest thing to do at this point is to reboot.
|
|